diff --git a/buildnumber.txt b/buildnumber.txt index 5a8694e0..3827a8bd 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2129 \ No newline at end of file +2132 \ No newline at end of file diff --git a/source/funkin/mods/ModsFolder.hx b/source/funkin/mods/ModsFolder.hx index d62dc8c3..9ccc4c11 100644 --- a/source/funkin/mods/ModsFolder.hx +++ b/source/funkin/mods/ModsFolder.hx @@ -1,5 +1,6 @@ package funkin.mods; +import funkin.options.Options; import funkin.menus.TitleState; import funkin.system.Main; import openfl.utils.AssetCache; @@ -72,7 +73,10 @@ class ModsFolder { */ public static function switchMod(mod:String) { unloadMod(ModsFolder.currentModFolder); - Paths.assetsTree.addLibrary(loadMod(ModsFolder.currentModFolder = mod)); + Options.lastLoadedMod = ModsFolder.currentModFolder = mod; + Options.save(); + if (ModsFolder.currentModFolder == null) return; + Paths.assetsTree.addLibrary(loadMod(ModsFolder.currentModFolder)); Main.refreshAssets(); onModSwitch.dispatch(ModsFolder.currentModFolder); diff --git a/source/funkin/options/Options.hx b/source/funkin/options/Options.hx index f46fab7d..44478e85 100644 --- a/source/funkin/options/Options.hx +++ b/source/funkin/options/Options.hx @@ -27,6 +27,8 @@ class Options public static var betaUpdates:Bool = false; public static var hitWindow:Float = 250; + public static var lastLoadedMod:String = null; + /** * PLAYER 1 CONTROLS */ diff --git a/source/funkin/system/Main.hx b/source/funkin/system/Main.hx index a2483f3e..ac7f25c3 100644 --- a/source/funkin/system/Main.hx +++ b/source/funkin/system/Main.hx @@ -209,7 +209,7 @@ class Main extends Sprite FlxG.signals.preStateCreate.add(onStateSwitch); #if MOD_SUPPORT - ModsFolder.switchMod("introMod"); + ModsFolder.switchMod(Options.lastLoadedMod); #end initTransition();