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

@ -648,8 +648,9 @@ namespace osu.Game.Screens.Select
{
Debug.Assert(!isHandlingLooping);
music.CurrentTrack.Looping = isHandlingLooping = true;
isHandlingLooping = true;
ensureTrackLooping(Beatmap.Value, TrackChangeDirection.None);
music.TrackChanged += ensureTrackLooping;
}
@ -665,7 +666,7 @@ namespace osu.Game.Screens.Select
}
private void ensureTrackLooping(WorkingBeatmap beatmap, TrackChangeDirection changeDirection)
=> music.CurrentTrack.Looping = true;
=> beatmap.PrepareTrackForPreviewLooping();
public override bool OnBackButton()
{
@ -719,8 +720,6 @@ namespace osu.Game.Screens.Select
bool isNewTrack = !lastTrack.TryGetTarget(out var last) || last != track;
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
if (!track.IsRunning && (music.UserPauseRequested != true || isNewTrack))
music.Play(true);