From 9fa603363c9ecf50d4576f18f3d2692372e12ca5 Mon Sep 17 00:00:00 2001 From: AppleHair <95587502+AppleHair@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:42:27 +0300 Subject: [PATCH 1/2] [BUGFIX] Made freeplay use the metadata to get the instrumental suffix Song previews in freeplay will now use the instrumental suffix from the current difficulty's corresponding song variation metadata instead of using the variation id as an instrumental suffix and checking only the "erect" variation. --- source/funkin/ui/freeplay/FreeplayState.hx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 5e07fb396..5a7fa54d2 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1890,14 +1890,17 @@ class FreeplayState extends MusicBeatSubState } else { - var potentiallyErect:String = (currentDifficulty == "erect") || (currentDifficulty == "nightmare") ? "-erect" : ""; + var previewSong:Null = SongRegistry.instance.fetchEntry(daSongCapsule.songData.songId); + var instSuffix:String = previewSong?.getDifficulty(currentDifficulty, + previewSong?.variations ?? Constants.DEFAULT_VARIATION_LIST)?.characters?.instrumental ?? ''; + instSuffix = (instSuffix != '') ? '-$instSuffix' : ''; FunkinSound.playMusic(daSongCapsule.songData.songId, { startingVolume: 0.0, overrideExisting: true, restartTrack: false, pathsFunction: INST, - suffix: potentiallyErect, + suffix: instSuffix, partialParams: { loadPartial: true, From c4d6e18885bc02fb723e1f73a87ad2ca67a6ede3 Mon Sep 17 00:00:00 2001 From: AppleHair <95587502+AppleHair@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:23:45 +0300 Subject: [PATCH 2/2] now using getVariationsByCharId instead --- source/funkin/ui/freeplay/FreeplayState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 5a7fa54d2..1caad3ee5 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1892,7 +1892,7 @@ class FreeplayState extends MusicBeatSubState { var previewSong:Null = SongRegistry.instance.fetchEntry(daSongCapsule.songData.songId); var instSuffix:String = previewSong?.getDifficulty(currentDifficulty, - previewSong?.variations ?? Constants.DEFAULT_VARIATION_LIST)?.characters?.instrumental ?? ''; + previewSong?.getVariationsByCharId(currentCharacter) ?? Constants.DEFAULT_VARIATION_LIST)?.characters?.instrumental ?? ''; instSuffix = (instSuffix != '') ? '-$instSuffix' : ''; FunkinSound.playMusic(daSongCapsule.songData.songId, {