mirror of
https://github.com/ppy/osu.git
synced 2025-03-22 22:29:28 +08:00
Fix potential crash from playlist updating during async load
This commit is contained in:
parent
f743a3647f
commit
eb983ed548
@ -44,6 +44,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
|
||||
public override string ShortTitle => "room";
|
||||
|
||||
public OsuButton AddOrEditPlaylistButton { get; private set; }
|
||||
|
||||
[Resolved]
|
||||
private MultiplayerClient client { get; set; }
|
||||
|
||||
@ -55,7 +57,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
[CanBeNull]
|
||||
private IDisposable readyClickOperation;
|
||||
|
||||
public OsuButton AddOrEditPlaylistButton { get; private set; }
|
||||
private DrawableRoomPlaylist playlist;
|
||||
|
||||
public MultiplayerMatchSubScreen(Room room)
|
||||
: base(room)
|
||||
@ -73,6 +75,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
BeatmapAvailability.BindValueChanged(updateBeatmapAvailability, true);
|
||||
UserMods.BindValueChanged(onUserModsChanged);
|
||||
|
||||
playlist.Items.BindTo(Room.Playlist);
|
||||
playlist.SelectedItem.BindTo(SelectedItem);
|
||||
|
||||
client.LoadRequested += onLoadRequested;
|
||||
client.RoomUpdated += onRoomUpdated;
|
||||
|
||||
@ -149,11 +154,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
null,
|
||||
new Drawable[]
|
||||
{
|
||||
new DrawableRoomPlaylist(false, false)
|
||||
playlist = new DrawableRoomPlaylist(false, false)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Items = { BindTarget = Room.Playlist },
|
||||
SelectedItem = { BindTarget = SelectedItem }
|
||||
},
|
||||
},
|
||||
new[]
|
||||
|
Loading…
x
Reference in New Issue
Block a user