Skip to content

Commit ec63be9

Browse files
committed
Fix backward comp issues and freeplay
1 parent 88ea510 commit ec63be9

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

source/funkin/backend/week/WeekData.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ typedef WeekCharacter = {
2626

2727
typedef WeekSong = {
2828
var name:String;
29+
var ?hide:Bool;
2930
var ?variation:String;
30-
var hide:Bool;
3131
var ?displayName:String;
3232
}

source/funkin/game/PlayState.hx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ class PlayState extends MusicBeatState
6060
/**
6161
* The remaining songs in the Story Mode playlist.
6262
*/
63-
public static var storyPlaylist:Array<WeekSong> = [];
63+
public static var storyPlaylist:Array<String> = [];
64+
/**
65+
* The remaining variations to play with the Story Mode
66+
*/
67+
public static var storyVariations:Array<String> = [];
6468
/**
6569
* The selected difficulty name.
6670
*/
@@ -1733,6 +1737,7 @@ class PlayState extends MusicBeatState
17331737
campaignAccuracyTotal += accuracy;
17341738
campaignAccuracyCount++;
17351739
storyPlaylist.shift();
1740+
storyVariations.shift();
17361741

17371742
if (storyPlaylist.length <= 0) {
17381743
FlxG.switchState(new StoryMenuState());
@@ -1752,11 +1757,11 @@ class PlayState extends MusicBeatState
17521757
FlxG.save.flush();
17531758
}
17541759
else {
1755-
Logs.infos('Loading next song (${storyPlaylist[0].name.toLowerCase()}/$difficulty/${storyPlaylist[0].variation})', "PlayState");
1760+
Logs.infos('Loading next song (${storyPlaylist[0].toLowerCase()}/$difficulty/${storyVariations[0]})', "PlayState");
17561761

17571762
registerSmoothTransition();
17581763

1759-
__loadSong(storyPlaylist[0].name, difficulty, variation);
1764+
__loadSong(storyPlaylist[0], difficulty, storyVariations[0]);
17601765
FlxG.switchState(new PlayState());
17611766
}
17621767
}
@@ -2135,14 +2140,15 @@ class PlayState extends MusicBeatState
21352140
public static function loadWeek(weekData:WeekData, ?difficulty:String) {
21362141
if (difficulty == null) difficulty = Flags.DEFAULT_DIFFICULTY;
21372142
storyWeek = weekData;
2138-
storyPlaylist = weekData.songs.copy();
2143+
storyPlaylist = [for (e in weekData.songs) e.name];
2144+
storyVariations = [for (e in weekData.songs) e.variation];
21392145
isStoryMode = true;
21402146
campaignScore = 0;
21412147
campaignMisses = 0;
21422148
campaignAccuracyTotal = 0;
21432149
campaignAccuracyCount = 0;
21442150
chartingMode = coopMode = opponentMode = false;
2145-
__loadSong(storyPlaylist[0].name, difficulty, storyPlaylist[0].variation);
2151+
__loadSong(storyPlaylist[0], difficulty, storyVariations[0]);
21462152
}
21472153

21482154
/**

source/funkin/menus/FreeplayState.hx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ class FreeplayState extends MusicBeatState
182182

183183
coopText = new FlxText(diffText.x, diffText.y + diffText.height + 2, 0, "", 24);
184184
coopText.font = scoreText.font;
185+
coopText.visible = curSong.coopAllowed || curSong.opponentModeAllowed;
185186
add(coopText);
186187

187188
add(scoreText);
188189

189-
changeSelection(0, true);
190190
changeDiff(0, true);
191191
changeCoopMode(0, true);
192192

@@ -470,11 +470,6 @@ class FreeplayState extends MusicBeatState
470470

471471
changeDiff(0, true);
472472

473-
#if PRELOAD_ALL
474-
autoplayElapsed = 0;
475-
songInstPlaying = false;
476-
#end
477-
478473
coopText.visible = curSong.coopAllowed || curSong.opponentModeAllowed;
479474
}
480475

0 commit comments

Comments
 (0)