Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 45 additions & 6 deletions source/funkin/ui/debug/charting/ChartEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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 ->
Expand All @@ -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 ->
Expand All @@ -3741,20 +3771,33 @@ 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;
#end
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);
Expand Down Expand Up @@ -7101,7 +7144,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%
}

Expand Down Expand Up @@ -7651,7 +7693,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)
Expand Down Expand Up @@ -7953,7 +7994,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)
{
Expand Down Expand Up @@ -8006,7 +8046,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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox
{
setTrackVolume(freeplayPreviewVolume);
};
freeplayMusicVolume.onRightClick = (_) ->
{
freeplayMusicVolume.value = 50;
setTrackVolume(freeplayPreviewVolume);
};
freeplayMusicMute.onClick = (_) ->
{
toggleMuteTrack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
Loading