mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 04:52:57 +08:00
Fix game exiting instantly on pressing close button
This commit is contained in:
parent
50a384e19c
commit
a7e281469b
@ -668,6 +668,23 @@ namespace osu.Game
|
|||||||
private FrameworkConfigManager frameworkConfig;
|
private FrameworkConfigManager frameworkConfig;
|
||||||
private ScalingContainer screenContainer;
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Use to programatically exit the game as if the user was triggering via alt-f4.
|
/// 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).
|
/// Will keep persisting until an exit occurs (exit may be blocked multiple times).
|
||||||
|
Loading…
Reference in New Issue
Block a user