2022-02-06 16:52:59 +00:00
|
|
|
// 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 osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Game.Overlays.Dialog;
|
2023-01-14 22:49:54 +00:00
|
|
|
using osu.Game.Localisation;
|
2022-02-06 16:52:59 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit
|
|
|
|
{
|
|
|
|
public partial class CreateNewDifficultyDialog : PopupDialog
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Delegate used to create new difficulties.
|
2022-02-14 19:56:05 +00:00
|
|
|
/// A value of <see langword="true"/> in the <c>createCopy</c> parameter
|
|
|
|
/// indicates that the new difficulty should be an exact copy of an existing one;
|
|
|
|
/// otherwise, the new difficulty should have its hitobjects and beatmap-level settings cleared.
|
2022-02-06 16:52:59 +00:00
|
|
|
/// </summary>
|
2022-02-14 19:56:05 +00:00
|
|
|
public delegate void CreateNewDifficulty(bool createCopy);
|
2022-02-06 16:52:59 +00:00
|
|
|
|
|
|
|
public CreateNewDifficultyDialog(CreateNewDifficulty createNewDifficulty)
|
|
|
|
{
|
2023-01-14 22:49:54 +00:00
|
|
|
HeaderText = EditorDialogsStrings.NewDifficultyDialogHeader;
|
2022-02-06 16:52:59 +00:00
|
|
|
|
|
|
|
Icon = FontAwesome.Regular.Clone;
|
|
|
|
|
|
|
|
Buttons = new PopupDialogButton[]
|
|
|
|
{
|
|
|
|
new PopupDialogOkButton
|
|
|
|
{
|
2023-01-14 22:49:54 +00:00
|
|
|
Text = EditorDialogsStrings.CreateNew,
|
2022-02-14 19:56:05 +00:00
|
|
|
Action = () => createNewDifficulty.Invoke(false)
|
2022-02-06 16:52:59 +00:00
|
|
|
},
|
|
|
|
new PopupDialogCancelButton
|
|
|
|
{
|
2023-01-14 22:49:54 +00:00
|
|
|
Text = EditorDialogsStrings.CreateCopy,
|
2022-02-14 19:56:05 +00:00
|
|
|
Action = () => createNewDifficulty.Invoke(true)
|
2022-02-06 16:52:59 +00:00
|
|
|
},
|
|
|
|
new PopupDialogCancelButton
|
|
|
|
{
|
2023-01-14 22:49:54 +00:00
|
|
|
Text = EditorDialogsStrings.KeepEditing,
|
2022-02-06 16:52:59 +00:00
|
|
|
Action = () => { }
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|