Skip to content

Commit

Permalink
testing loading specific mods
Browse files Browse the repository at this point in the history
haven't done too much haxe in a bit, let's see how this goes
  • Loading branch information
Joalor64GH authored Jan 16, 2025
1 parent a591c3c commit 9e09b3f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion gameConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"playSplashesScreen": true,
"loadgameInstant": "template",
"willLoadgameInstant": false
"willLoadgameInstant": false,
"modsToLoad": []
}
7 changes: 4 additions & 3 deletions source/InitialState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ typedef InitialData =
playSplashesScreen:Bool,
loadgameInstant:String,
willLoadgameInstant:Bool,
modsToLoad:Array<String>
}

class InitialState extends FlxState
Expand All @@ -23,11 +24,11 @@ class InitialState extends FlxState

override function create()
{
PolyHandler.reload();
updateCheck();

gameConfig = TJSON.parse(Assets.getText("gameConfig.json"));

PolyHandler.reload(gameConfig.modsToLoad);
updateCheck();

if (PolyHandler.trackedMods.length > 0)
{
if (gameConfig.willLoadgameInstant)
Expand Down
4 changes: 2 additions & 2 deletions source/PolyHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class PolyHandler
'otf' => FONT
];

public static function reload():Void
public static function reload(?modsToLoad:Array<String> = null):Void
{
trace('Reloading Polymod...');
loadMods(getMods());
loadMods((modsToLoad.length > 0) ? modsToLoad : getMods());
}

public static function loadMods(folders:Array<String>)
Expand Down

0 comments on commit 9e09b3f

Please sign in to comment.