2019-03-01 10:52:53 +09: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.
|
2019-01-04 20:13:32 +01:00
|
|
|
|
|
2022-06-17 16:37:17 +09:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2021-12-13 19:01:20 +09:00
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
2019-01-04 20:13:32 +01:00
|
|
|
|
using osu.Framework.Allocation;
|
2021-12-13 19:01:20 +09:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2019-01-04 20:13:32 +01:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Overlays.Dialog;
|
|
|
|
|
using osu.Game.Scoring;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Select
|
|
|
|
|
{
|
2019-01-04 20:32:52 +01:00
|
|
|
|
public class BeatmapClearScoresDialog : PopupDialog
|
2019-01-04 20:13:32 +01:00
|
|
|
|
{
|
2020-01-03 11:34:26 -08:00
|
|
|
|
[Resolved]
|
|
|
|
|
private ScoreManager scoreManager { get; set; }
|
2019-01-04 20:13:32 +01:00
|
|
|
|
|
2021-10-03 00:55:29 +09:00
|
|
|
|
public BeatmapClearScoresDialog(BeatmapInfo beatmapInfo, Action onCompletion)
|
2019-01-04 20:13:32 +01:00
|
|
|
|
{
|
2022-01-12 23:42:12 +09:00
|
|
|
|
BodyText = beatmapInfo.GetDisplayTitle();
|
2019-04-02 19:55:24 +09:00
|
|
|
|
Icon = FontAwesome.Solid.Eraser;
|
2019-03-01 09:49:36 +09:00
|
|
|
|
HeaderText = @"Clearing all local scores. Are you sure?";
|
2019-01-04 20:13:32 +01:00
|
|
|
|
Buttons = new PopupDialogButton[]
|
|
|
|
|
{
|
|
|
|
|
new PopupDialogOkButton
|
|
|
|
|
{
|
|
|
|
|
Text = @"Yes. Please.",
|
|
|
|
|
Action = () =>
|
|
|
|
|
{
|
2022-01-28 15:08:39 +09:00
|
|
|
|
Task.Run(() => scoreManager.Delete(beatmapInfo))
|
2019-03-01 20:52:34 +09:00
|
|
|
|
.ContinueWith(_ => onCompletion);
|
2019-01-04 20:13:32 +01:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
new PopupDialogCancelButton
|
|
|
|
|
{
|
|
|
|
|
Text = @"No, I'm still attached.",
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|