1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Remove now unnecessary schedule

This commit is contained in:
smoogipoo 2021-02-19 13:23:01 +09:00
parent e911760318
commit bc10fcafae

View File

@ -47,7 +47,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
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 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
{
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 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
}, 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();