mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:33:21 +08:00
Revert "Use the client.RoomUpdated action instead of binding the value of the settings overlay visibility and creating an event from it based on its ValueChanged action."
This reverts commit cbfb999c28
.
This commit is contained in:
parent
9b7187e3c8
commit
6d1d488831
@ -39,6 +39,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
|
||||
private MultiplayerMatchSettingsOverlay settingsOverlay;
|
||||
|
||||
private readonly Bindable<Visibility> settingsOverlayVisibility = new Bindable<Visibility>();
|
||||
|
||||
private GridContainer subScreenContainer;
|
||||
|
||||
private IBindable<bool> isConnected;
|
||||
@ -182,7 +184,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
};
|
||||
|
||||
subScreenContainer.Hide();
|
||||
client.RoomUpdated += roomUpdated;
|
||||
settingsOverlayVisibility.BindTo(settingsOverlay.State);
|
||||
settingsOverlayVisibility.ValueChanged += settingsOverlayVisibilityChanged;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -263,13 +266,19 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
readyClickOperation = null;
|
||||
}
|
||||
|
||||
private void roomUpdated()
|
||||
private void settingsOverlayVisibilityChanged(ValueChangedEvent<Visibility> settingsOverlayVisibilityChangedEvent)
|
||||
{
|
||||
if (client.Room != null)
|
||||
{
|
||||
// If the room is updated and is not null, show the room sub screen container and unsubscribe.
|
||||
subScreenContainer.Show();
|
||||
client.RoomUpdated -= roomUpdated;
|
||||
settingsOverlayVisibility.ValueChanged -= settingsOverlayVisibilityChanged;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (settingsOverlayVisibilityChangedEvent.NewValue == Visibility.Visible)
|
||||
subScreenContainer.Hide();
|
||||
else
|
||||
subScreenContainer.Show();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user