2022-06-08 06:01:40 +08: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 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2022-06-08 06:01:40 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
using osu.Game.Overlays.Dialog;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Select
|
|
|
|
|
{
|
|
|
|
|
public class SkinDeleteDialog : PopupDialog
|
|
|
|
|
{
|
2022-06-08 17:10:41 +08:00
|
|
|
|
[Resolved]
|
|
|
|
|
private SkinManager manager { get; set; }
|
2022-06-08 06:01:40 +08:00
|
|
|
|
|
|
|
|
|
public SkinDeleteDialog(Skin skin)
|
|
|
|
|
{
|
2022-06-08 17:10:41 +08:00
|
|
|
|
BodyText = skin.SkinInfo.Value.Name;
|
|
|
|
|
Icon = FontAwesome.Regular.TrashAlt;
|
|
|
|
|
HeaderText = @"Confirm deletion of";
|
|
|
|
|
Buttons = new PopupDialogButton[]
|
2022-06-08 06:01:40 +08:00
|
|
|
|
{
|
2022-06-08 17:10:41 +08:00
|
|
|
|
new PopupDialogDangerousButton
|
2022-06-08 06:01:40 +08:00
|
|
|
|
{
|
2022-06-08 17:10:41 +08:00
|
|
|
|
Text = @"Yes. Totally. Delete it.",
|
|
|
|
|
Action = () =>
|
2022-06-08 06:01:40 +08:00
|
|
|
|
{
|
2022-06-08 17:10:41 +08:00
|
|
|
|
if (manager == null)
|
|
|
|
|
return;
|
2022-06-08 16:57:59 +08:00
|
|
|
|
|
2022-06-08 17:10:41 +08:00
|
|
|
|
manager.Delete(skin.SkinInfo.Value);
|
|
|
|
|
manager.CurrentSkinInfo.SetDefault();
|
2022-06-08 06:01:40 +08:00
|
|
|
|
},
|
2022-06-08 17:10:41 +08:00
|
|
|
|
},
|
|
|
|
|
new PopupDialogCancelButton
|
|
|
|
|
{
|
|
|
|
|
Text = @"Firetruck, I didn't mean to!",
|
|
|
|
|
},
|
|
|
|
|
};
|
2022-06-08 06:01:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|