Comments, play first song if current is nil and user presses play

This commit is contained in:
DrabWeb
2017-04-09 07:04:41 -03:00
parent 7f2feab9e7
commit 67f1167172
2 changed files with 14 additions and 6 deletions

View File

@ -108,10 +108,10 @@ namespace osu.Game.Overlays
OnSelect = (set, index) =>
{
if (set.ID == (current?.BeatmapSetInfo?.ID ?? -1))
current?.Track?.Seek(0);
current?.Track?.Seek(0);
play(set.Beatmaps[0], true);
playListIndex = index;
play(set.Beatmaps[0], true);
},
},
playerContainer = new Container
@ -177,7 +177,13 @@ namespace osu.Game.Overlays
IconScale = new Vector2(1.4f),
Action = () =>
{
if (current?.Track == null) return;
if (current?.Track == null)
{
if (playList.Count > 0)
play(playList.First().Beatmaps[0], true);
else
return;
}
if (current.Track.IsRunning)
current.Track.Stop();
else
@ -286,9 +292,9 @@ namespace osu.Game.Overlays
if (current != null && playList.Count == 1) return;
int n = playListIndex + 1;
if (n >= playList.Count)
if (n >= playList.Count)
n = 0;
play(playList[n].Beatmaps[0], true);
playListIndex = n;
}