engine now remembers your last played mod

This commit is contained in:
Yoshman29
2023-01-21 01:46:49 +01:00
parent 7b5f0595c7
commit 7a6e81cb45
4 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
2129
2132
+5 -1
View File
@@ -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);
+2
View File
@@ -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
*/
+1 -1
View File
@@ -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();