This commit is contained in:
Lasercar 2025-04-05 05:24:06 +10:00 committed by GitHub
commit 1a17668e18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 76 additions and 14 deletions
source/funkin
save
ui/debug/charting

View file

@ -169,6 +169,10 @@ class Save
metronomeVolume: 1.0,
hitsoundVolumePlayer: 1.0,
hitsoundVolumeOpponent: 1.0,
instVolume: 1.0,
playerVoiceVolume: 1.0,
opponentVoiceVolume: 1.0,
playbackSpeed: 0.5,
themeMusic: true
},
@ -403,6 +407,57 @@ class Save
return data.optionsChartEditor.hitsoundVolumeOpponent;
}
public var chartEditorInstVolume(get, set):Float;
function get_chartEditorInstVolume():Float
{
if (data.optionsChartEditor.instVolume == null) data.optionsChartEditor.instVolume = 1.0;
return data.optionsChartEditor.instVolume;
}
function set_chartEditorInstVolume(value:Float):Float
{
// Set and apply.
data.optionsChartEditor.instVolume = value;
flush();
return data.optionsChartEditor.instVolume;
}
public var chartEditorPlayerVoiceVolume(get, set):Float;
function get_chartEditorPlayerVoiceVolume():Float
{
if (data.optionsChartEditor.playerVoiceVolume == null) data.optionsChartEditor.playerVoiceVolume = 1.0;
return data.optionsChartEditor.playerVoiceVolume;
}
function set_chartEditorPlayerVoiceVolume(value:Float):Float
{
// Set and apply.
data.optionsChartEditor.playerVoiceVolume = value;
flush();
return data.optionsChartEditor.playerVoiceVolume;
}
public var chartEditorOpponentVoiceVolume(get, set):Float;
function get_chartEditorOpponentVoiceVolume():Float
{
if (data.optionsChartEditor.opponentVoiceVolume == null) data.optionsChartEditor.opponentVoiceVolume = 1.0;
return data.optionsChartEditor.opponentVoiceVolume;
}
function set_chartEditorOpponentVoiceVolume(value:Float):Float
{
// Set and apply.
data.optionsChartEditor.opponentVoiceVolume = value;
flush();
return data.optionsChartEditor.opponentVoiceVolume;
}
public var chartEditorThemeMusic(get, set):Bool;
function get_chartEditorThemeMusic():Bool
@ -424,7 +479,7 @@ class Save
function get_chartEditorPlaybackSpeed():Float
{
if (data.optionsChartEditor.playbackSpeed == null) data.optionsChartEditor.playbackSpeed = 1.0;
if (data.optionsChartEditor.playbackSpeed == null) data.optionsChartEditor.playbackSpeed = 0.5;
return data.optionsChartEditor.playbackSpeed;
}
@ -1642,10 +1697,16 @@ typedef SaveDataChartEditorOptions =
var ?instVolume:Float;
/**
* Voices volume in the Chart Editor.
* Player voice volume in the Chart Editor.
* @default `1.0`
*/
var ?voicesVolume:Float;
var ?playerVoiceVolume:Float;
/**
* Opponent voice volume in the Chart Editor.
* @default `1.0`
*/
var ?opponentVoiceVolume:Float;
/**
* Playback speed in the Chart Editor.

View file

@ -2291,13 +2291,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
currentTheme = save.chartEditorTheme;
metronomeVolume = save.chartEditorMetronomeVolume;
hitsoundVolumePlayer = save.chartEditorHitsoundVolumePlayer;
hitsoundVolumePlayer = save.chartEditorHitsoundVolumeOpponent;
hitsoundVolumeOpponent = save.chartEditorHitsoundVolumeOpponent;
this.welcomeMusic.active = save.chartEditorThemeMusic;
// audioInstTrack.volume = save.chartEditorInstVolume;
// audioInstTrack.pitch = save.chartEditorPlaybackSpeed;
// audioVocalTrackGroup.volume = save.chartEditorVoicesVolume;
// audioVocalTrackGroup.pitch = save.chartEditorPlaybackSpeed;
menubarItemVolumeInstrumental.value = Std.int(save.chartEditorInstVolume * 100);
menubarItemVolumeVocalsPlayer.value = Std.int(save.chartEditorPlayerVoiceVolume * 100);
menubarItemVolumeVocalsOpponent.value = Std.int(save.chartEditorOpponentVoiceVolume * 100);
menubarItemPlaybackSpeed.value = Std.int(save.chartEditorPlaybackSpeed * 100);
}
public function writePreferences(hasBackup:Bool):Void
@ -2323,9 +2323,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
save.chartEditorHitsoundVolumeOpponent = hitsoundVolumeOpponent;
save.chartEditorThemeMusic = this.welcomeMusic.active;
// save.chartEditorInstVolume = audioInstTrack.volume;
// save.chartEditorVoicesVolume = audioVocalTrackGroup.volume;
// save.chartEditorPlaybackSpeed = audioInstTrack.pitch;
save.chartEditorInstVolume = menubarItemVolumeInstrumental.value / 100.0;
save.chartEditorPlayerVoiceVolume = menubarItemVolumeVocalsPlayer.value / 100.0;
save.chartEditorOpponentVoiceVolume = menubarItemVolumeVocalsOpponent.value / 100.0;
save.chartEditorPlaybackSpeed = menubarItemPlaybackSpeed.value / 100.0;
}
public function populateOpenRecentMenu():Void
@ -6143,9 +6144,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
fadeInWelcomeMusic(WELCOME_MUSIC_FADE_IN_DELAY, WELCOME_MUSIC_FADE_IN_DURATION);
// Reapply the volume.
var instTargetVolume:Float = menubarItemVolumeInstrumental.value ?? 1.0;
var vocalPlayerTargetVolume:Float = menubarItemVolumeVocalsPlayer.value ?? 1.0;
var vocalOpponentTargetVolume:Float = menubarItemVolumeVocalsOpponent.value ?? 1.0;
var instTargetVolume:Float = menubarItemVolumeInstrumental.value / 100.0 ?? 1.0;
var vocalPlayerTargetVolume:Float = menubarItemVolumeVocalsPlayer.value / 100.0 ?? 1.0;
var vocalOpponentTargetVolume:Float = menubarItemVolumeVocalsOpponent.value / 100.0 ?? 1.0;
if (audioInstTrack != null)
{