From ec63be9e77eced854e1ef4434c098a57517881a1 Mon Sep 17 00:00:00 2001 From: Ralty <78720179+Raltyro@users.noreply.github.com> Date: Sat, 9 Aug 2025 20:00:49 +0700 Subject: [PATCH] Fix backward comp issues and freeplay --- source/funkin/backend/week/WeekData.hx | 2 +- source/funkin/game/PlayState.hx | 16 +++++++++++----- source/funkin/menus/FreeplayState.hx | 7 +------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/source/funkin/backend/week/WeekData.hx b/source/funkin/backend/week/WeekData.hx index 1a75687a..4a1e87b1 100644 --- a/source/funkin/backend/week/WeekData.hx +++ b/source/funkin/backend/week/WeekData.hx @@ -26,7 +26,7 @@ typedef WeekCharacter = { typedef WeekSong = { var name:String; + var ?hide:Bool; var ?variation:String; - var hide:Bool; var ?displayName:String; } \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 69e6bc99..04be7981 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -60,7 +60,11 @@ class PlayState extends MusicBeatState /** * The remaining songs in the Story Mode playlist. */ - public static var storyPlaylist:Array = []; + public static var storyPlaylist:Array = []; + /** + * The remaining variations to play with the Story Mode + */ + public static var storyVariations:Array = []; /** * The selected difficulty name. */ @@ -1733,6 +1737,7 @@ class PlayState extends MusicBeatState campaignAccuracyTotal += accuracy; campaignAccuracyCount++; storyPlaylist.shift(); + storyVariations.shift(); if (storyPlaylist.length <= 0) { FlxG.switchState(new StoryMenuState()); @@ -1752,11 +1757,11 @@ class PlayState extends MusicBeatState FlxG.save.flush(); } else { - Logs.infos('Loading next song (${storyPlaylist[0].name.toLowerCase()}/$difficulty/${storyPlaylist[0].variation})', "PlayState"); + Logs.infos('Loading next song (${storyPlaylist[0].toLowerCase()}/$difficulty/${storyVariations[0]})', "PlayState"); registerSmoothTransition(); - __loadSong(storyPlaylist[0].name, difficulty, variation); + __loadSong(storyPlaylist[0], difficulty, storyVariations[0]); FlxG.switchState(new PlayState()); } } @@ -2135,14 +2140,15 @@ class PlayState extends MusicBeatState public static function loadWeek(weekData:WeekData, ?difficulty:String) { if (difficulty == null) difficulty = Flags.DEFAULT_DIFFICULTY; storyWeek = weekData; - storyPlaylist = weekData.songs.copy(); + storyPlaylist = [for (e in weekData.songs) e.name]; + storyVariations = [for (e in weekData.songs) e.variation]; isStoryMode = true; campaignScore = 0; campaignMisses = 0; campaignAccuracyTotal = 0; campaignAccuracyCount = 0; chartingMode = coopMode = opponentMode = false; - __loadSong(storyPlaylist[0].name, difficulty, storyPlaylist[0].variation); + __loadSong(storyPlaylist[0], difficulty, storyVariations[0]); } /** diff --git a/source/funkin/menus/FreeplayState.hx b/source/funkin/menus/FreeplayState.hx index e326c0bf..247a5465 100644 --- a/source/funkin/menus/FreeplayState.hx +++ b/source/funkin/menus/FreeplayState.hx @@ -182,11 +182,11 @@ class FreeplayState extends MusicBeatState coopText = new FlxText(diffText.x, diffText.y + diffText.height + 2, 0, "", 24); coopText.font = scoreText.font; + coopText.visible = curSong.coopAllowed || curSong.opponentModeAllowed; add(coopText); add(scoreText); - changeSelection(0, true); changeDiff(0, true); changeCoopMode(0, true); @@ -470,11 +470,6 @@ class FreeplayState extends MusicBeatState changeDiff(0, true); - #if PRELOAD_ALL - autoplayElapsed = 0; - songInstPlaying = false; - #end - coopText.visible = curSong.coopAllowed || curSong.opponentModeAllowed; }