mirror of
https://github.com/ppy/osu.git
synced 2026-06-04 14:25:42 +08:00
Move implementation to base class
This commit is contained in:
committed by
Dean Herbert
Unverified
parent
504a7299e3
commit
bdd9e5f68d
@@ -19,6 +19,7 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osu.Game.Screens.Ranking;
|
||||
|
||||
namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
@@ -34,6 +35,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
|
||||
private MultiplayerScores? higherScores;
|
||||
private MultiplayerScores? lowerScores;
|
||||
private WorkingBeatmap itemBeatmap = null!;
|
||||
|
||||
[Resolved]
|
||||
protected IAPIProvider API { get; private set; } = null!;
|
||||
@@ -60,6 +62,10 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
var localBeatmap = beatmapManager.QueryBeatmap($@"{nameof(BeatmapInfo.OnlineID)} == $0 AND {nameof(BeatmapInfo.MD5Hash)} == {nameof(BeatmapInfo.OnlineMD5Hash)}",
|
||||
PlaylistItem.Beatmap.OnlineID);
|
||||
itemBeatmap = beatmapManager.GetWorkingBeatmap(localBeatmap);
|
||||
|
||||
AddInternal(new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
@@ -307,6 +313,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
}
|
||||
}
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(itemBeatmap);
|
||||
|
||||
private partial class PanelListLoadingSpinner : LoadingSpinner
|
||||
{
|
||||
private readonly ScorePanelList list;
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
// 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
|
||||
{
|
||||
@@ -17,7 +14,6 @@ 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)
|
||||
@@ -25,13 +21,6 @@ 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<MultiplayerScore> CreateScoreRequest() => new ShowPlaylistUserScoreRequest(RoomId, PlaylistItem.ID, userId);
|
||||
|
||||
protected override void OnScoresAdded(ScoreInfo[] scores)
|
||||
@@ -41,7 +30,5 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user