mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Leaderboard should not change the model
This commit is contained in:
parent
4a7f5f98df
commit
61c269b17b
@ -186,15 +186,10 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
return req;
|
||||
}
|
||||
|
||||
protected override LeaderboardScore CreateDrawableScore(ScoreInfo model, int index)
|
||||
protected override LeaderboardScore CreateDrawableScore(ScoreInfo model, int index) => new LeaderboardScore(model, index, IsOnlineScope)
|
||||
{
|
||||
model.Beatmap = beatmap;
|
||||
|
||||
return new LeaderboardScore(model, index, IsOnlineScope)
|
||||
{
|
||||
Action = () => ScoreSelected?.Invoke(model)
|
||||
};
|
||||
}
|
||||
Action = () => ScoreSelected?.Invoke(model)
|
||||
};
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
|
@ -6,21 +6,35 @@ using osu.Game.Overlays.Dialog;
|
||||
using osu.Game.Scoring;
|
||||
using System.Diagnostics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Beatmaps;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
public class LocalScoreDeleteDialog : PopupDialog
|
||||
{
|
||||
private readonly ScoreInfo score;
|
||||
|
||||
[Resolved]
|
||||
private ScoreManager scoreManager { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private BeatmapManager beatmapManager { get; set; }
|
||||
|
||||
public LocalScoreDeleteDialog(ScoreInfo score)
|
||||
{
|
||||
this.score = score;
|
||||
Debug.Assert(score != null);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
BeatmapInfo beatmap = beatmapManager.QueryBeatmap(b => b.ID == score.BeatmapInfoID);
|
||||
Debug.Assert(beatmap != null);
|
||||
|
||||
string accuracy = string.Format(score.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", score.Accuracy);
|
||||
|
||||
BodyText = $@"{score.User}'s {accuracy} {score.Rank} Rank on {score.Beatmap}";
|
||||
BodyText = $@"{score.User}'s {accuracy} {score.Rank} Rank on {beatmap}";
|
||||
Icon = FontAwesome.Solid.Eraser;
|
||||
HeaderText = @"Deleting this local score. Are you sure?";
|
||||
Buttons = new PopupDialogButton[]
|
||||
@ -28,7 +42,7 @@ namespace osu.Game.Screens.Select
|
||||
new PopupDialogOkButton
|
||||
{
|
||||
Text = @"Yes. Please.",
|
||||
Action = () => scoreManager.Delete(score)
|
||||
Action = () => scoreManager?.Delete(score)
|
||||
},
|
||||
new PopupDialogCancelButton
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user