diff --git a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistItemUserBestResultsScreen.cs b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistItemUserBestResultsScreen.cs index 866b094178..c5cea5fef1 100644 --- a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistItemUserBestResultsScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistItemUserBestResultsScreen.cs @@ -2,9 +2,12 @@ // See the LICENCE file in the repository root for full licence text. using System.Linq; +using osu.Framework.Allocation; +using osu.Game.Beatmaps; using osu.Game.Online.API; using osu.Game.Online.Rooms; using osu.Game.Scoring; +using osu.Game.Screens.Backgrounds; namespace osu.Game.Screens.OnlinePlay.Playlists { @@ -14,6 +17,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists public partial class PlaylistItemUserBestResultsScreen : PlaylistItemResultsScreen { private readonly int userId; + private WorkingBeatmap itemBeatmap = null!; public PlaylistItemUserBestResultsScreen(long roomId, PlaylistItem playlistItem, int userId) : base(null, roomId, playlistItem) @@ -21,6 +25,13 @@ namespace osu.Game.Screens.OnlinePlay.Playlists this.userId = userId; } + [BackgroundDependencyLoader] + private void load(BeatmapManager beatmaps) + { + var localBeatmap = beatmaps.QueryBeatmap($@"{nameof(BeatmapInfo.OnlineID)} == $0 AND {nameof(BeatmapInfo.MD5Hash)} == {nameof(BeatmapInfo.OnlineMD5Hash)}", PlaylistItem.Beatmap.OnlineID); + itemBeatmap = beatmaps.GetWorkingBeatmap(localBeatmap); + } + protected override APIRequest CreateScoreRequest() => new ShowPlaylistUserScoreRequest(RoomId, PlaylistItem.ID, userId); protected override void OnScoresAdded(ScoreInfo[] scores) @@ -30,5 +41,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists // Prefer selecting the local user's score, or otherwise default to the first visible score. SelectedScore.Value ??= scores.FirstOrDefault(s => s.UserID == userId) ?? scores.FirstOrDefault(); } + + protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(itemBeatmap); } }