Skip to content

Commit 4862b19

Browse files
committed
Fix volumes being reset to 100% after playtest
1 parent 3fee047 commit 4862b19

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

source/funkin/ui/debug/charting/ChartEditorState.hx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5673,7 +5673,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
56735673
var startTimestamp:Float = 0;
56745674
if (playtestStartTime) startTimestamp = scrollPositionInMs + playheadPositionInMs;
56755675

5676-
var playbackRate:Float = ((menubarItemPlaybackSpeed.value ?? 1.0) * 2.0) / 100.0;
5676+
var playbackRate:Float = ((menubarItemPlaybackSpeed.value / 100.0) ?? 0.5) * 2.0;
56775677
playbackRate = Math.floor(playbackRate / 0.05) * 0.05; // Round to nearest 5%
56785678
playbackRate = Math.max(0.05, Math.min(2.0, playbackRate)); // Clamp to 5% to 200%
56795679

@@ -6145,11 +6145,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
61456145
fadeInWelcomeMusic(WELCOME_MUSIC_FADE_IN_DELAY, WELCOME_MUSIC_FADE_IN_DURATION);
61466146

61476147
// Reapply the volume and playback rate.
6148-
var instTargetVolume:Float = menubarItemVolumeInstrumental.value ?? 1.0;
6149-
var vocalPlayerTargetVolume:Float = menubarItemVolumeVocalsPlayer.value ?? 1.0;
6150-
var vocalOpponentTargetVolume:Float = menubarItemVolumeVocalsOpponent.value ?? 1.0;
6148+
var instTargetVolume:Float = (menubarItemVolumeInstrumental.value / 100.0) ?? 1.0;
6149+
var vocalPlayerTargetVolume:Float = (menubarItemVolumeVocalsPlayer.value / 100.0) ?? 1.0;
6150+
var vocalOpponentTargetVolume:Float = (menubarItemVolumeVocalsOpponent.value / 100.0) ?? 1.0;
61516151

6152-
var playbackRate = ((menubarItemPlaybackSpeed.value ?? 1.0) * 2.0) / 100.0;
6152+
var playbackRate = ((menubarItemPlaybackSpeed.value / 100.0) ?? 0.5) * 2.0;
61536153
playbackRate = Math.floor(playbackRate / 0.05) * 0.05; // Round to nearest 5%
61546154
playbackRate = Math.max(0.05, Math.min(2.0, playbackRate)); // Clamp to 5% to 200%
61556155

@@ -6322,8 +6322,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
63226322
public function postLoadInstrumental():Void
63236323
{
63246324
// Reapply the volume and playback rate.
6325-
var instTargetVolume:Float = menubarItemVolumeInstrumental.value ?? 1.0;
6326-
var playbackRate = ((menubarItemPlaybackSpeed.value ?? 1.0) * 2.0) / 100.0;
6325+
var instTargetVolume:Float = ((menubarItemVolumeInstrumental.value / 100) ?? 1.0);
6326+
var playbackRate:Float = ((menubarItemPlaybackSpeed.value / 100.0) ?? 0.5) * 2.0;
63276327
playbackRate = Math.floor(playbackRate / 0.05) * 0.05; // Round to nearest 5%
63286328
playbackRate = Math.max(0.05, Math.min(2.0, playbackRate)); // Clamp to 5% to 200%
63296329
if (audioInstTrack != null)
@@ -6361,9 +6361,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
63616361
public function postLoadVocals():Void
63626362
{
63636363
// Reapply the volume and playback rate.
6364-
var vocalPlayerTargetVolume:Float = menubarItemVolumeVocalsPlayer.value ?? 1.0;
6365-
var vocalOpponentTargetVolume:Float = menubarItemVolumeVocalsOpponent.value ?? 1.0;
6366-
var playbackRate = ((menubarItemPlaybackSpeed.value ?? 1.0) * 2.0) / 100.0;
6364+
var vocalPlayerTargetVolume:Float = (menubarItemVolumeVocalsPlayer.value / 100.0) ?? 1.0;
6365+
var vocalOpponentTargetVolume:Float = (menubarItemVolumeVocalsOpponent.value / 100.0) ?? 1.0;
6366+
var playbackRate:Float = ((menubarItemPlaybackSpeed.value / 100.0) ?? 0.5) * 2.0;
63676367
playbackRate = Math.floor(playbackRate / 0.05) * 0.05; // Round to nearest 5%
63686368
playbackRate = Math.max(0.05, Math.min(2.0, playbackRate)); // Clamp to 5% to 200%
63696369

0 commit comments

Comments
 (0)