2019-12-18 19:22:42 -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.
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Game.Overlays.Dialog;
|
|
|
|
using osu.Game.Scoring;
|
2019-12-18 21:04:10 -08:00
|
|
|
using System.Diagnostics;
|
2019-12-18 19:22:42 -08:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2020-01-06 17:32:24 +09:00
|
|
|
using osu.Game.Beatmaps;
|
2019-12-18 19:22:42 -08:00
|
|
|
|
|
|
|
namespace osu.Game.Screens.Select
|
|
|
|
{
|
2022-07-23 21:20:27 +02:00
|
|
|
public class LocalScoreDeleteDialog : DeleteConfirmationDialog
|
2019-12-18 19:22:42 -08:00
|
|
|
{
|
2020-01-06 17:32:24 +09:00
|
|
|
private readonly ScoreInfo score;
|
|
|
|
|
2019-12-18 19:26:35 -08:00
|
|
|
public LocalScoreDeleteDialog(ScoreInfo score)
|
2019-12-18 19:22:42 -08:00
|
|
|
{
|
2020-01-06 17:32:24 +09:00
|
|
|
this.score = score;
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2022-07-23 21:20:27 +02:00
|
|
|
private void load(BeatmapManager beatmapManager, ScoreManager scoreManager)
|
2020-01-06 17:32:24 +09:00
|
|
|
{
|
2022-07-23 21:20:27 +02:00
|
|
|
BeatmapInfo? beatmapInfo = beatmapManager.QueryBeatmap(b => b.ID == score.BeatmapInfoID);
|
2021-10-03 00:55:29 +09:00
|
|
|
Debug.Assert(beatmapInfo != null);
|
2019-12-18 19:22:42 -08:00
|
|
|
|
2020-02-03 22:11:36 +07:00
|
|
|
BodyText = $"{score.User} ({score.DisplayAccuracy}, {score.Rank})";
|
2019-12-18 19:22:42 -08:00
|
|
|
|
2020-01-06 17:46:38 +09:00
|
|
|
Icon = FontAwesome.Regular.TrashAlt;
|
2022-07-23 21:20:27 +02:00
|
|
|
DeleteAction = () => scoreManager.Delete(score);
|
2019-12-18 19:22:42 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|