Move graceful exit to OsuGameBase

This commit is contained in:
Shivam 2020-12-26 15:36:21 +01:00
parent 6002014f95
commit 9e15dccc56
2 changed files with 12 additions and 12 deletions

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();

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>();