Remove now unnecessary schedule

This commit is contained in:
smoogipoo 2021-02-19 13:23:01 +09:00
parent e911760318
commit bc10fcafae
1 changed files with 3 additions and 13 deletions

View File

@ -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();