Allow preparing preview point without looping

This commit is contained in:
Dean Herbert 2022-08-17 13:20:24 +09:00
parent f30d68cd4e
commit 37799e3b31
5 changed files with 6 additions and 6 deletions

View File

@ -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);
}
}

View File

@ -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)

View File

@ -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();
}
}

View File

@ -485,7 +485,7 @@ private void applyLoopingToTrack(ValueChangedEvent<WorkingBeatmap> _ = null)
if (track != null)
{
Beatmap.Value.PrepareTrackForPreviewLooping();
Beatmap.Value.PrepareTrackForPreview(true);
music?.EnsurePlayingSomething();
}
}

View File

@ -683,7 +683,7 @@ private void endLooping()
}
private void ensureTrackLooping(IWorkingBeatmap beatmap, TrackChangeDirection changeDirection)
=> beatmap.PrepareTrackForPreviewLooping();
=> beatmap.PrepareTrackForPreview(true);
public override bool OnBackButton()
{