1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 23:42:55 +08:00
osu-lazer/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs

50 lines
1.5 KiB
C#
Raw Normal View History

2019-01-05 03:13:32 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Overlays.Dialog;
using osu.Game.Scoring;
using System;
using System.Collections.Generic;
using System.Linq;
namespace osu.Game.Screens.Select
{
2019-01-05 03:32:52 +08:00
public class BeatmapClearScoresDialog : PopupDialog
2019-01-05 03:13:32 +08:00
{
private ScoreManager manager;
[BackgroundDependencyLoader]
2019-01-06 20:38:43 +08:00
private void load(ScoreManager scoreManager)
2019-01-05 03:13:32 +08:00
{
2019-01-06 20:38:43 +08:00
manager = scoreManager;
2019-01-05 03:13:32 +08:00
}
2019-01-05 03:32:52 +08:00
public BeatmapClearScoresDialog(BeatmapSetInfo beatmap, IEnumerable<ScoreInfo> scores, Action refresh)
2019-01-05 03:13:32 +08:00
{
BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}";
Icon = FontAwesome.fa_eraser;
HeaderText = $@"Clearing {scores.Count()} local score(s). Are you sure?";
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = @"Yes. Please.",
Action = () =>
{
manager.Delete(scores.ToList());
refresh();
}
},
new PopupDialogCancelButton
{
Text = @"No, I'm still attached.",
},
};
}
}
}