1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-07 01:07:20 +08:00
osu-lazer/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
889 B
C#
Raw Normal View History

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
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;
using osu.Game.Beatmaps;
using osu.Game.Overlays.Dialog;
using osu.Game.Scoring;
namespace osu.Game.Screens.Select
{
public partial class BeatmapClearScoresDialog : DangerousActionDialog
2019-01-04 20:13:32 +01:00
{
[Resolved]
private ScoreManager scoreManager { get; set; } = null!;
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
{
BodyText = $"All local scores on {beatmapInfo.GetDisplayTitle()}";
DangerousAction = () =>
2019-01-04 20:13:32 +01:00
{
Task.Run(() => scoreManager.Delete(beatmapInfo))
.ContinueWith(_ => onCompletion);
2019-01-04 20:13:32 +01:00
};
}
}
}