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;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Select
|
|
|
|
{
|
2023-02-27 21:57:59 +01:00
|
|
|
public partial class LocalScoreDeleteDialog : DangerousActionDialog
|
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]
|
2023-07-04 14:50:34 +09:00
|
|
|
private void load(ScoreManager scoreManager)
|
2020-01-06 17:32:24 +09: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;
|
2023-03-05 20:57:26 +01:00
|
|
|
DangerousAction = () => scoreManager.Delete(score);
|
2019-12-18 19:22:42 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|