some html5 compilation fixes

This commit is contained in:
Yoshman29
2022-11-05 19:42:28 +01:00
parent f854f88923
commit bb6221525a
4 changed files with 11 additions and 2 deletions
+4
View File
@@ -49,6 +49,7 @@ class ModsFolder {
* @param force Whenever the mod should be reloaded if it has already been loaded
*/
public static function loadMod(mod:String, force:Bool = false) {
#if MOD_SUPPORT
if (mod == null) return null; // may be loading base game
if (FileSystem.exists('${modsPath}$mod.zip')) {
@@ -60,6 +61,9 @@ class ModsFolder {
loadedMods.push(mod);
return e;
}
#else
return null;
#end
}
/**
+4 -1
View File
@@ -8,6 +8,8 @@ import funkin.windows.WindowsAPI.ConsoleColor;
class Logs {
private static var __showing:Bool = false;
public static var nativeTrace = Log.trace;
public static function init() {
Log.trace = function(v : Dynamic, ?infos : Null<haxe.PosInfos>) {
@@ -79,7 +81,8 @@ class Logs {
Sys.print("\r\n");
__showing = false;
#else
trace(text);
@:privateAccess
nativeTrace([for(t in text) t.text].join(""));
#end
}
+2
View File
@@ -110,7 +110,9 @@ class Main extends Sprite
// TODO: Mod switching
ModsFolder.init();
#if MOD_SUPPORT
ModsFolder.switchMod("introMod");
#end
#if GLOBAL_SCRIPT
funkin.scripting.GlobalScript.init();
+1 -1
View File
@@ -175,7 +175,7 @@ class Paths
if (!key.endsWith("/")) key = key + "/";
if (ModsFolder.currentModFolder == null)
if (ModsFolder.currentModFolder == null && !scanSource)
return getFolderContent(key, false, addPath, true);
var folderPath:String = scanSource ? getPreloadPath(key) : getLibraryPathForce(key, 'mods/${ModsFolder.currentModFolder}');