diff --git a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs index 9cf328e900..e36493c82f 100644 --- a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs @@ -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) { diff --git a/osu.Game/Screens/Select/LocalScoreDeleteDialog.cs b/osu.Game/Screens/Select/LocalScoreDeleteDialog.cs index c1d680fd45..d607706fc3 100644 --- a/osu.Game/Screens/Select/LocalScoreDeleteDialog.cs +++ b/osu.Game/Screens/Select/LocalScoreDeleteDialog.cs @@ -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 {