1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00

Revert PlaylistItem.APIBeatmap to be private

This commit is contained in:
Dean Herbert 2021-11-04 13:36:32 +09:00
parent 05f1fd4bc9
commit 9f9c960fe3
5 changed files with 6 additions and 8 deletions

View File

@ -43,7 +43,7 @@ namespace osu.Game.Online.Rooms
public readonly BindableList<Mod> RequiredMods = new BindableList<Mod>();
[JsonProperty("beatmap")]
public APIBeatmap APIBeatmap { get; set; }
private APIBeatmap apiBeatmap { get; set; }
private APIMod[] allowedModsBacking;
@ -71,7 +71,7 @@ namespace osu.Game.Online.Rooms
public void MapObjects(RulesetStore rulesets)
{
Beatmap.Value ??= APIBeatmap;
Beatmap.Value ??= apiBeatmap;
Ruleset.Value ??= rulesets.GetRuleset(RulesetID);
Ruleset rulesetInstance = Ruleset.Value.CreateInstance();

View File

@ -60,10 +60,8 @@ namespace osu.Game.Screens.OnlinePlay.Components
{
Schedule(() =>
{
var beatmap = playlistItem?.APIBeatmap;
string? lastCover = (background?.Beatmap?.BeatmapSet as IBeatmapSetOnlineInfo)?.Covers.Cover;
string? newCover = beatmap?.BeatmapSet?.Covers.Cover;
string? newCover = (background?.Beatmap?.BeatmapSet as IBeatmapSetOnlineInfo)?.Covers.Cover;
if (lastCover == newCover)
return;

View File

@ -30,7 +30,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
private void updateBeatmap()
{
sprite.Beatmap.Value = Playlist.FirstOrDefault()?.APIBeatmap;
sprite.Beatmap.Value = Playlist.FirstOrDefault()?.Beatmap.Value;
}
protected virtual UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new UpdateableBeatmapBackgroundSprite(BeatmapSetCoverType) { RelativeSizeAxes = Axes.Both };

View File

@ -17,7 +17,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
public PlaylistItemBackground(PlaylistItem? playlistItem)
{
Beatmap = playlistItem?.APIBeatmap;
Beatmap = playlistItem?.Beatmap.Value;
}
[BackgroundDependencyLoader]

View File

@ -62,7 +62,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
if (editButton != null)
host.BindValueChanged(h => editButton.Alpha = h.NewValue?.Equals(api.LocalUser.Value) == true ? 1 : 0, true);
SelectedItem.BindValueChanged(item => background.Beatmap.Value = item.NewValue?.APIBeatmap, true);
SelectedItem.BindValueChanged(item => background.Beatmap.Value = item.NewValue?.Beatmap.Value, true);
}
protected override Drawable CreateBackground() => background = new BackgroundSprite();