From bb09cc19e7a88b1da2ac95b60448524689f9a08a Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 4 Sep 2023 22:18:45 -0400 Subject: [PATCH] HTML5: Several fixes to asset loading (#136) * Update Polymod to fix async script loading. * Got into the Main Menu but playstate doesn't work * Got into PlayState but GF script breaks! --------- Co-authored-by: Cameron Taylor --- hmm.json | 26 +++++++++++++------------ source/funkin/InitState.hx | 5 ++++- source/funkin/modding/PolymodHandler.hx | 1 + 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/hmm.json b/hmm.json index 922e6f599..e2670420a 100644 --- a/hmm.json +++ b/hmm.json @@ -23,8 +23,10 @@ }, { "name": "flixel-ui", - "type": "haxelib", - "version": "2.5.0" + "type": "git", + "dir": null, + "ref": "719b4f10d94186ed55f6fef1b6618d32abec8c15", + "url": "https://github.com/HaxeFlixel/flixel-ui" }, { "name": "flxanimate", @@ -57,6 +59,13 @@ "ref": "be0b18553189a55fd42821026618a18615b070e3", "url": "https://github.com/haxeui/haxeui-flixel" }, + { + "name": "hmm", + "type": "git", + "dir": null, + "ref": "d514d7786cabf18b90e60fcee38399fd44c2ddfb", + "url": "https://github.com/andywhite37/hmm" + }, { "name": "hscript", "type": "haxelib", @@ -93,7 +102,7 @@ "name": "lime", "type": "git", "dir": null, - "ref": "558798adc5bf0e82d70fef589a59ce88892e0b5b", + "ref": "f195121ebec688b417e38ab115185c8d93c349d3", "url": "https://github.com/EliteMasterEric/lime" }, { @@ -128,14 +137,14 @@ "name": "openfl", "type": "git", "dir": null, - "ref": "1591a6c5f1f72e65d711f7e17e8055df41424d94", + "ref": "ef43deb2c68d8a4bcd73abfbd77324fc8220d0c1", "url": "https://github.com/EliteMasterEric/openfl" }, { "name": "polymod", "type": "git", "dir": null, - "ref": "4bcd614103469af79a320898b823d1df8a55c3de", + "ref": "e8a07b81e3bc535238ad8649e38f5d43c46f1b65", "url": "https://github.com/larsiusprime/polymod" }, { @@ -147,13 +156,6 @@ "name": "tink_json", "type": "haxelib", "version": "0.11.0" - }, - { - "name": "hmm", - "type": "git", - "dir": null, - "ref": "d514d7786cabf18b90e60fcee38399fd44c2ddfb", - "url": "https://github.com/andywhite37/hmm" } ] } diff --git a/source/funkin/InitState.hx b/source/funkin/InitState.hx index 6c465be9c..82a357ae9 100644 --- a/source/funkin/InitState.hx +++ b/source/funkin/InitState.hx @@ -1,5 +1,6 @@ package funkin; +import flixel.FlxState; import flixel.addons.transition.FlxTransitionableState; import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond; import flixel.addons.transition.TransitionData; @@ -33,8 +34,10 @@ import Discord.DiscordClient; * The initialization state has several functions: * - Calls code to set up the game, including loading saves and parsing game data. * - Chooses whether to start via debug or via launching normally. + * + * It should not contain any sprites or rendering. */ -class InitState extends FlxTransitionableState +class InitState extends FlxState { /** * Perform a bunch of game setup, then immediately transition to the title screen. diff --git a/source/funkin/modding/PolymodHandler.hx b/source/funkin/modding/PolymodHandler.hx index 3f5752acc..47afb0a30 100644 --- a/source/funkin/modding/PolymodHandler.hx +++ b/source/funkin/modding/PolymodHandler.hx @@ -114,6 +114,7 @@ class PolymodHandler // Parse hxc files and register the scripted classes in them. useScriptedClasses: true, + loadScriptsAsync: #if html5 true #else false #end, }); if (loadedModList == null)