diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index cef06a9c3be..d88018463e3 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -3508,6 +3508,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState metronomeVolume = volume; menubarLabelVolumeMetronome.text = 'Metronome - ${Std.int(event.value)}%'; }; + menubarLabelVolumeMetronome.onRightClick = _ -> + { + metronomeVolume = 1.0; + menubarLabelVolumeMetronome.text = 'Metronome - 100%'; + } menubarItemVolumeMetronome.value = Std.int(metronomeVolume * 100); previousAudioVolumes[0] = Std.int(metronomeVolume * 100); @@ -3528,6 +3533,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState hitsoundVolumePlayer = volume; menubarLabelVolumeHitsoundPlayer.text = 'Player - ${Std.int(event.value)}%'; }; + menubarItemVolumeHitsoundPlayer.onRightClick = _ -> + { + hitsoundVolumeOpponent = 1.0; + menubarLabelVolumeHitsoundPlayer.text = 'Player - 100%'; + } menubarItemVolumeHitsoundPlayer.value = Std.int(hitsoundVolumePlayer * 100); previousAudioVolumes[1] = Std.int(hitsoundVolumePlayer * 100); @@ -3537,6 +3547,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState hitsoundVolumeOpponent = volume; menubarLabelVolumeHitsoundOpponent.text = 'Enemy - ${Std.int(event.value)}%'; }; + menubarItemVolumeHitsoundOpponent.onRightClick = _ -> + { + hitsoundVolumeOpponent = 1.0; + menubarLabelVolumeHitsoundOpponent.text = 'Enemy - 100%'; + } menubarItemVolumeHitsoundOpponent.value = Std.int(hitsoundVolumeOpponent * 100); previousAudioVolumes[2] = Std.int(hitsoundVolumeOpponent * 100); @@ -3546,6 +3561,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (audioInstTrack != null) audioInstTrack.volume = volume; menubarLabelVolumeInstrumental.text = 'Instrumental - ${Std.int(event.value)}%'; }; + menubarLabelVolumeInstrumental.onRightClick = _ -> + { + if (audioInstTrack != null) audioInstTrack.volume = 1.0; + menubarLabelVolumeInstrumental.text = 'Instrumental - 100%'; + } previousAudioVolumes[3] = menubarItemVolumeInstrumental.value; menubarItemVolumeVocalsPlayer.onChange = event -> @@ -3554,6 +3574,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState audioVocalTrackGroup.playerVolume = volume; menubarLabelVolumeVocalsPlayer.text = 'Player - ${Std.int(event.value)}%'; }; + menubarLabelVolumeVocalsPlayer.onRightClick = _ -> + { + audioVocalTrackGroup.playerVolume = 1.0; + menubarLabelVolumeVocalsPlayer.text = 'Player - 100%'; + } previousAudioVolumes[4] = menubarItemVolumeVocalsPlayer.value; menubarItemVolumeVocalsOpponent.onChange = event -> @@ -3562,12 +3587,16 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState audioVocalTrackGroup.opponentVolume = volume; menubarLabelVolumeVocalsOpponent.text = 'Enemy - ${Std.int(event.value)}%'; }; + menubarLabelVolumeVocalsOpponent.onRightClick = _ -> + { + audioVocalTrackGroup.opponentVolume = 1.0; + menubarLabelVolumeVocalsOpponent.text = 'Enemy - 100%'; + } previousAudioVolumes[5] = menubarItemVolumeVocalsOpponent.value; menubarItemPlaybackSpeed.onChange = event -> { var pitch:Float = (event.value.toFloat() * 2.0) / 100.0; - pitch = Math.round(pitch / 0.05) * 0.05; // Round to nearest 5% pitch = pitch.clamp(0.05, 2.0); // Clamp to 5% to 200% #if FLX_PITCH if (audioInstTrack != null) audioInstTrack.pitch = pitch; @@ -3576,6 +3605,14 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState var pitchDisplay:Float = Std.int(pitch * 100) / 100; // Round to 2 decimal places. menubarLabelPlaybackSpeed.text = 'Playback Speed - ${pitchDisplay}x'; } + menubarLabelPlaybackSpeed.onRightClick = _ -> + { + #if FLX_PITCH + if (audioInstTrack != null) audioInstTrack.pitch = 1; + audioVocalTrackGroup.pitch = 1; + #end + menubarLabelPlaybackSpeed.text = 'Playback Speed - 1x'; + } menubarItemToggleToolboxDifficulty.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT, event.value); menubarItemToggleToolboxMetadata.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT, event.value); @@ -6544,7 +6581,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (playtestAudioSettings) { playbackRate = ((menubarItemPlaybackSpeed.value / 100.0) ?? 0.5) * 2.0; - playbackRate = Math.round(playbackRate / 0.05) * 0.05; // Round to nearest 5% playbackRate = playbackRate.clamp(0.05, 2.0); // Clamp to 5% to 200% } @@ -7094,7 +7130,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState var vocalOpponentTargetVolume:Float = (menubarItemVolumeVocalsOpponent.value / 100.0) ?? 1.0; var playbackRate = ((menubarItemPlaybackSpeed.value / 100.0) ?? 0.5) * 2.0; - playbackRate = Math.round(playbackRate / 0.05) * 0.05; // Round to nearest 5% playbackRate = playbackRate.clamp(0.05, 2.0); // Clamp to 5% to 200% if (audioInstTrack != null) @@ -7396,7 +7431,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // Reapply the volume and playback rate. var instTargetVolume:Float = ((menubarItemVolumeInstrumental.value / 100) ?? 1.0); var playbackRate:Float = ((menubarItemPlaybackSpeed.value / 100.0) ?? 0.5) * 2.0; - playbackRate = Math.round(playbackRate / 0.05) * 0.05; // Round to nearest 5% playbackRate = playbackRate.clamp(0.05, 2.0); // Clamp to 5% to 200% if (audioInstTrack != null) { @@ -7450,7 +7484,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState var vocalPlayerTargetVolume:Float = (menubarItemVolumeVocalsPlayer.value / 100.0) ?? 1.0; var vocalOpponentTargetVolume:Float = (menubarItemVolumeVocalsOpponent.value / 100.0) ?? 1.0; var playbackRate:Float = ((menubarItemPlaybackSpeed.value / 100.0) ?? 0.5) * 2.0; - playbackRate = Math.round(playbackRate / 0.05) * 0.05; // Round to nearest 5% playbackRate = playbackRate.clamp(0.05, 2.0); // Clamp to 5% to 200% if (audioVocalTrackGroup != null) diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx index 6f7d6314d68..ecdc019b9d6 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx @@ -1473,6 +1473,11 @@ class ChartEditorDialogHandler { labelScrollSpeed.text = 'Scroll Speed: ${inputScrollSpeed.value}x'; }; + inputScrollSpeed.onRightClick = _ -> + { + inputScrollSpeed.value = 1; + labelScrollSpeed.text = 'Scroll Speed: 1x'; + } inputScrollSpeed.value = state.currentSongChartScrollSpeed; labelScrollSpeed.text = 'Scroll Speed: ${inputScrollSpeed.value}x'; @@ -1538,6 +1543,11 @@ class ChartEditorDialogHandler { labelScrollSpeed.text = 'Scroll Speed: ${inputScrollSpeed.value}x'; }; + inputScrollSpeed.onRightClick = _ -> + { + inputScrollSpeed.value = 1; + labelScrollSpeed.text = 'Scroll Speed: 1x'; + } inputScrollSpeed.value = state.currentSongChartScrollSpeed; labelScrollSpeed.text = 'Scroll Speed: ${inputScrollSpeed.value}x';