1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-11 09:37:22 +08:00
osu-lazer/osu.Game/Screens/Edit/DiscardUnsavedChangesDialog.cs
Bartłomiej Dach 3f461c0734
Add "discard unsaved changes" operation to beatmap editor
Apparently useful in modding workflows when you want to test out a few
different variants of a thing.

Re-uses `Ctrl-L` binding from stable. Some folks may argue that the
dialog makes the hotkey pointless, but I really do want to protect
users from accidental data loss, and also if you want to power through
it quickly, you can hit the 1 key when the dialog shows, which will
bypass the hold-to-activate period (which wasn't intentional, but so
many people want a bypass at this point that we're probably keeping that
behaviour for power users).
2025-03-05 14:34:44 +01:00

34 lines
987 B
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.Sprites;
using osu.Game.Localisation;
using osu.Game.Overlays.Dialog;
namespace osu.Game.Screens.Edit
{
public partial class DiscardUnsavedChangesDialog : PopupDialog
{
public DiscardUnsavedChangesDialog(Action exit)
{
HeaderText = EditorDialogsStrings.DiscardUnsavedChangesDialogHeader;
Icon = FontAwesome.Solid.Trash;
Buttons = new PopupDialogButton[]
{
new PopupDialogDangerousButton
{
Text = EditorDialogsStrings.ForgetAllChanges,
Action = exit
},
new PopupDialogCancelButton
{
Text = EditorDialogsStrings.ContinueEditing,
},
};
}
}
}