diff --git a/source/funkin/InitState.hx b/source/funkin/InitState.hx index 31cd3daff..479da36b0 100644 --- a/source/funkin/InitState.hx +++ b/source/funkin/InitState.hx @@ -400,7 +400,7 @@ class InitState extends FlxState */ function startSong(songId:String, difficultyId:String = 'normal'):Void { - var songData:Null = funkin.data.song.SongRegistry.instance.fetchEntry(songId); + var songData:Null = funkin.data.song.SongRegistry.instance.fetchEntry(songId, {variation: Constants.DEFAULT_VARIATION}); if (songData == null) { @@ -472,7 +472,7 @@ class InitState extends FlxState var targetSong:Null = null; - if (targetSongId != null) targetSong = SongRegistry.instance.fetchEntry(targetSongId); + if (targetSongId != null) targetSong = SongRegistry.instance.fetchEntry(targetSongId, {variation: Constants.DEFAULT_VARIATION}); if (targetSongId == null) { diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx index 165d4ca5b..e223334dc 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx @@ -139,7 +139,7 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog for (targetSongId in songList) { - var songData:Null = SongRegistry.instance.fetchEntry(targetSongId); + var songData:Null = SongRegistry.instance.fetchEntry(targetSongId, {variation: Constants.DEFAULT_VARIATION}); if (songData == null) continue; var songName:Null = songData.getDifficulty('normal')?.songName; diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx index a00a431e8..a6e199ecc 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx @@ -31,7 +31,7 @@ class ChartEditorImportExportHandler { trace('===============START'); - var song:Null = SongRegistry.instance.fetchEntry(songId); + var song:Null = SongRegistry.instance.fetchEntry(songId, {variation: targetSongVariation}); if (song == null) return; @@ -126,7 +126,8 @@ class ChartEditorImportExportHandler * @param newSongMetadata The song metadata to load. * @param newSongChartData The song chart data to load. */ - public static function loadSong(state:ChartEditorState, newSongMetadata:Map, newSongChartData:Map, ?newSongManifestData:ChartManifestData):Void + public static function loadSong(state:ChartEditorState, newSongMetadata:Map, newSongChartData:Map, + ?newSongManifestData:ChartManifestData):Void { state.songMetadata = newSongMetadata; state.songChartData = newSongChartData; diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 9fc0fb356..e69e958af 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -372,7 +372,7 @@ class FreeplayState extends MusicBeatSubState for (songId in level.getSongs()) { - var song:Null = SongRegistry.instance.fetchEntry(songId); + var song:Null = SongRegistry.instance.fetchEntry(songId, {variation: currentVariation}); if (song == null) { @@ -2291,7 +2291,7 @@ class FreeplayState extends MusicBeatSubState if (daSong != null) { - var targetSong:Null = SongRegistry.instance.fetchEntry(daSong.data.id); + var targetSong:Null = SongRegistry.instance.fetchEntry(daSong.data.id, {variation: currentVariation}); if (targetSong == null) { FlxG.log.warn('WARN: could not find song with id (${daSong.data.id})'); @@ -2455,8 +2455,10 @@ class FreeplayState extends MusicBeatSubState { controls.active = false; letterSort.inputEnabled = false; + var targetDifficultyId:String = currentDifficulty; + var targetVariation:Null = currentVariation; var targetSongId:String = cap?.freeplayData?.data.id ?? 'unknown'; - var targetSongNullable:Null = SongRegistry.instance.fetchEntry(targetSongId); + var targetSongNullable:Null = SongRegistry.instance.fetchEntry(targetSongId, {variation: targetVariation}); if (targetSongNullable == null) { FlxG.log.warn('WARN: could not find song with id (${targetSongId})'); @@ -2465,8 +2467,6 @@ class FreeplayState extends MusicBeatSubState return; } var targetSong:Song = targetSongNullable; - var targetDifficultyId:String = currentDifficulty; - var targetVariation:Null = currentVariation; trace('target song: ${targetSongId} (${targetVariation})'); var targetLevelId:Null = cap?.freeplayData?.levelId; PlayStatePlaylist.campaignId = targetLevelId ?? null; diff --git a/source/funkin/ui/story/Level.hx b/source/funkin/ui/story/Level.hx index c2121beb7..ee2f3c165 100644 --- a/source/funkin/ui/story/Level.hx +++ b/source/funkin/ui/story/Level.hx @@ -76,7 +76,7 @@ class Level implements IRegistryEntry static function getSongDisplayName(songId:String, difficulty:String):String { - var song:Null = SongRegistry.instance.fetchEntry(songId); + var song:Null = SongRegistry.instance.fetchEntry(songId, {variation: Constants.DEFAULT_VARIATION}); if (song == null) return 'Unknown'; return song.songName; @@ -154,7 +154,7 @@ class Level implements IRegistryEntry var songList:Array = getSongs(); var firstSongId:String = songList[0]; - var firstSong:Song = SongRegistry.instance.fetchEntry(firstSongId); + var firstSong:Song = SongRegistry.instance.fetchEntry(firstSongId, {variation: Constants.DEFAULT_VARIATION}); if (firstSong != null) { @@ -172,7 +172,7 @@ class Level implements IRegistryEntry for (songIndex in 1...songList.length) { var songId:String = songList[songIndex]; - var song:Song = SongRegistry.instance.fetchEntry(songId); + var song:Song = SongRegistry.instance.fetchEntry(songId, {variation: Constants.DEFAULT_VARIATION}); if (song == null) continue; diff --git a/source/funkin/ui/story/StoryMenuState.hx b/source/funkin/ui/story/StoryMenuState.hx index 1a5e72cd6..b8d2df685 100644 --- a/source/funkin/ui/story/StoryMenuState.hx +++ b/source/funkin/ui/story/StoryMenuState.hx @@ -362,7 +362,7 @@ class StoryMenuState extends MusicBeatState changeLevel(-levelList.length); changeDifficulty(0); } - + #if !html5 if (FlxG.mouse.wheel != 0) { @@ -602,7 +602,7 @@ class StoryMenuState extends MusicBeatState var targetSongId:String = PlayStatePlaylist.playlistSongIds.shift(); - var targetSong:Song = SongRegistry.instance.fetchEntry(targetSongId); + var targetSong:Song = SongRegistry.instance.fetchEntry(targetSongId, {variation: Constants.DEFAULT_VARIATION}); PlayStatePlaylist.campaignId = currentLevel.id; PlayStatePlaylist.campaignTitle = currentLevel.getTitle();