Consume new method in existing usages (and remove some unnecessary set/unset code)

This commit is contained in:
Dean Herbert
2021-02-18 15:01:11 +09:00
parent dfedea9ea2
commit 421cdb6650
3 changed files with 10 additions and 15 deletions

View File

@ -179,14 +179,15 @@ namespace osu.Game.Screens.Menu
base.OnEntering(last);
buttons.FadeInFromZero(500);
var metadata = Beatmap.Value.Metadata;
if (last is IntroScreen && musicController.TrackLoaded)
{
if (!musicController.CurrentTrack.IsRunning)
var track = musicController.CurrentTrack;
// presume the track is the current beatmap's track. not sure how correct this assumption is but it has worked until now.
if (!track.IsRunning)
{
musicController.CurrentTrack.Seek(metadata.PreviewTime != -1 ? metadata.PreviewTime : 0.4f * musicController.CurrentTrack.Length);
musicController.CurrentTrack.Start();
Beatmap.Value.PrepareTrackForPreviewLooping();
track.Restart();
}
}