1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 01:59:53 +08:00

Move graceful exit to OsuGameBase

This commit is contained in:
Shivam
2020-12-26 15:36:21 +01:00
Unverified
parent 6002014f95
commit 9e15dccc56
2 changed files with 12 additions and 12 deletions
-12
View File
@@ -918,18 +918,6 @@ namespace osu.Game
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).
/// </summary>
public void GracefullyExit()
{
if (!OnExiting())
Exit();
else
Scheduler.AddDelayed(GracefullyExit, 2000);
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
+12
View File
@@ -368,6 +368,18 @@ namespace osu.Game
LocalConfig ??= new OsuConfigManager(Storage);
}
/// <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).
/// </summary>
public void GracefullyExit()
{
if (!OnExiting())
Exit();
else
Scheduler.AddDelayed(GracefullyExit, 2000);
}
protected override Storage CreateStorage(GameHost host, Storage defaultStorage) => new OsuStorage(host, defaultStorage);
private readonly List<ICanAcceptFiles> fileImporters = new List<ICanAcceptFiles>();