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