engine now remembers your last played mod
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
2129
|
||||
2132
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user