1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 19:22:56 +08:00
osu-lazer/osu.Game/Screens/Select/SkinDeleteDialog.cs

45 lines
1.3 KiB
C#
Raw Normal View History

// 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
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; }
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 17:10:41 +08:00
new PopupDialogDangerousButton
{
2022-06-08 17:10:41 +08:00
Text = @"Yes. Totally. Delete it.",
Action = () =>
{
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 17:10:41 +08:00
},
new PopupDialogCancelButton
{
Text = @"Firetruck, I didn't mean to!",
},
};
}
}
}