1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 10:47:28 +08:00
osu-lazer/osu.Game/Screens/Select/SkinDeleteDialog.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 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.
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!",
},
};
}
}
}