From 374c042ad020fd8b60adf6c9814f905f0f56d919 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 23 Apr 2024 18:32:07 -0400 Subject: [PATCH 1/3] Fix a critical issue causing instrumental variations to not load on web. --- source/funkin/play/song/Song.hx | 13 +++++++++---- source/funkin/ui/transition/LoadingState.hx | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/source/funkin/play/song/Song.hx b/source/funkin/play/song/Song.hx index d219dc2f6..e71ae3213 100644 --- a/source/funkin/play/song/Song.hx +++ b/source/funkin/play/song/Song.hx @@ -609,28 +609,33 @@ class SongDifficulty return cast events; } - public function cacheInst(instrumental = ''):Void + public function getInstPath(instrumental = ''):String { if (characters != null) { if (instrumental != '' && characters.altInstrumentals.contains(instrumental)) { var instId = '-$instrumental'; - FlxG.sound.cache(Paths.inst(this.song.id, instId)); + return Paths.inst(this.song.id, instId); } else { // Fallback to default instrumental. var instId = (characters.instrumental ?? '') != '' ? '-${characters.instrumental}' : ''; - FlxG.sound.cache(Paths.inst(this.song.id, instId)); + return Paths.inst(this.song.id, instId); } } else { - FlxG.sound.cache(Paths.inst(this.song.id)); + return Paths.inst(this.song.id); } } + public function cacheInst(instrumental = ''):Void + { + FlxG.sound.cache(getInstPath(instrumental)); + } + public function playInst(volume:Float = 1.0, looped:Bool = false):Void { var suffix:String = (variation != null && variation != '' && variation != 'default') ? '-$variation' : ''; diff --git a/source/funkin/ui/transition/LoadingState.hx b/source/funkin/ui/transition/LoadingState.hx index ec6621ee3..3b53e1b4a 100644 --- a/source/funkin/ui/transition/LoadingState.hx +++ b/source/funkin/ui/transition/LoadingState.hx @@ -77,7 +77,7 @@ class LoadingState extends MusicBeatSubState var difficulty:String = playParams.targetDifficulty ?? Constants.DEFAULT_DIFFICULTY; var variation:String = playParams.targetVariation ?? Constants.DEFAULT_VARIATION; var targetChart:SongDifficulty = playParams.targetSong?.getDifficulty(difficulty, variation); - var instPath:String = Paths.inst(targetChart.song.id); + var instPath:String = targetChart.getInstPath(playParams.targetInstrumental); var voicesPaths:Array = targetChart.buildVoiceList(); checkLoadSong(instPath); From 3734c6ecd3cff5c6ff3fd5322b2453066bca0201 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 24 Apr 2024 01:48:39 -0400 Subject: [PATCH 2/3] Make credits no longer pause and no longer autoformat. Add some names. --- .prettierignore | 2 ++ assets | 2 +- source/funkin/ui/credits/CreditsState.hx | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.prettierignore b/.prettierignore index 2e132c06f..ccf886f1a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,3 +9,5 @@ assets/weekend1/images # Don't ignore data files # TODO: These don't work. !assets/preload/data/ + +assets/exclude/data/credits.json diff --git a/assets b/assets index 3f3977d7b..f9c94dfa6 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 3f3977d7bf82856106e9c74fa11433c67b160323 +Subproject commit f9c94dfa655b05d87fb37cbb71fe01aa798ec5b2 diff --git a/source/funkin/ui/credits/CreditsState.hx b/source/funkin/ui/credits/CreditsState.hx index d43e25114..6a15f1263 100644 --- a/source/funkin/ui/credits/CreditsState.hx +++ b/source/funkin/ui/credits/CreditsState.hx @@ -185,7 +185,7 @@ class CreditsState extends MusicBeatState } else if (controls.PAUSE) { - scrollPaused = !scrollPaused; + // scrollPaused = !scrollPaused; } } @@ -196,7 +196,7 @@ class CreditsState extends MusicBeatState function exit():Void { - FlxG.switchState(new funkin.ui.mainmenu.MainMenuState()); + FlxG.switchState(funkin.ui.mainmenu.MainMenuState.new); } public override function destroy():Void From ff5aacf1c10c447eb43995334dd5c3daa5da367b Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 24 Apr 2024 11:44:32 -0400 Subject: [PATCH 3/3] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index f9c94dfa6..0e0781121 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit f9c94dfa655b05d87fb37cbb71fe01aa798ec5b2 +Subproject commit 0e07811217c579df376719c76d47c1e08b3070e2