Adds a check to disable music controller's seek

This commit is contained in:
Jacob Odgård Tørring 2018-05-10 10:15:47 +02:00
parent 3504f7393f
commit bb6478cdc3

View File

@ -206,7 +206,7 @@ namespace osu.Game.Overlays
Anchor = Anchor.BottomCentre,
Height = progress_height,
FillColour = colours.Yellow,
OnSeek = progress => current?.Track.Seek(progress)
OnSeek = progress => ConditionalSeek(progress)
}
},
},
@ -219,6 +219,13 @@ namespace osu.Game.Overlays
playlist.StateChanged += s => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint);
}
private bool? ConditionalSeek(double progress)
{
if (current.Track.Looping)
return current?.Track.Seek(progress);
return false;
}
protected override void LoadComplete()
{
beatmapBacking.ValueChanged += beatmapChanged;