1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-08-18 22:14:37 +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 -->
<!-- <haxedef name="NG_FORCE_EXPIRED_SESSION" if="debug" /> -->
</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');"/> -->
<!-- <postbuild haxe="art/Postbuild.hx"/> -->
<!-- <config:ios allow-provisioning-updates="true" team-id="" /> -->

View file

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

View file

@ -10,12 +10,15 @@ import polymod.backends.PolymodAssets.PolymodAssetType;
import polymod.format.ParseRules.TextFileFormat;
import funkin.play.event.SongEventData.SongEventParser;
import funkin.util.FileUtil;
import funkin.play.cutscene.dialogue.ConversationDataParser;
import funkin.play.cutscene.dialogue.DialogueBoxDataParser;
import funkin.play.cutscene.dialogue.SpeakerDataParser;
class PolymodHandler
{
/**
* 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.
* Changes that break old mods increment the major version.
*/
@ -24,7 +27,9 @@ class PolymodHandler
/**
* 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()
{
@ -197,9 +202,10 @@ class PolymodHandler
{
return {
assetLibraryPaths: [
"songs" => "songs", "shared" => "", "tutorial" => "tutorial", "scripts" => "scripts", "week1" => "week1", "week2" => "week2",
"week3" => "week3", "week4" => "week4", "week5" => "week5", "week6" => "week6", "week7" => "week7", "weekend1" => "weekend1",
]
"default" => "preload", "shared" => "", "songs" => "songs", "tutorial" => "tutorial", "week1" => "week1", "week2" => "week2", "week3" => "week3",
"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();
SongEventParser.loadEventCache();
// TODO: Uncomment this once conversation data is implemented.
// ConversationDataParser.loadConversationCache();
// DialogueBoxDataParser.loadDialogueBoxCache();
// SpeakerDataParser.loadSpeakerCache();
ConversationDataParser.loadConversationCache();
DialogueBoxDataParser.loadDialogueBoxCache();
SpeakerDataParser.loadSpeakerCache();
SongDataParser.loadSongCache();
StageDataParser.loadStageCache();
CharacterDataParser.loadCharacterCache();