2019-03-01 09:52:53 +08: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-05 03:13:32 +08:00
|
|
|
|
|
2021-12-13 18:01:20 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
2019-01-05 03:13:32 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Overlays.Dialog;
|
|
|
|
|
using osu.Game.Scoring;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Select
|
|
|
|
|
{
|
2022-07-24 03:20:27 +08:00
|
|
|
|
public class BeatmapClearScoresDialog : DeleteConfirmationDialog
|
2019-01-05 03:13:32 +08:00
|
|
|
|
{
|
2020-01-04 03:34:26 +08:00
|
|
|
|
[Resolved]
|
2022-07-24 03:20:27 +08:00
|
|
|
|
private ScoreManager scoreManager { get; set; } = null!;
|
2019-01-05 03:13:32 +08:00
|
|
|
|
|
2021-10-02 23:55:29 +08:00
|
|
|
|
public BeatmapClearScoresDialog(BeatmapInfo beatmapInfo, Action onCompletion)
|
2019-01-05 03:13:32 +08:00
|
|
|
|
{
|
2022-07-24 03:20:27 +08:00
|
|
|
|
BodyText = $"All local scores on {beatmapInfo.GetDisplayTitle()}";
|
|
|
|
|
DeleteAction = () =>
|
2019-01-05 03:13:32 +08:00
|
|
|
|
{
|
2022-07-24 03:20:27 +08:00
|
|
|
|
Task.Run(() => scoreManager.Delete(beatmapInfo))
|
|
|
|
|
.ContinueWith(_ => onCompletion);
|
2019-01-05 03:13:32 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|