mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 12:42:54 +08:00
Allow preparing preview point without looping
This commit is contained in:
parent
f30d68cd4e
commit
37799e3b31
@ -134,6 +134,6 @@ namespace osu.Game.Beatmaps
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reads the correct track restart point from beatmap metadata and sets looping to enabled.
|
/// Reads the correct track restart point from beatmap metadata and sets looping to enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void PrepareTrackForPreviewLooping();
|
void PrepareTrackForPreview(bool looping);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,9 +110,9 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public Track LoadTrack() => track = GetBeatmapTrack() ?? GetVirtualTrack(1000);
|
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;
|
Track.RestartPoint = Metadata.PreviewTime;
|
||||||
|
|
||||||
if (Track.RestartPoint == -1)
|
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.
|
// 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)
|
if (!track.IsRunning)
|
||||||
{
|
{
|
||||||
Beatmap.Value.PrepareTrackForPreviewLooping();
|
Beatmap.Value.PrepareTrackForPreview(false);
|
||||||
track.Restart();
|
track.Restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
|||||||
|
|
||||||
if (track != null)
|
if (track != null)
|
||||||
{
|
{
|
||||||
Beatmap.Value.PrepareTrackForPreviewLooping();
|
Beatmap.Value.PrepareTrackForPreview(true);
|
||||||
music?.EnsurePlayingSomething();
|
music?.EnsurePlayingSomething();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -683,7 +683,7 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ensureTrackLooping(IWorkingBeatmap beatmap, TrackChangeDirection changeDirection)
|
private void ensureTrackLooping(IWorkingBeatmap beatmap, TrackChangeDirection changeDirection)
|
||||||
=> beatmap.PrepareTrackForPreviewLooping();
|
=> beatmap.PrepareTrackForPreview(true);
|
||||||
|
|
||||||
public override bool OnBackButton()
|
public override bool OnBackButton()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user