1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

Revert editor exit behaviour to exit without changes for now

This commit is contained in:
Dean Herbert 2022-03-22 14:46:57 +09:00
parent ed66f86ac6
commit f95bd89166
2 changed files with 8 additions and 2 deletions

View File

@ -219,7 +219,12 @@ namespace osu.Game.Overlays.Dialog
/// <summary>
/// Programmatically clicks the first <see cref="PopupDialogOkButton"/>.
/// </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)
{

View File

@ -28,6 +28,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings;
using osu.Game.Online.API;
using osu.Game.Overlays;
using osu.Game.Overlays.Dialog;
using osu.Game.Overlays.Notifications;
using osu.Game.Rulesets;
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 (dialogOverlay.CurrentDialog is PromptForSaveDialog saveDialog)
{
saveDialog.PerformOkAction();
saveDialog.PerformAction<PopupDialogDangerousButton>();
return true;
}