From f129cb79973f820742fdc2075198c322ffda763c Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 3 Apr 2024 21:57:29 -0400 Subject: [PATCH] Fix a bug where if Weekend 1 wasn't cleared, you can't chart those songs --- source/funkin/play/song/Song.hx | 3 ++- .../debug/charting/handlers/ChartEditorImportExportHandler.hx | 2 +- source/funkin/ui/freeplay/FreeplayState.hx | 4 ++-- source/funkin/ui/story/Level.hx | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/funkin/play/song/Song.hx b/source/funkin/play/song/Song.hx index 0248e09ee..d219dc2f6 100644 --- a/source/funkin/play/song/Song.hx +++ b/source/funkin/play/song/Song.hx @@ -404,11 +404,12 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry, showHidden:Bool = false):Array + public function listDifficulties(?variationId:String, ?variationIds:Array, showLocked:Bool = false, showHidden:Bool = false):Array { if (variationIds == null) variationIds = []; if (variationId != null) variationIds.push(variationId); diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx index 557875596..0308cd871 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx @@ -73,7 +73,7 @@ class ChartEditorImportExportHandler state.loadInstFromAsset(Paths.inst(songId, '-$variation'), variation); } - for (difficultyId in song.listDifficulties(variation)) + for (difficultyId in song.listDifficulties(variation, true, true)) { var diff:Null = song.getDifficulty(difficultyId, variation); if (diff == null) continue; diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 66c829e11..7264124c4 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -195,7 +195,7 @@ class FreeplayState extends MusicBeatSubState var song:Song = SongRegistry.instance.fetchEntry(songId); // Only display songs which actually have available charts for the current character. - var availableDifficultiesForSong:Array = song.listDifficulties(displayedVariations); + var availableDifficultiesForSong:Array = song.listDifficulties(displayedVariations, false); if (availableDifficultiesForSong.length == 0) continue; songs.push(new FreeplaySongData(levelId, songId, song, displayedVariations)); @@ -1400,7 +1400,7 @@ class FreeplaySongData function updateValues(variations:Array):Void { - this.songDifficulties = song.listDifficulties(variations); + this.songDifficulties = song.listDifficulties(variations, false, false); if (!this.songDifficulties.contains(currentDifficulty)) currentDifficulty = Constants.DEFAULT_DIFFICULTY; var songDifficulty:SongDifficulty = song.getDifficulty(currentDifficulty, variations); diff --git a/source/funkin/ui/story/Level.hx b/source/funkin/ui/story/Level.hx index 626fb8e52..8f454aa1a 100644 --- a/source/funkin/ui/story/Level.hx +++ b/source/funkin/ui/story/Level.hx @@ -169,7 +169,7 @@ class Level implements IRegistryEntry if (firstSong != null) { // Don't display alternate characters in Story Mode. Only show `default` and `erect` variations. - for (difficulty in firstSong.listDifficulties([Constants.DEFAULT_VARIATION, 'erect'])) + for (difficulty in firstSong.listDifficulties([Constants.DEFAULT_VARIATION, 'erect'], false, false)) { difficulties.push(difficulty); }