2017-02-28 03:19:28 +00:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-02-28 06:09:36 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2017-02-28 03:19:28 +00:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Overlays.Dialog;
|
|
|
|
|
|
2017-03-03 01:28:05 +00:00
|
|
|
|
namespace osu.Game.Screens.Select
|
2017-02-28 03:19:28 +00:00
|
|
|
|
{
|
|
|
|
|
public class BeatmapDeleteDialog : PopupDialog
|
|
|
|
|
{
|
2017-07-27 07:56:41 +00:00
|
|
|
|
private BeatmapManager manager;
|
2017-02-28 06:09:36 +00:00
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2017-07-27 07:56:41 +00:00
|
|
|
|
private void load(BeatmapManager beatmapManager)
|
2017-02-28 06:09:36 +00:00
|
|
|
|
{
|
2017-07-27 07:56:41 +00:00
|
|
|
|
manager = beatmapManager;
|
2017-02-28 06:09:36 +00:00
|
|
|
|
}
|
2017-02-28 03:19:28 +00:00
|
|
|
|
|
2017-08-31 06:49:56 +00:00
|
|
|
|
public BeatmapDeleteDialog(BeatmapSetInfo beatmap)
|
2017-02-28 03:19:28 +00:00
|
|
|
|
{
|
2017-08-31 06:49:56 +00:00
|
|
|
|
BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}";
|
2017-03-07 01:59:19 +00:00
|
|
|
|
|
2017-02-28 03:19:28 +00:00
|
|
|
|
Icon = FontAwesome.fa_trash_o;
|
|
|
|
|
HeaderText = @"Confirm deletion of";
|
|
|
|
|
Buttons = new PopupDialogButton[]
|
|
|
|
|
{
|
|
|
|
|
new PopupDialogOkButton
|
|
|
|
|
{
|
|
|
|
|
Text = @"Yes. Totally. Delete it.",
|
2017-08-31 06:49:56 +00:00
|
|
|
|
Action = () => manager.Delete(beatmap),
|
2017-02-28 03:19:28 +00:00
|
|
|
|
},
|
|
|
|
|
new PopupDialogCancelButton
|
|
|
|
|
{
|
|
|
|
|
Text = @"Firetruck, I didn't mean to!",
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|