mirror of
https://github.com/ppy/osu
synced 2024-12-12 18:07:52 +00:00
Redirect graceful exiting to standard exit flow
Rather than doing a completely forced exit as we were, this will now follow a more standard flow with the ability for the user to abort along the way. This is more in line with how I wanted this to work. Note that this means a confirmation is now shown. It has been discussed in the past that this confirmation should only show when there's an ongoing action implies the user may want to cancel the exit. For now I think this is fine. Addresses https://github.com/ppy/osu/discussions/18399#discussioncomment-2811311
This commit is contained in:
parent
cbc218200a
commit
56abe54fe6
@ -637,6 +637,12 @@ namespace osu.Game
|
||||
Add(performFromMainMenuTask = new PerformFromMenuRunner(action, validScreens, () => ScreenStack.CurrentScreen));
|
||||
}
|
||||
|
||||
public override void GracefullyExit()
|
||||
{
|
||||
// Using PerformFromScreen gives the user a chance to interrupt the exit process if needed.
|
||||
PerformFromScreen(menu => menu.Exit());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wait for the game (and target component) to become loaded and then run an action.
|
||||
/// </summary>
|
||||
|
@ -419,7 +419,7 @@ namespace osu.Game
|
||||
/// 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()
|
||||
public virtual void GracefullyExit()
|
||||
{
|
||||
if (!OnExiting())
|
||||
Exit();
|
||||
|
Loading…
Reference in New Issue
Block a user