From a7e281469baa21fcd203ced30b81b49f92f9e292 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 24 Jan 2019 20:13:29 +0900 Subject: [PATCH] Fix game exiting instantly on pressing close button --- osu.Game/OsuGame.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 881fd92f8d..b5e0aace74 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -668,6 +668,23 @@ namespace osu.Game private FrameworkConfigManager frameworkConfig; private ScalingContainer screenContainer; + protected override bool OnExiting() + { + if (screenStack.CurrentScreen is Loader) + return false; + + if (introScreen == null) + return true; + + if (!introScreen.DidLoadMenu || !(screenStack.CurrentScreen is Intro)) + { + Scheduler.Add(introScreen.MakeCurrent); + return true; + } + + return base.OnExiting(); + } + /// /// Use to programatically exit the game as if the user was triggering via alt-f4. /// Will keep persisting until an exit occurs (exit may be blocked multiple times).