No Chudding allowed

This commit is contained in:
Lasercar
2025-09-15 01:56:03 +08:00
committed by Hundrec
parent 11eb4060d0
commit 6783f04139
2 changed files with 6 additions and 8 deletions
@@ -6044,6 +6044,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
stopWelcomeMusic();
stopAudioPlayback();
// Force pauses audio preview from OffsetsToolbox, if it exists.
cast(this.getToolbox(CHART_EDITOR_TOOLBOX_OFFSETS_LAYOUT), ChartEditorOffsetsToolbox)?.pauseAudioPreview();
var startTimestamp:Float = 0;
if (playtestStartTime) startTimestamp = scrollPositionInMs + playheadPositionInMs;
@@ -6228,6 +6231,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
{
// Don't allow the audio to be played while we're dragging any of the playheads
if (playbarHeadDragging || gridPlayheadScrollAreaPressed || notePreviewPlayHeadDragging) return;
cast(this.getToolbox(CHART_EDITOR_TOOLBOX_OFFSETS_LAYOUT), ChartEditorOffsetsToolbox)?.pauseAudioPreview();
audioInstTrack.play(false, audioInstTrack.time);
audioVocalTrackGroup.play(false, audioInstTrack.time);
}
@@ -6796,14 +6800,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
return note != null && curStackedNotes.contains(note);
}
public override function openSubState(subState:FlxSubState):Void
{
// Force stops audio preview from OffsetsToolbox, if it exists.
cast(this.getToolbox(CHART_EDITOR_TOOLBOX_OFFSETS_LAYOUT), ChartEditorOffsetsToolbox)?.stopAudioPreview();
super.openSubState(subState);
}
override function destroy():Void
{
super.destroy();
@@ -103,6 +103,7 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox
function onClose(event:UIEvent)
{
stopAudioPreview(); // Pause it instead, maybe?
chartEditorState.menubarItemToggleToolboxOffsets.selected = false;
}
@@ -458,6 +459,7 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox
public function playAudioPreview():Void
{
chartEditorState.stopAudioPlayback();
audioPreviewTracks.play(false, audioPreviewTracks.time);
}