Editor: Removed side sliders. Split vocal volume into two sliders. Removed vocal volume from the savefile.

This commit is contained in:
Jenny Crowe 2024-01-22 23:51:13 -07:00
parent 583eb81de5
commit dfe4ff614c
2 changed files with 31 additions and 115 deletions

View file

@ -108,10 +108,7 @@ abstract Save(RawSaveData)
metronomeVolume: 1.0, metronomeVolume: 1.0,
hitsoundsEnabledPlayer: true, hitsoundsEnabledPlayer: true,
hitsoundsEnabledOpponent: true, hitsoundsEnabledOpponent: true,
themeMusic: true, themeMusic: true
instVolume: 1.0,
voicesVolume: 1.0,
playbackSpeed: 1.0,
}, },
}; };
} }
@ -365,40 +362,6 @@ abstract Save(RawSaveData)
return this.optionsChartEditor.themeMusic; return this.optionsChartEditor.themeMusic;
} }
public var chartEditorInstVolume(get, set):Float;
function get_chartEditorInstVolume():Float
{
if (this.optionsChartEditor.instVolume == null) this.optionsChartEditor.instVolume = 1.0;
return this.optionsChartEditor.instVolume;
}
function set_chartEditorInstVolume(value:Float):Float
{
// Set and apply.
this.optionsChartEditor.instVolume = value;
flush();
return this.optionsChartEditor.instVolume;
}
public var chartEditorVoicesVolume(get, set):Float;
function get_chartEditorVoicesVolume():Float
{
if (this.optionsChartEditor.voicesVolume == null) this.optionsChartEditor.voicesVolume = 1.0;
return this.optionsChartEditor.voicesVolume;
}
function set_chartEditorVoicesVolume(value:Float):Float
{
// Set and apply.
this.optionsChartEditor.voicesVolume = value;
flush();
return this.optionsChartEditor.voicesVolume;
}
public var chartEditorPlaybackSpeed(get, set):Float; public var chartEditorPlaybackSpeed(get, set):Float;
function get_chartEditorPlaybackSpeed():Float function get_chartEditorPlaybackSpeed():Float

View file

@ -106,7 +106,6 @@ import haxe.ui.components.Label;
import haxe.ui.components.Button; import haxe.ui.components.Button;
import haxe.ui.components.NumberStepper; import haxe.ui.components.NumberStepper;
import haxe.ui.components.Slider; import haxe.ui.components.Slider;
import haxe.ui.components.VerticalSlider;
import haxe.ui.components.TextField; import haxe.ui.components.TextField;
import haxe.ui.containers.dialogs.CollapsibleDialog; import haxe.ui.containers.dialogs.CollapsibleDialog;
import haxe.ui.containers.Frame; import haxe.ui.containers.Frame;
@ -723,34 +722,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
return hitsoundsEnabledPlayer || hitsoundsEnabledOpponent; return hitsoundsEnabledPlayer || hitsoundsEnabledOpponent;
} }
/**
* Sound multiplier for vocals and hitsounds on the player's side.
*/
var soundMultiplierPlayer(default, set):Float = 1.0;
function set_soundMultiplierPlayer(value:Float):Float
{
soundMultiplierPlayer = value;
var vocalTargetVolume:Float = (menubarItemVolumeVocals.value ?? 100.0) / 100.0;
if (audioVocalTrackGroup != null) audioVocalTrackGroup.playerVolume = vocalTargetVolume * soundMultiplierPlayer;
return soundMultiplierPlayer;
}
/**
* Sound multiplier for vocals and hitsounds on the opponent's side.
*/
var soundMultiplierOpponent(default, set):Float = 1.0;
function set_soundMultiplierOpponent(value:Float):Float
{
soundMultiplierOpponent = value;
var vocalTargetVolume:Float = (menubarItemVolumeVocals.value ?? 100.0) / 100.0;
if (audioVocalTrackGroup != null) audioVocalTrackGroup.opponentVolume = vocalTargetVolume * soundMultiplierOpponent;
return soundMultiplierOpponent;
}
// Auto-save // Auto-save
/** /**
@ -1703,14 +1674,24 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
var menubarItemVolumeInstrumental:Slider; var menubarItemVolumeInstrumental:Slider;
/** /**
* The `Audio -> Vocal Volume` label. * The `Audio -> Player Volume` label.
*/ */
var menubarLabelVolumeVocals:Label; var menubarLabelVolumeVocalsPlayer:Label;
/** /**
* The `Audio -> Vocal Volume` slider. * The `Audio -> Enemy Volume` label.
*/ */
var menubarItemVolumeVocals:Slider; var menubarLabelVolumeVocalsOpponent:Label;
/**
* The `Audio -> Player Volume` slider.
*/
var menubarItemVolumeVocalsPlayer:Slider;
/**
* The `Audio -> Enemy Volume` slider.
*/
var menubarItemVolumeVocalsOpponent:Slider;
/** /**
* The `Audio -> Playback Speed` label. * The `Audio -> Playback Speed` label.
@ -2601,37 +2582,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
performCommand(new SetItemSelectionCommand([], currentSongChartEventData)); performCommand(new SetItemSelectionCommand([], currentSongChartEventData));
} }
} }
function setupSideSlider(x, y):VerticalSlider
{
var slider = new VerticalSlider();
slider.allowFocus = false;
slider.x = x;
slider.y = y;
slider.width = NOTE_SELECT_BUTTON_HEIGHT;
slider.height = GRID_SIZE * 4;
slider.pos = slider.max;
slider.tooltip = "Slide to set the volume of sounds on this side.";
slider.zIndex = 110;
slider.styleNames = "sideSlider";
add(slider);
return slider;
}
var sliderY = GRID_INITIAL_Y_POS + 34;
sliderVolumeOpponent = setupSideSlider(GRID_X_POS - 64, sliderY);
sliderVolumePlayer = setupSideSlider(buttonSelectEvent.x + buttonSelectEvent.width, sliderY);
sliderVolumePlayer.onChange = event -> {
var volume:Float = event.value.toFloat() / 100.0;
soundMultiplierPlayer = volume;
}
sliderVolumeOpponent.onChange = event -> {
var volume:Float = event.value.toFloat() / 100.0;
soundMultiplierOpponent = volume;
}
} }
/** /**
@ -2870,15 +2820,17 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
menubarLabelVolumeInstrumental.text = 'Instrumental - ${Std.int(event.value)}%'; menubarLabelVolumeInstrumental.text = 'Instrumental - ${Std.int(event.value)}%';
}; };
menubarItemVolumeVocals.onChange = event -> { menubarItemVolumeVocalsPlayer.onChange = event -> {
var volume:Float = event.value.toFloat() / 100.0; var volume:Float = event.value.toFloat() / 100.0;
if (audioVocalTrackGroup != null) if (audioVocalTrackGroup != null) audioVocalTrackGroup.playerVolume = volume;
{ menubarLabelVolumeVocalsPlayer.text = 'Player - ${Std.int(event.value)}%';
audioVocalTrackGroup.playerVolume = volume * soundMultiplierPlayer; };
audioVocalTrackGroup.opponentVolume = volume * soundMultiplierOpponent;
} menubarItemVolumeVocalsOpponent.onChange = event -> {
menubarLabelVolumeVocals.text = 'Voices - ${Std.int(event.value)}%'; var volume:Float = event.value.toFloat() / 100.0;
} if (audioVocalTrackGroup != null) audioVocalTrackGroup.opponentVolume = volume;
menubarLabelVolumeVocalsOpponent.text = 'Enemy - ${Std.int(event.value)}%';
};
menubarItemPlaybackSpeed.onChange = event -> { menubarItemPlaybackSpeed.onChange = event -> {
var pitch:Float = (event.value * 2.0) / 100.0; var pitch:Float = (event.value * 2.0) / 100.0;
@ -5734,7 +5686,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
// Reapply the volume. // Reapply the volume.
var instTargetVolume:Float = menubarItemVolumeInstrumental.value ?? 1.0; var instTargetVolume:Float = menubarItemVolumeInstrumental.value ?? 1.0;
var vocalTargetVolume:Float = menubarItemVolumeVocals.value ?? 1.0; var vocalPlayerTargetVolume:Float = menubarItemVolumeVocalsPlayer.value ?? 1.0;
var vocalOpponentTargetVolume:Float = menubarItemVolumeVocalsOpponent.value ?? 1.0;
if (audioInstTrack != null) if (audioInstTrack != null)
{ {
@ -5743,8 +5696,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
} }
if (audioVocalTrackGroup != null) if (audioVocalTrackGroup != null)
{ {
audioVocalTrackGroup.playerVolume = vocalTargetVolume * soundMultiplierPlayer; audioVocalTrackGroup.playerVolume = vocalPlayerTargetVolume;
audioVocalTrackGroup.opponentVolume = vocalTargetVolume * soundMultiplierOpponent; audioVocalTrackGroup.opponentVolume = vocalOpponentTargetVolume;
} }
} }
@ -5861,9 +5814,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
switch (noteData.getStrumlineIndex()) switch (noteData.getStrumlineIndex())
{ {
case 0: // Player case 0: // Player
if (hitsoundsEnabledPlayer) this.playSound(Paths.sound('chartingSounds/hitNotePlayer'), hitsoundVolume * soundMultiplierPlayer); if (hitsoundsEnabledPlayer) this.playSound(Paths.sound('chartingSounds/hitNotePlayer'), hitsoundVolume);
case 1: // Opponent case 1: // Opponent
if (hitsoundsEnabledOpponent) this.playSound(Paths.sound('chartingSounds/hitNoteOpponent'), hitsoundVolume * soundMultiplierOpponent); if (hitsoundsEnabledOpponent) this.playSound(Paths.sound('chartingSounds/hitNoteOpponent'), hitsoundVolume);
} }
} }
} }