mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 05:42:54 +08:00
Use the track's implemented looping algorithm to loop tracks in the song select screen
This commit is contained in:
parent
043d1ed20a
commit
48f4879157
@ -65,6 +65,8 @@ namespace osu.Game.Screens.Select
|
||||
protected override void OnResuming(Screen last)
|
||||
{
|
||||
player = null;
|
||||
Beatmap.Track.Looping = false;
|
||||
|
||||
base.OnResuming(last);
|
||||
}
|
||||
|
||||
@ -83,13 +85,19 @@ namespace osu.Game.Screens.Select
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnExiting(next);
|
||||
if (base.OnExiting(next))
|
||||
return true;
|
||||
|
||||
Beatmap.Track.Looping = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void OnSelected()
|
||||
{
|
||||
if (player != null) return;
|
||||
|
||||
Beatmap.Track.Looping = false;
|
||||
|
||||
LoadComponentAsync(player = new PlayerLoader(new Player
|
||||
{
|
||||
Beatmap = Beatmap, //eagerly set this so it's present before push.
|
||||
|
@ -348,6 +348,7 @@ namespace osu.Game.Screens.Select
|
||||
trackManager.SetExclusive(track);
|
||||
if (preview)
|
||||
track.Seek(Beatmap.Metadata.PreviewTime);
|
||||
track.Looping = true;
|
||||
track.Start();
|
||||
}
|
||||
}
|
||||
@ -365,13 +366,6 @@ namespace osu.Game.Screens.Select
|
||||
dialogOverlay?.Push(new BeatmapDeleteDialog(Beatmap));
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
ensurePlayingSelected();
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
if (args.Repeat) return false;
|
||||
|
Loading…
Reference in New Issue
Block a user