mirror of https://github.com/ppy/osu
Allow preparing preview point without looping
This commit is contained in:
parent
f30d68cd4e
commit
37799e3b31
|
@ -134,6 +134,6 @@ public interface IWorkingBeatmap
|
|||
/// <summary>
|
||||
/// Reads the correct track restart point from beatmap metadata and sets looping to enabled.
|
||||
/// </summary>
|
||||
void PrepareTrackForPreviewLooping();
|
||||
void PrepareTrackForPreview(bool looping);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,9 +110,9 @@ public void CancelAsyncLoad()
|
|||
|
||||
public Track LoadTrack() => track = GetBeatmapTrack() ?? GetVirtualTrack(1000);
|
||||
|
||||
public void PrepareTrackForPreviewLooping()
|
||||
public void PrepareTrackForPreview(bool looping)
|
||||
{
|
||||
Track.Looping = true;
|
||||
Track.Looping = looping;
|
||||
Track.RestartPoint = Metadata.PreviewTime;
|
||||
|
||||
if (Track.RestartPoint == -1)
|
||||
|
|
|
@ -192,7 +192,7 @@ public override void OnEntering(ScreenTransitionEvent e)
|
|||
// presume the track is the current beatmap's track. not sure how correct this assumption is but it has worked until now.
|
||||
if (!track.IsRunning)
|
||||
{
|
||||
Beatmap.Value.PrepareTrackForPreviewLooping();
|
||||
Beatmap.Value.PrepareTrackForPreview(false);
|
||||
track.Restart();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -485,7 +485,7 @@ private void applyLoopingToTrack(ValueChangedEvent<WorkingBeatmap> _ = null)
|
|||
|
||||
if (track != null)
|
||||
{
|
||||
Beatmap.Value.PrepareTrackForPreviewLooping();
|
||||
Beatmap.Value.PrepareTrackForPreview(true);
|
||||
music?.EnsurePlayingSomething();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -683,7 +683,7 @@ private void endLooping()
|
|||
}
|
||||
|
||||
private void ensureTrackLooping(IWorkingBeatmap beatmap, TrackChangeDirection changeDirection)
|
||||
=> beatmap.PrepareTrackForPreviewLooping();
|
||||
=> beatmap.PrepareTrackForPreview(true);
|
||||
|
||||
public override bool OnBackButton()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue