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.
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2022-02-06 16:52:59 +00:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Game.Overlays.Dialog;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit
|
|
|
|
{
|
|
|
|
public 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)
|
|
|
|
{
|
2022-02-06 18:51:02 +00:00
|
|
|
HeaderText = "Would you like to create a blank difficulty?";
|
2022-02-06 16:52:59 +00:00
|
|
|
|
|
|
|
Icon = FontAwesome.Regular.Clone;
|
|
|
|
|
|
|
|
Buttons = new PopupDialogButton[]
|
|
|
|
{
|
|
|
|
new PopupDialogOkButton
|
|
|
|
{
|
|
|
|
Text = "Yeah, let's start from scratch!",
|
2022-02-14 19:56:05 +00:00
|
|
|
Action = () => createNewDifficulty.Invoke(false)
|
2022-02-06 16:52:59 +00:00
|
|
|
},
|
|
|
|
new PopupDialogCancelButton
|
|
|
|
{
|
|
|
|
Text = "No, create an exact copy of this difficulty",
|
2022-02-14 19:56:05 +00:00
|
|
|
Action = () => createNewDifficulty.Invoke(true)
|
2022-02-06 16:52:59 +00:00
|
|
|
},
|
|
|
|
new PopupDialogCancelButton
|
|
|
|
{
|
|
|
|
Text = "I changed my mind, I want to keep editing this difficulty",
|
|
|
|
Action = () => { }
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|