some html5 compilation fixes
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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}');
|
||||
|
||||
Reference in New Issue
Block a user