mirror of https://github.com/ppy/osu
Remove now unnecessary schedule
This commit is contained in:
parent
e911760318
commit
bc10fcafae
|
@ -47,7 +47,6 @@ public class MultiplayerMatchSubScreen : RoomSubScreen
|
|||
private Drawable userModsSection;
|
||||
|
||||
private readonly IBindable<bool> isConnected = new Bindable<bool>();
|
||||
private readonly IBindable<PlaylistItem> matchCurrentItem = new Bindable<PlaylistItem>();
|
||||
|
||||
[CanBeNull]
|
||||
private IDisposable readyClickOperation;
|
||||
|
@ -269,8 +268,8 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
matchCurrentItem.BindTo(client.CurrentMatchPlayingItem);
|
||||
matchCurrentItem.BindValueChanged(onCurrentItemChanged, true);
|
||||
SelectedItem.BindTo(client.CurrentMatchPlayingItem);
|
||||
SelectedItem.BindValueChanged(onSelectedItemChanged, true);
|
||||
|
||||
BeatmapAvailability.BindValueChanged(updateBeatmapAvailability, true);
|
||||
UserMods.BindValueChanged(onUserModsChanged);
|
||||
|
@ -286,20 +285,11 @@ protected override void LoadComplete()
|
|||
}, true);
|
||||
}
|
||||
|
||||
private void onCurrentItemChanged(ValueChangedEvent<PlaylistItem> item)
|
||||
private void onSelectedItemChanged(ValueChangedEvent<PlaylistItem> item)
|
||||
{
|
||||
if (client?.LocalUser == null)
|
||||
return;
|
||||
|
||||
// If we're about to enter gameplay, schedule the item to be set at a later time.
|
||||
if (client.LocalUser.State > MultiplayerUserState.Ready)
|
||||
{
|
||||
Schedule(() => onCurrentItemChanged(item));
|
||||
return;
|
||||
}
|
||||
|
||||
SelectedItem.Value = item.NewValue;
|
||||
|
||||
if (item.NewValue?.AllowedMods.Any() != true)
|
||||
{
|
||||
userModsSection.Hide();
|
||||
|
|
Loading…
Reference in New Issue