Use the track's implemented looping algorithm to loop tracks in the song select screen

This commit is contained in:
MrTheMake
2017-05-21 15:57:41 +02:00
parent 043d1ed20a
commit 48f4879157
2 changed files with 10 additions and 8 deletions

View File

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