1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 12:22:56 +08:00

Rename GracefullyExit to AttemptExit

This commit is contained in:
Dean Herbert 2022-06-19 12:34:14 +09:00
parent f7fc456bb1
commit 50e40756c4
5 changed files with 7 additions and 6 deletions

View File

@ -154,7 +154,7 @@ namespace osu.Desktop.Updater
Activated = () =>
{
updateManager.PrepareUpdateAsync()
.ContinueWith(_ => updateManager.Schedule(() => game?.GracefullyExit()));
.ContinueWith(_ => updateManager.Schedule(() => game?.AttemptExit()));
return true;
};
}

View File

@ -27,7 +27,7 @@ namespace osu.Game.Tournament.Screens.Setup
dropdown.Items = storage.ListTournaments();
dropdown.Current.BindValueChanged(v => Button.Enabled.Value = v.NewValue != startupTournament, true);
Action = () => game.GracefullyExit();
Action = () => game.AttemptExit();
folderButton.Action = () => storage.PresentExternally();
ButtonText = "Close osu!";

View File

@ -637,7 +637,7 @@ namespace osu.Game
Add(performFromMainMenuTask = new PerformFromMenuRunner(action, validScreens, () => ScreenStack.CurrentScreen));
}
public override void GracefullyExit()
public override void AttemptExit()
{
// Using PerformFromScreen gives the user a chance to interrupt the exit process if needed.
PerformFromScreen(menu => menu.Exit());

View File

@ -418,13 +418,14 @@ namespace osu.Game
/// <summary>
/// Use to programatically exit the game as if the user was triggering via alt-f4.
/// By default, will keep persisting until an exit occurs (exit may be blocked multiple times).
/// May be interrupted (see <see cref="OsuGame"/>'s override.
/// </summary>
public virtual void GracefullyExit()
public virtual void AttemptExit()
{
if (!OnExiting())
Exit();
else
Scheduler.AddDelayed(GracefullyExit, 2000);
Scheduler.AddDelayed(AttemptExit, 2000);
}
public bool Migrate(string path)

View File

@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
dialogOverlay.Push(new ConfirmDialog("To complete this operation, osu! will close. Please open it again to use the new data location.", () =>
{
(storage as OsuStorage)?.ChangeDataPath(target.FullName);
game.GracefullyExit();
game.AttemptExit();
}, () => { }));
},
() => { }));