mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add back loop-on-completion
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
@ -323,7 +324,10 @@ namespace osu.Game.Overlays
|
||||
CurrentTrack = null;
|
||||
|
||||
if (current != null)
|
||||
{
|
||||
trackContainer.Add(CurrentTrack = new DrawableTrack(current.GetRealTrack()));
|
||||
CurrentTrack.Completed += () => onTrackCompleted(current);
|
||||
}
|
||||
|
||||
TrackChanged?.Invoke(current, direction);
|
||||
|
||||
@ -332,6 +336,18 @@ namespace osu.Game.Overlays
|
||||
queuedDirection = null;
|
||||
}
|
||||
|
||||
private void onTrackCompleted(WorkingBeatmap workingBeatmap)
|
||||
{
|
||||
// the source of track completion is the audio thread, so the beatmap may have changed before firing.
|
||||
if (current != workingBeatmap)
|
||||
return;
|
||||
|
||||
Debug.Assert(CurrentTrack != null);
|
||||
|
||||
if (!CurrentTrack.Looping && !beatmap.Disabled)
|
||||
NextTrack();
|
||||
}
|
||||
|
||||
private bool allowRateAdjustments;
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user