Fix looping failure

This commit is contained in:
Dean Herbert 2018-12-26 22:37:09 +09:00
parent 6b7b0af2e4
commit cc1f3d54b0

View File

@ -134,9 +134,18 @@ namespace osu.Game.Screens.Multi
Content.ScaleTo(1.1f, 250, Easing.InSine); Content.ScaleTo(1.1f, 250, Easing.InSine);
Content.FadeOut(250); Content.FadeOut(250);
cancelLooping();
base.OnSuspending(next); base.OnSuspending(next);
} }
private void cancelLooping()
{
var track = Beatmap.Value.Track;
if (track != null)
track.Looping = false;
}
protected override void LogoExiting(OsuLogo logo) protected override void LogoExiting(OsuLogo logo)
{ {
// the wave overlay transition takes longer than expected to run. // the wave overlay transition takes longer than expected to run.
@ -148,6 +157,8 @@ namespace osu.Game.Screens.Multi
{ {
base.Update(); base.Update();
if (!IsCurrentScreen) return;
if (currentScreen is MatchSubScreen) if (currentScreen is MatchSubScreen)
{ {
var track = Beatmap.Value.Track; var track = Beatmap.Value.Track;
@ -180,11 +191,7 @@ namespace osu.Game.Screens.Multi
private void screenRemoved(Screen newScreen) private void screenRemoved(Screen newScreen)
{ {
if (currentScreen is MatchSubScreen) if (currentScreen is MatchSubScreen)
{ cancelLooping();
var track = Beatmap.Value.Track;
if (track != null)
track.Looping = false;
}
currentScreen = (OsuScreen)newScreen; currentScreen = (OsuScreen)newScreen;
} }