mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-09-06 14:07:47 +00:00
Compare commits
4 commits
2f7450eab4
...
def77c5b0f
Author | SHA1 | Date | |
---|---|---|---|
|
def77c5b0f | ||
|
73a1376f2e | ||
|
ccca786b87 | ||
|
760bdc9cfb |
|
@ -173,7 +173,9 @@ class Save
|
||||||
metronomeVolume: 1.0,
|
metronomeVolume: 1.0,
|
||||||
hitsoundVolumePlayer: 1.0,
|
hitsoundVolumePlayer: 1.0,
|
||||||
hitsoundVolumeOpponent: 1.0,
|
hitsoundVolumeOpponent: 1.0,
|
||||||
themeMusic: true
|
themeMusic: true,
|
||||||
|
themeMusicFadeInDelay: 30.0,
|
||||||
|
themeMusicFadeInDuration: 10.0,
|
||||||
},
|
},
|
||||||
|
|
||||||
optionsStageEditor:
|
optionsStageEditor:
|
||||||
|
@ -181,7 +183,7 @@ class Save
|
||||||
previousFiles: [],
|
previousFiles: [],
|
||||||
moveStep: "1px",
|
moveStep: "1px",
|
||||||
angleStep: 5,
|
angleStep: 5,
|
||||||
theme: StageEditorTheme.Light
|
theme: StageEditorTheme.Light,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -424,6 +426,40 @@ class Save
|
||||||
return data.optionsChartEditor.themeMusic;
|
return data.optionsChartEditor.themeMusic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public var chartEditorThemeMusicFadeInDelay(get, set):Float;
|
||||||
|
|
||||||
|
function get_chartEditorThemeMusicFadeInDelay():Float
|
||||||
|
{
|
||||||
|
if (data.optionsChartEditor.themeMusicFadeInDelay == null) data.optionsChartEditor.themeMusicFadeInDelay = 30.0;
|
||||||
|
|
||||||
|
return data.optionsChartEditor.themeMusicFadeInDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_chartEditorThemeMusicFadeInDelay(value:Float):Float
|
||||||
|
{
|
||||||
|
// Set and apply.
|
||||||
|
data.optionsChartEditor.themeMusicFadeInDelay = value;
|
||||||
|
flush();
|
||||||
|
return data.optionsChartEditor.themeMusicFadeInDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public var chartEditorThemeMusicFadeInDuration(get, set):Float;
|
||||||
|
|
||||||
|
function get_chartEditorThemeMusicFadeInDuration():Float
|
||||||
|
{
|
||||||
|
if (data.optionsChartEditor.themeMusicFadeInDuration == null) data.optionsChartEditor.themeMusicFadeInDuration = 10.0;
|
||||||
|
|
||||||
|
return data.optionsChartEditor.themeMusicFadeInDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_chartEditorThemeMusicFadeInDuration(value:Float):Float
|
||||||
|
{
|
||||||
|
// Set and apply.
|
||||||
|
data.optionsChartEditor.themeMusicFadeInDuration = value;
|
||||||
|
flush();
|
||||||
|
return data.optionsChartEditor.themeMusicFadeInDuration;
|
||||||
|
}
|
||||||
|
|
||||||
public var chartEditorPlaybackSpeed(get, set):Float;
|
public var chartEditorPlaybackSpeed(get, set):Float;
|
||||||
|
|
||||||
function get_chartEditorPlaybackSpeed():Float
|
function get_chartEditorPlaybackSpeed():Float
|
||||||
|
@ -1646,6 +1682,18 @@ typedef SaveDataChartEditorOptions =
|
||||||
*/
|
*/
|
||||||
var ?themeMusic:Bool;
|
var ?themeMusic:Bool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Theme music fade in delay in the Chart Editor.
|
||||||
|
* @default `30.0`
|
||||||
|
*/
|
||||||
|
var ?themeMusicFadeInDelay:Float;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Theme music fade in duration in the Chart Editor.
|
||||||
|
* @default `10.0`
|
||||||
|
*/
|
||||||
|
var ?themeMusicFadeInDuration:Float;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instrumental volume in the Chart Editor.
|
* Instrumental volume in the Chart Editor.
|
||||||
* @default `1.0`
|
* @default `1.0`
|
||||||
|
|
|
@ -246,16 +246,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
*/
|
*/
|
||||||
public static final BASE_QUANT_INDEX:Int = 3;
|
public static final BASE_QUANT_INDEX:Int = 3;
|
||||||
|
|
||||||
/**
|
|
||||||
* The duration before the welcome music starts to fade back in after the user stops playing music in the chart editor.
|
|
||||||
*/
|
|
||||||
public static final WELCOME_MUSIC_FADE_IN_DELAY:Float = 30.0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The duration of the welcome music fade in.
|
|
||||||
*/
|
|
||||||
public static final WELCOME_MUSIC_FADE_IN_DURATION:Float = 10.0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map of the keys for every live input style.
|
* A map of the keys for every live input style.
|
||||||
*/
|
*/
|
||||||
|
@ -699,6 +689,21 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Play the welcome music or not.
|
||||||
|
*/
|
||||||
|
var isWelcomeMusic:Bool = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The duration before the welcome music starts to fade back in after the user stops playing music in the chart editor.
|
||||||
|
*/
|
||||||
|
var welcomeMusicFadeInDelay:Float = 30;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The duration of the welcome music fade in.
|
||||||
|
*/
|
||||||
|
var welcomeMusicFadeInDuration:Float = 10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to play a metronome sound while the playhead is moving, and what volume.
|
* Whether to play a metronome sound while the playhead is moving, and what volume.
|
||||||
*/
|
*/
|
||||||
|
@ -1832,6 +1837,16 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
*/
|
*/
|
||||||
var menubarItemThemeMusic:MenuCheckBox;
|
var menubarItemThemeMusic:MenuCheckBox;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The `Audio -> Theme Music Fade in Delay` number stepper.
|
||||||
|
*/
|
||||||
|
var numberStepperItemThemeMusicFadeInDelay:NumberStepper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The `Audio -> Theme Music Fade in Duration` number stepper.
|
||||||
|
*/
|
||||||
|
var numberStepperItemThemeMusicFadeInDuration:NumberStepper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The `Audio -> Player Hitsound Volume` label.
|
* The `Audio -> Player Hitsound Volume` label.
|
||||||
*/
|
*/
|
||||||
|
@ -2287,7 +2302,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
metronomeVolume = save.chartEditorMetronomeVolume;
|
metronomeVolume = save.chartEditorMetronomeVolume;
|
||||||
hitsoundVolumePlayer = save.chartEditorHitsoundVolumePlayer;
|
hitsoundVolumePlayer = save.chartEditorHitsoundVolumePlayer;
|
||||||
hitsoundVolumePlayer = save.chartEditorHitsoundVolumeOpponent;
|
hitsoundVolumePlayer = save.chartEditorHitsoundVolumeOpponent;
|
||||||
this.welcomeMusic.active = save.chartEditorThemeMusic;
|
isWelcomeMusic = save.chartEditorThemeMusic;
|
||||||
|
|
||||||
|
welcomeMusicFadeInDelay = save.chartEditorThemeMusicFadeInDelay;
|
||||||
|
welcomeMusicFadeInDuration = save.chartEditorThemeMusicFadeInDuration;
|
||||||
|
|
||||||
// audioInstTrack.volume = save.chartEditorInstVolume;
|
// audioInstTrack.volume = save.chartEditorInstVolume;
|
||||||
// audioInstTrack.pitch = save.chartEditorPlaybackSpeed;
|
// audioInstTrack.pitch = save.chartEditorPlaybackSpeed;
|
||||||
|
@ -2316,7 +2334,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
save.chartEditorMetronomeVolume = metronomeVolume;
|
save.chartEditorMetronomeVolume = metronomeVolume;
|
||||||
save.chartEditorHitsoundVolumePlayer = hitsoundVolumePlayer;
|
save.chartEditorHitsoundVolumePlayer = hitsoundVolumePlayer;
|
||||||
save.chartEditorHitsoundVolumeOpponent = hitsoundVolumeOpponent;
|
save.chartEditorHitsoundVolumeOpponent = hitsoundVolumeOpponent;
|
||||||
save.chartEditorThemeMusic = this.welcomeMusic.active;
|
save.chartEditorThemeMusic = isWelcomeMusic;
|
||||||
|
|
||||||
|
save.chartEditorThemeMusicFadeInDelay = welcomeMusicFadeInDelay;
|
||||||
|
save.chartEditorThemeMusicFadeInDuration = welcomeMusicFadeInDuration;
|
||||||
|
|
||||||
// save.chartEditorInstVolume = audioInstTrack.volume;
|
// save.chartEditorInstVolume = audioInstTrack.volume;
|
||||||
// save.chartEditorVoicesVolume = audioVocalTrackGroup.volume;
|
// save.chartEditorVoicesVolume = audioVocalTrackGroup.volume;
|
||||||
|
@ -2377,15 +2398,14 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
|
|
||||||
function fadeInWelcomeMusic(?extraWait:Float = 0, ?fadeInTime:Float = 5):Void
|
function fadeInWelcomeMusic(?extraWait:Float = 0, ?fadeInTime:Float = 5):Void
|
||||||
{
|
{
|
||||||
if (!this.welcomeMusic.active)
|
if (!isWelcomeMusic)
|
||||||
{
|
{
|
||||||
stopWelcomeMusic();
|
stopWelcomeMusic();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bgMusicTimer = new FlxTimer().start(extraWait, (_) -> {
|
bgMusicTimer = new FlxTimer().start(extraWait, (_) -> {
|
||||||
this.welcomeMusic.volume = 0;
|
if (isWelcomeMusic)
|
||||||
if (this.welcomeMusic.active)
|
|
||||||
{
|
{
|
||||||
this.welcomeMusic.play();
|
this.welcomeMusic.play();
|
||||||
this.welcomeMusic.fadeIn(fadeInTime, 0, 1.0);
|
this.welcomeMusic.fadeIn(fadeInTime, 0, 1.0);
|
||||||
|
@ -3029,10 +3049,22 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
menubarItemVolumeMetronome.value = Std.int(metronomeVolume * 100);
|
menubarItemVolumeMetronome.value = Std.int(metronomeVolume * 100);
|
||||||
|
|
||||||
menubarItemThemeMusic.onChange = event -> {
|
menubarItemThemeMusic.onChange = event -> {
|
||||||
this.welcomeMusic.active = event.value;
|
isWelcomeMusic = event.value;
|
||||||
fadeInWelcomeMusic(WELCOME_MUSIC_FADE_IN_DELAY, WELCOME_MUSIC_FADE_IN_DURATION);
|
// Don't restart the music when the menu is opened for the first time
|
||||||
|
if (!welcomeMusic.active || !isWelcomeMusic) fadeInWelcomeMusic(welcomeMusicFadeInDelay, welcomeMusicFadeInDuration);
|
||||||
};
|
};
|
||||||
menubarItemThemeMusic.selected = this.welcomeMusic.active;
|
menubarItemThemeMusic.selected = isWelcomeMusic;
|
||||||
|
|
||||||
|
numberStepperItemThemeMusicFadeInDelay.onChange = event -> {
|
||||||
|
welcomeMusicFadeInDelay = event.value;
|
||||||
|
};
|
||||||
|
numberStepperItemThemeMusicFadeInDelay.pos = welcomeMusicFadeInDelay;
|
||||||
|
|
||||||
|
numberStepperItemThemeMusicFadeInDuration.onChange = event -> {
|
||||||
|
welcomeMusicFadeInDuration = event.value;
|
||||||
|
};
|
||||||
|
numberStepperItemThemeMusicFadeInDuration.pos = welcomeMusicFadeInDuration;
|
||||||
|
|
||||||
|
|
||||||
menubarItemVolumeHitsoundPlayer.onChange = event -> {
|
menubarItemVolumeHitsoundPlayer.onChange = event -> {
|
||||||
var volume:Float = event.value.toFloat() / 100.0;
|
var volume:Float = event.value.toFloat() / 100.0;
|
||||||
|
@ -4031,7 +4063,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldEase = true;
|
shouldEase = true;
|
||||||
if (shouldPause) stopAudioPlayback();
|
if (shouldPause && audioInstTrack.isPlaying) stopAudioPlayback(); // Only do this once, not every frame
|
||||||
|
|
||||||
// Resync the conductor and audio tracks.
|
// Resync the conductor and audio tracks.
|
||||||
if (playheadAmount != 0) this.playheadPositionInPixels += playheadAmount;
|
if (playheadAmount != 0) this.playheadPositionInPixels += playheadAmount;
|
||||||
|
@ -5852,6 +5884,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
{
|
{
|
||||||
if (audioInstTrack != null)
|
if (audioInstTrack != null)
|
||||||
{
|
{
|
||||||
|
stopWelcomeMusic();
|
||||||
audioInstTrack.play(false, audioInstTrack.time);
|
audioInstTrack.play(false, audioInstTrack.time);
|
||||||
audioVocalTrackGroup.play(false, audioInstTrack.time);
|
audioVocalTrackGroup.play(false, audioInstTrack.time);
|
||||||
}
|
}
|
||||||
|
@ -6142,7 +6175,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
|
|
||||||
moveSongToScrollPosition();
|
moveSongToScrollPosition();
|
||||||
|
|
||||||
fadeInWelcomeMusic(WELCOME_MUSIC_FADE_IN_DELAY, WELCOME_MUSIC_FADE_IN_DURATION);
|
fadeInWelcomeMusic(welcomeMusicFadeInDelay, welcomeMusicFadeInDuration);
|
||||||
|
|
||||||
// Reapply the volume.
|
// Reapply the volume.
|
||||||
var instTargetVolume:Float = menubarItemVolumeInstrumental.value ?? 1.0;
|
var instTargetVolume:Float = menubarItemVolumeInstrumental.value ?? 1.0;
|
||||||
|
@ -6285,6 +6318,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
{
|
{
|
||||||
if (audioInstTrack != null) audioInstTrack.pause();
|
if (audioInstTrack != null) audioInstTrack.pause();
|
||||||
audioVocalTrackGroup.pause();
|
audioVocalTrackGroup.pause();
|
||||||
|
fadeInWelcomeMusic(welcomeMusicFadeInDelay, welcomeMusicFadeInDuration);
|
||||||
|
|
||||||
playbarPlay.text = '>';
|
playbarPlay.text = '>';
|
||||||
}
|
}
|
||||||
|
@ -6299,13 +6333,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
{
|
{
|
||||||
// Pause
|
// Pause
|
||||||
stopAudioPlayback();
|
stopAudioPlayback();
|
||||||
fadeInWelcomeMusic(WELCOME_MUSIC_FADE_IN_DELAY, WELCOME_MUSIC_FADE_IN_DURATION);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Play
|
// Play
|
||||||
startAudioPlayback();
|
startAudioPlayback();
|
||||||
stopWelcomeMusic();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue