Chart editor audio playback while dragging playheads fix
Two down, one to go
This commit is contained in:
@@ -2799,6 +2799,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||
playbarHeadLayout.playbarHead.styleString = 'padding-left: 0px; padding-right: 0px; border-left: 0px; border-right: 0px;';
|
||||
playbarHeadLayout.playbarHead.min = 0;
|
||||
|
||||
|
||||
playbarHeadLayout.playbarHead.onDragStart = function(_:DragEvent) {
|
||||
playbarHeadDragging = true;
|
||||
|
||||
@@ -4350,6 +4351,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||
else if (measureTicks != null && FlxG.mouse.overlaps(measureTicks) && !isCursorOverHaxeUI)
|
||||
{
|
||||
gridPlayheadScrollAreaPressed = true;
|
||||
// Stop audio playback while dragging on the grid playhead.
|
||||
if (audioInstTrack != null && audioInstTrack.isPlaying)
|
||||
{
|
||||
playbarHeadDraggingWasPlaying = true;
|
||||
stopAudioPlayback();
|
||||
}
|
||||
}
|
||||
else if (notePreview != null && FlxG.mouse.overlaps(notePreview) && !isCursorOverHaxeUI)
|
||||
{
|
||||
@@ -4372,6 +4379,14 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||
if (gridPlayheadScrollAreaPressed && FlxG.mouse.released)
|
||||
{
|
||||
gridPlayheadScrollAreaPressed = false;
|
||||
// If we were dragging the playhead while the song was playing, resume playing.
|
||||
if (playbarHeadDraggingWasPlaying)
|
||||
{
|
||||
playbarHeadDraggingWasPlaying = false;
|
||||
|
||||
// Disabled code to resume song playback on drag.
|
||||
startAudioPlayback();
|
||||
}
|
||||
}
|
||||
|
||||
if (notePreviewScrollAreaStartPos != null && FlxG.mouse.released)
|
||||
@@ -6191,6 +6206,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||
{
|
||||
if (audioInstTrack != null)
|
||||
{
|
||||
if (playbarHeadDragging || gridPlayheadScrollAreaPressed) return;
|
||||
audioInstTrack.play(false, audioInstTrack.time);
|
||||
audioVocalTrackGroup.play(false, audioInstTrack.time);
|
||||
}
|
||||
@@ -6655,6 +6671,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||
}
|
||||
else
|
||||
{
|
||||
if (playbarHeadDragging || gridPlayheadScrollAreaPressed) return;
|
||||
// Play
|
||||
startAudioPlayback();
|
||||
stopWelcomeMusic();
|
||||
|
||||
Reference in New Issue
Block a user