mirror of
https://github.com/ppy/osu
synced 2024-12-11 17:42:28 +00: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 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>
|
||||
/// 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).
|
||||
|
Loading…
Reference in New Issue
Block a user