mirror of
https://github.com/ppy/osu.git
synced 2026-05-22 02:41:23 +08:00
Allow preparing preview point without looping
This commit is contained in:
@@ -134,6 +134,6 @@ namespace osu.Game.Beatmaps
|
||||
/// <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 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
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 @@ namespace osu.Game.Screens.Menu
|
||||
// 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 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
||||
|
||||
if (track != null)
|
||||
{
|
||||
Beatmap.Value.PrepareTrackForPreviewLooping();
|
||||
Beatmap.Value.PrepareTrackForPreview(true);
|
||||
music?.EnsurePlayingSomething();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
|
||||
private void ensureTrackLooping(IWorkingBeatmap beatmap, TrackChangeDirection changeDirection)
|
||||
=> beatmap.PrepareTrackForPreviewLooping();
|
||||
=> beatmap.PrepareTrackForPreview(true);
|
||||
|
||||
public override bool OnBackButton()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user