2019-12-19 11: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;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Select
|
|
|
|
{
|
2023-02-28 04:57:59 +08:00
|
|
|
public partial class LocalScoreDeleteDialog : DangerousActionDialog
|
2019-12-19 11:22:42 +08:00
|
|
|
{
|
2020-01-06 16:32:24 +08:00
|
|
|
private readonly ScoreInfo score;
|
|
|
|
|
2019-12-19 11:26:35 +08:00
|
|
|
public LocalScoreDeleteDialog(ScoreInfo score)
|
2019-12-19 11:22:42 +08:00
|
|
|
{
|
2020-01-06 16:32:24 +08:00
|
|
|
this.score = score;
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2023-07-04 13:50:34 +08:00
|
|
|
private void load(ScoreManager scoreManager)
|
2020-01-06 16:32:24 +08:00
|
|
|
{
|
2020-02-03 23:11:36 +08:00
|
|
|
BodyText = $"{score.User} ({score.DisplayAccuracy}, {score.Rank})";
|
2019-12-19 11:22:42 +08:00
|
|
|
|
2020-01-06 16:46:38 +08:00
|
|
|
Icon = FontAwesome.Regular.TrashAlt;
|
2023-03-06 03:57:26 +08:00
|
|
|
DangerousAction = () => scoreManager.Delete(score);
|
2019-12-19 11:22:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|