diff --git a/osu.Game/GameModes/Menu/Intro.cs b/osu.Game/GameModes/Menu/Intro.cs index c2f0599fdd..4f4aaf7704 100644 --- a/osu.Game/GameModes/Menu/Intro.cs +++ b/osu.Game/GameModes/Menu/Intro.cs @@ -15,7 +15,11 @@ namespace osu.Game.GameModes.Menu class Intro : OsuGameMode { private OsuLogo logo; - private bool didLoadMenu; + + /// + /// Whether we have loaded the menu previously. + /// + internal bool DidLoadMenu; protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty(); @@ -54,7 +58,7 @@ public override void Load() Game.Scheduler.AddDelayed(delegate { - didLoadMenu = true; + DidLoadMenu = true; Push(new MainMenu()); }, 2900); @@ -73,7 +77,7 @@ protected override void OnSuspending(GameMode next) protected override bool OnExiting(GameMode next) { //cancel exiting if we haven't loaded the menu yet. - return !didLoadMenu; + return !DidLoadMenu; } protected override void OnResuming(GameMode last) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 056c754d41..9caa431bf8 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -95,6 +95,17 @@ private void modeChanged(GameMode newMode) Host.Exit(); } + protected override bool OnExiting() + { + if (!intro.DidLoadMenu || intro.ChildGameMode != null) + { + intro.MakeCurrent(); + return true; + } + + return base.OnExiting(); + } + private void modeAdded(GameMode newMode) { newMode.ModePushed += modeAdded;