mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:42:58 +08:00
Revert editor exit behaviour to exit without changes for now
This commit is contained in:
parent
ed66f86ac6
commit
f95bd89166
@ -219,7 +219,12 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Programmatically clicks the first <see cref="PopupDialogOkButton"/>.
|
/// Programmatically clicks the first <see cref="PopupDialogOkButton"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void PerformOkAction() => Buttons.OfType<PopupDialogOkButton>().First().TriggerClick();
|
public void PerformOkAction() => PerformAction<PopupDialogOkButton>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Programmatically clicks the first button of the provided type.
|
||||||
|
/// </summary>
|
||||||
|
public void PerformAction<T>() where T : PopupDialogButton => Buttons.OfType<T>().First().TriggerClick();
|
||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
{
|
{
|
||||||
|
@ -28,6 +28,7 @@ using osu.Game.Graphics.UserInterface;
|
|||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.Dialog;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
@ -598,7 +599,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
// if the dialog is already displayed, confirm exit with no save.
|
// if the dialog is already displayed, confirm exit with no save.
|
||||||
if (dialogOverlay.CurrentDialog is PromptForSaveDialog saveDialog)
|
if (dialogOverlay.CurrentDialog is PromptForSaveDialog saveDialog)
|
||||||
{
|
{
|
||||||
saveDialog.PerformOkAction();
|
saveDialog.PerformAction<PopupDialogDangerousButton>();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user