From c7f35bed5d139540616c9401dc55543eff6f4109 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 13 Nov 2023 18:56:07 -0500 Subject: [PATCH] Fix a bug where completing a song in Preview would mute music. --- source/funkin/ui/debug/charting/ChartEditorState.hx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 366e446e5..a22adc523 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -4464,6 +4464,16 @@ class ChartEditorState extends HaxeUIState function resetConductorAfterTest(_:FlxSubState = null):Void { moveSongToScrollPosition(); + + var instVolumeSlider:Null = findComponent('menubarItemVolumeInstrumental', Slider); + var vocalVolumeSlider:Null = findComponent('menubarItemVolumeVocals', Slider); + + // Reapply the volume. + var instTargetVolume:Float = instVolumeSlider?.value ?? 1.0; + var vocalTargetVolume:Float = vocalVolumeSlider?.value ?? 1.0; + + if (audioInstTrack != null) audioInstTrack.volume = instTargetVolume; + if (audioVocalTrackGroup != null) audioVocalTrackGroup.volume = vocalTargetVolume; } /**