1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-28 07:56:46 +00:00

Merge pull request #115 from FunkinCrew/feature/asset-redirect-2

Asset redirecting
This commit is contained in:
Cameron Taylor 2023-07-22 22:48:09 -04:00 committed by GitHub
commit cd2f0d840d
3 changed files with 26 additions and 12 deletions

View file

@ -181,6 +181,14 @@
<!-- pretends that the saved session Id was expired, forcing the reconnect prompt --> <!-- pretends that the saved session Id was expired, forcing the reconnect prompt -->
<!-- <haxedef name="NG_FORCE_EXPIRED_SESSION" if="debug" /> --> <!-- <haxedef name="NG_FORCE_EXPIRED_SESSION" if="debug" /> -->
</section> </section>
<section if="debug">
<!--
Use the parent assets folder rather than the exported one
No more will we accidentally undo our changes!
TODO: Add a thing to disable this on builds meant for itch.io.
-->
<haxedef name="REDIRECT_ASSETS_FOLDER" />
</section>
<!-- <prebuild haxe="trace('prebuilding');"/> --> <!-- <prebuild haxe="trace('prebuilding');"/> -->
<!-- <postbuild haxe="art/Postbuild.hx"/> --> <!-- <postbuild haxe="art/Postbuild.hx"/> -->
<!-- <config:ios allow-provisioning-updates="true" team-id="" /> --> <!-- <config:ios allow-provisioning-updates="true" team-id="" /> -->

View file

@ -95,8 +95,8 @@
"name": "lime", "name": "lime",
"type": "git", "type": "git",
"dir": null, "dir": null,
"ref": "5634ad7", "ref": "acb0334",
"url": "https://github.com/openfl/lime" "url": "https://github.com/EliteMasterEric/lime"
}, },
{ {
"name": "openfl", "name": "openfl",
@ -109,7 +109,7 @@
"name": "polymod", "name": "polymod",
"type": "git", "type": "git",
"dir": null, "dir": null,
"ref": "6594dd8", "ref": "631a363",
"url": "https://github.com/larsiusprime/polymod" "url": "https://github.com/larsiusprime/polymod"
}, },
{ {
@ -123,4 +123,4 @@
"version": null "version": null
} }
] ]
} }

View file

@ -10,12 +10,15 @@ import polymod.backends.PolymodAssets.PolymodAssetType;
import polymod.format.ParseRules.TextFileFormat; import polymod.format.ParseRules.TextFileFormat;
import funkin.play.event.SongEventData.SongEventParser; import funkin.play.event.SongEventData.SongEventParser;
import funkin.util.FileUtil; import funkin.util.FileUtil;
import funkin.play.cutscene.dialogue.ConversationDataParser;
import funkin.play.cutscene.dialogue.DialogueBoxDataParser;
import funkin.play.cutscene.dialogue.SpeakerDataParser;
class PolymodHandler class PolymodHandler
{ {
/** /**
* The API version that mods should comply with. * The API version that mods should comply with.
* Format this with Semantic Versioning; <MAJOR>.<MINOR>.<PATCH>. * Format this with Semantic Versioning; <MAJOR>.<MINOR>.<PATCH>.
* Bug fixes increment the patch version, new features increment the minor version. * Bug fixes increment the patch version, new features increment the minor version.
* Changes that break old mods increment the major version. * Changes that break old mods increment the major version.
*/ */
@ -24,7 +27,9 @@ class PolymodHandler
/** /**
* Where relative to the executable that mods are located. * Where relative to the executable that mods are located.
*/ */
static final MOD_FOLDER = "mods"; static final MOD_FOLDER:String = #if REDIRECT_ASSETS_FOLDER "../../../../example_mods" #else "mods" #end;
static final CORE_FOLDER:Null<String> = #if REDIRECT_ASSETS_FOLDER "../../../../assets" #else null #end;
public static function createModRoot() public static function createModRoot()
{ {
@ -197,9 +202,10 @@ class PolymodHandler
{ {
return { return {
assetLibraryPaths: [ assetLibraryPaths: [
"songs" => "songs", "shared" => "", "tutorial" => "tutorial", "scripts" => "scripts", "week1" => "week1", "week2" => "week2", "default" => "preload", "shared" => "", "songs" => "songs", "tutorial" => "tutorial", "week1" => "week1", "week2" => "week2", "week3" => "week3",
"week3" => "week3", "week4" => "week4", "week5" => "week5", "week6" => "week6", "week7" => "week7", "weekend1" => "weekend1", "week4" => "week4", "week5" => "week5", "week6" => "week6", "week7" => "week7", "weekend1" => "weekend1",
] ],
coreAssetRedirect: CORE_FOLDER,
} }
} }
@ -282,9 +288,9 @@ class PolymodHandler
funkin.data.level.LevelRegistry.instance.loadEntries(); funkin.data.level.LevelRegistry.instance.loadEntries();
SongEventParser.loadEventCache(); SongEventParser.loadEventCache();
// TODO: Uncomment this once conversation data is implemented. // TODO: Uncomment this once conversation data is implemented.
// ConversationDataParser.loadConversationCache(); ConversationDataParser.loadConversationCache();
// DialogueBoxDataParser.loadDialogueBoxCache(); DialogueBoxDataParser.loadDialogueBoxCache();
// SpeakerDataParser.loadSpeakerCache(); SpeakerDataParser.loadSpeakerCache();
SongDataParser.loadSongCache(); SongDataParser.loadSongCache();
StageDataParser.loadStageCache(); StageDataParser.loadStageCache();
CharacterDataParser.loadCharacterCache(); CharacterDataParser.loadCharacterCache();