mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add prompt to save beatmap on exiting editor
This commit is contained in:
33
osu.Game/Screens/Edit/PromptForSaveDialog.cs
Normal file
33
osu.Game/Screens/Edit/PromptForSaveDialog.cs
Normal file
@ -0,0 +1,33 @@
|
||||
// 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;
|
||||
|
||||
namespace osu.Game.Screens.Edit
|
||||
{
|
||||
public class PromptForSaveDialog : PopupDialog
|
||||
{
|
||||
public PromptForSaveDialog(Action exit, Action saveAndExit)
|
||||
{
|
||||
HeaderText = "Did you want to save your changes?";
|
||||
|
||||
Icon = FontAwesome.Regular.Save;
|
||||
|
||||
Buttons = new PopupDialogButton[]
|
||||
{
|
||||
new PopupDialogCancelButton
|
||||
{
|
||||
Text = @"Save my masterpiece!",
|
||||
Action = saveAndExit
|
||||
},
|
||||
new PopupDialogOkButton
|
||||
{
|
||||
Text = @"Forget all changes",
|
||||
Action = exit
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user