1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-11 07:57:18 +08:00
osu-lazer/osu.Game/Screens/Edit/SaveAndReloadEditorDialog.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

35 lines
988 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.Overlays.Dialog;
using osu.Game.Localisation;
namespace osu.Game.Screens.Edit
{
public partial class SaveAndReloadEditorDialog : PopupDialog
{
public SaveAndReloadEditorDialog(Action reload, Action cancel)
{
HeaderText = EditorDialogsStrings.EditorReloadDialogHeader;
Icon = FontAwesome.Solid.Sync;
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = DialogStrings.Confirm,
Action = reload
},
new PopupDialogCancelButton
{
Text = DialogStrings.Cancel,
Action = cancel
}
};
}
}
}