osu/osu.Game/Collections/DeleteCollectionDialog.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2020-09-04 18:52:07 +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.Allocation;
using osu.Framework.Graphics.Sprites;
using osu.Game.Overlays.Dialog;
namespace osu.Game.Collections
{
public class DeleteCollectionDialog : PopupDialog
{
[Resolved]
2020-09-04 18:55:43 +00:00
private BeatmapCollectionManager collectionManager { get; set; }
2020-09-04 18:52:07 +00:00
public DeleteCollectionDialog(BeatmapCollection collection)
{
HeaderText = "Confirm deletion of";
2020-09-04 19:43:51 +00:00
BodyText = collection.Name.Value;
2020-09-04 18:52:07 +00:00
Icon = FontAwesome.Regular.TrashAlt;
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = @"Yes. Go for it.",
Action = () => collectionManager.Collections.Remove(collection)
},
new PopupDialogCancelButton
{
Text = @"No! Abort mission!",
},
};
}
}
}