diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index d18acc043d8..232b7db6115 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -3687,6 +3687,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState metronomeVolume = volume; menubarLabelVolumeMetronome.text = 'Metronome - ${Std.int(event.value)}%'; }; + menubarItemVolumeMetronome.onRightClick = _ -> + { + metronomeVolume = 1.0; + menubarItemVolumeMetronome.value = 0.0; + menubarLabelVolumeMetronome.text = 'Metronome - 0%'; + } menubarItemVolumeMetronome.value = Std.int(metronomeVolume * 100); previousAudioVolumes[0] = Std.int(metronomeVolume * 100); @@ -3707,6 +3713,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState hitsoundVolumePlayer = volume; menubarLabelVolumeHitsoundPlayer.text = 'Player - ${Std.int(event.value)}%'; }; + menubarItemVolumeHitsoundPlayer.onRightClick = _ -> + { + hitsoundVolumePlayer = 1.0; + menubarItemVolumeHitsoundPlayer.value = 0.0; + menubarLabelVolumeHitsoundPlayer.text = 'Player - 0%'; + } menubarItemVolumeHitsoundPlayer.value = Std.int(hitsoundVolumePlayer * 100); previousAudioVolumes[1] = Std.int(hitsoundVolumePlayer * 100); @@ -3716,6 +3728,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState hitsoundVolumeOpponent = volume; menubarLabelVolumeHitsoundOpponent.text = 'Enemy - ${Std.int(event.value)}%'; }; + menubarItemVolumeHitsoundOpponent.onRightClick = _ -> + { + hitsoundVolumeOpponent = 50.0; + menubarItemVolumeHitsoundOpponent.value = 0.0; + menubarLabelVolumeHitsoundOpponent.text = 'Enemy - 0%'; + } menubarItemVolumeHitsoundOpponent.value = Std.int(hitsoundVolumeOpponent * 100); previousAudioVolumes[2] = Std.int(hitsoundVolumeOpponent * 100); @@ -3725,6 +3743,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (audioInstTrack != null) audioInstTrack.volume = volume; menubarLabelVolumeInstrumental.text = 'Instrumental - ${Std.int(event.value)}%'; }; + menubarItemVolumeInstrumental.onRightClick = _ -> + { + if (audioInstTrack != null) audioInstTrack.volume = 1.0; + menubarItemVolumeInstrumental.value = 100.0; + menubarLabelVolumeInstrumental.text = 'Instrumental - 100%'; + } previousAudioVolumes[3] = menubarItemVolumeInstrumental.value; menubarItemVolumeVocalsPlayer.onChange = event -> @@ -3733,6 +3757,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState audioVocalTrackGroup.playerVolume = volume; menubarLabelVolumeVocalsPlayer.text = 'Player - ${Std.int(event.value)}%'; }; + menubarItemVolumeVocalsPlayer.onRightClick = _ -> + { + audioVocalTrackGroup.playerVolume = 1.0; + menubarItemVolumeVocalsPlayer.value = 100.0; + menubarLabelVolumeVocalsPlayer.text = 'Player - 100%'; + } previousAudioVolumes[4] = menubarItemVolumeVocalsPlayer.value; menubarItemVolumeVocalsOpponent.onChange = event -> @@ -3741,13 +3771,17 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState audioVocalTrackGroup.opponentVolume = volume; menubarLabelVolumeVocalsOpponent.text = 'Enemy - ${Std.int(event.value)}%'; }; + menubarItemVolumeVocalsOpponent.onRightClick = _ -> + { + audioVocalTrackGroup.opponentVolume = 1.0; + menubarItemVolumeVocalsOpponent.value = 100.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; audioVocalTrackGroup.pitch = pitch; @@ -3755,6 +3789,15 @@ 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'; } + menubarItemPlaybackSpeed.onRightClick = _ -> + { + #if FLX_PITCH + if (audioInstTrack != null) audioInstTrack.pitch = 1; + audioVocalTrackGroup.pitch = 1; + #end + menubarItemPlaybackSpeed.value = 50.0; + 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); @@ -7111,7 +7154,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% } @@ -7661,7 +7703,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) @@ -7960,7 +8001,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) { @@ -8013,7 +8053,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 6abe3be9cab..d68dab2d22c 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx @@ -1530,6 +1530,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'; @@ -1595,6 +1600,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'; diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorFreeplayToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorFreeplayToolbox.hx index 23ae003d440..0ba51e90fa8 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorFreeplayToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorFreeplayToolbox.hx @@ -138,6 +138,11 @@ class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox { setTrackVolume(freeplayPreviewVolume); }; + freeplayMusicVolume.onRightClick = (_) -> + { + freeplayMusicVolume.value = 50; + setTrackVolume(freeplayPreviewVolume); + }; freeplayMusicMute.onClick = (_) -> { toggleMuteTrack(); diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx index f275779eb14..eed4d3639b2 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx @@ -333,6 +333,13 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox labelScrollSpeed.text = 'Scroll Speed: ${chartEditorState.currentSongChartScrollSpeed}x'; }; + inputScrollSpeed.onRightClick = _ -> + { + chartEditorState.currentSongChartScrollSpeed = 1.0; + inputScrollSpeed.value = 1; + labelScrollSpeed.text = 'Scroll Speed: 1x'; + } + inputDifficultyRating.onChange = function(event:UIEvent) { chartEditorState.currentSongChartDifficultyRating = event.target.value; diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorOffsetsToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorOffsetsToolbox.hx index 61e30db8132..5f8975abd39 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorOffsetsToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorOffsetsToolbox.hx @@ -113,6 +113,11 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox var targetVolume = offsetPlayerVolume.value * 2 / 100; setTrackVolume(PLAYER, targetVolume); }; + offsetPlayerVolume.onRightClick = (_) -> + { + offsetPlayerVolume.value = 50; + setTrackVolume(INSTRUMENTAL, offsetPlayerVolume.value * 2 / 100); + }; offsetPlayerMute.onClick = (_) -> { toggleMuteTrack(PLAYER); @@ -126,6 +131,11 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox var targetVolume = offsetOpponentVolume.value * 2 / 100; setTrackVolume(OPPONENT, targetVolume); }; + offsetOpponentVolume.onRightClick = (_) -> + { + offsetOpponentVolume.value = 50; + setTrackVolume(INSTRUMENTAL, offsetOpponentVolume.value * 2 / 100); + }; offsetOpponentMute.onClick = (_) -> { toggleMuteTrack(OPPONENT); @@ -139,6 +149,11 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox var targetVolume = offsetInstrumentalVolume.value * 2 / 100; setTrackVolume(INSTRUMENTAL, targetVolume); }; + offsetInstrumentalVolume.onRightClick = (_) -> + { + offsetInstrumentalVolume.value = 50; + setTrackVolume(INSTRUMENTAL, offsetInstrumentalVolume.value * 2 / 100); + }; offsetInstrumentalMute.onClick = (_) -> { toggleMuteTrack(INSTRUMENTAL);