1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 00:45:43 +08:00

Only disallow changing the current track, not pausing or seeking it

This commit is contained in:
MrTheMake 2017-06-19 15:03:07 +02:00
parent 13df0e0b04
commit 9cc5dc6c2b

View File

@ -225,11 +225,8 @@ namespace osu.Game.Overlays
canChangeBeatmap = newScreen?.CanChangeBeatmap ?? true; canChangeBeatmap = newScreen?.CanChangeBeatmap ?? true;
prevButton.Enabled = canChangeBeatmap; prevButton.Enabled = canChangeBeatmap;
playButton.Enabled = canChangeBeatmap;
nextButton.Enabled = canChangeBeatmap; nextButton.Enabled = canChangeBeatmap;
playlistButton.Enabled = canChangeBeatmap; playlistButton.Enabled = canChangeBeatmap;
progressBar.IsEnabled = canChangeBeatmap;
} }
protected override void UpdateAfterChildren() protected override void UpdateAfterChildren()
@ -249,7 +246,7 @@ namespace osu.Game.Overlays
progressBar.UpdatePosition(track.Length == 0 ? 0 : (float)(track.CurrentTime / track.Length)); progressBar.UpdatePosition(track.Length == 0 ? 0 : (float)(track.CurrentTime / track.Length));
playButton.Icon = track.IsRunning ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o; playButton.Icon = track.IsRunning ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o;
if (track.HasCompleted && !track.Looping) next(); if (track.HasCompleted && !track.Looping && canChangeBeatmap) next();
} }
else else
playButton.Icon = FontAwesome.fa_play_circle_o; playButton.Icon = FontAwesome.fa_play_circle_o;
@ -273,16 +270,12 @@ namespace osu.Game.Overlays
private void prev() private void prev()
{ {
if(!canChangeBeatmap) return;
queuedDirection = TransformDirection.Prev; queuedDirection = TransformDirection.Prev;
playlist.PlayPrevious(); playlist.PlayPrevious();
} }
private void next() private void next()
{ {
if (!canChangeBeatmap) return;
queuedDirection = TransformDirection.Next; queuedDirection = TransformDirection.Next;
playlist.PlayNext(); playlist.PlayNext();
} }