Remove necessity for MusicController to be always visible

This commit is contained in:
Dean Herbert
2019-06-20 23:40:25 +09:00
parent 35ce032be1
commit f2200594c9
2 changed files with 29 additions and 22 deletions

View File

@ -70,9 +70,6 @@ namespace osu.Game.Overlays
{
Width = 400;
Margin = new MarginPadding(10);
// required to let MusicController handle beatmap cycling.
AlwaysPresent = true;
}
[BackgroundDependencyLoader]
@ -349,18 +346,11 @@ namespace osu.Game.Overlays
direction = last > next ? TransformDirection.Prev : TransformDirection.Next;
}
//current.Track.Completed -= currentTrackCompleted;
}
current = beatmap.NewValue;
if (current != null)
current.Track.Completed += currentTrackCompleted;
progressBar.CurrentTime = 0;
updateDisplay(current, direction);
updateDisplay(current = beatmap.NewValue, direction);
updateAudioAdjustments();
queuedDirection = null;
@ -378,12 +368,6 @@ namespace osu.Game.Overlays
mod.ApplyToClock(track);
}
private void currentTrackCompleted() => Schedule(() =>
{
if (!current.Track.Looping && !beatmap.Disabled && beatmapSets.Any())
next();
});
private ScheduledDelegate pendingBeatmapSwitch;
private void updateDisplay(WorkingBeatmap beatmap, TransformDirection direction)
@ -447,10 +431,6 @@ namespace osu.Game.Overlays
{
base.PopOut();
// This is here mostly as a performance fix.
// If the playlist is not hidden it will update children even when the music controller is hidden (due to AlwaysPresent).
playlist.Hide();
this.FadeOut(transition_length, Easing.OutQuint);
dragContainer.ScaleTo(0.9f, transition_length, Easing.OutQuint);
}
@ -548,5 +528,10 @@ namespace osu.Game.Overlays
return base.OnDragEnd(e);
}
}
/// <summary>
/// Play the next random or playlist track.
/// </summary>
public void NextTrack() => next();
}
}