mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 21:07:18 +09:00
Move graceful exit to OsuGameBase
This commit is contained in:
parent
6002014f95
commit
9e15dccc56
@ -918,18 +918,6 @@ namespace osu.Game
|
|||||||
return base.OnExiting();
|
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()
|
protected override void UpdateAfterChildren()
|
||||||
{
|
{
|
||||||
base.UpdateAfterChildren();
|
base.UpdateAfterChildren();
|
||||||
|
@ -368,6 +368,18 @@ namespace osu.Game
|
|||||||
LocalConfig ??= new OsuConfigManager(Storage);
|
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);
|
protected override Storage CreateStorage(GameHost host, Storage defaultStorage) => new OsuStorage(host, defaultStorage);
|
||||||
|
|
||||||
private readonly List<ICanAcceptFiles> fileImporters = new List<ICanAcceptFiles>();
|
private readonly List<ICanAcceptFiles> fileImporters = new List<ICanAcceptFiles>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user