mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 00:22:58 +08:00
Hide main room subscreen on initial mp room creation. Toggle mp room subscreen visibility based on settings overlay visibility before room is created.
This commit is contained in:
parent
2beb9d6a32
commit
5233a0449a
@ -39,6 +39,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
|
|
||||||
private MultiplayerMatchSettingsOverlay settingsOverlay;
|
private MultiplayerMatchSettingsOverlay settingsOverlay;
|
||||||
|
|
||||||
|
private readonly Bindable<Visibility> settingsOverlayVisibility = new Bindable<Visibility>();
|
||||||
|
|
||||||
|
private GridContainer subScreenContainer;
|
||||||
|
|
||||||
private IBindable<bool> isConnected;
|
private IBindable<bool> isConnected;
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
@ -55,7 +59,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
{
|
{
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new GridContainer
|
subScreenContainer = new GridContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Content = new[]
|
Content = new[]
|
||||||
@ -178,6 +182,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
State = { Value = client.Room == null ? Visibility.Visible : Visibility.Hidden }
|
State = { Value = client.Room == null ? Visibility.Visible : Visibility.Hidden }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
subScreenContainer.Hide();
|
||||||
|
settingsOverlayVisibility.BindTo(settingsOverlay.State);
|
||||||
|
settingsOverlayVisibility.ValueChanged += settingsOverlayVisibilityChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -258,6 +266,22 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
readyClickOperation = null;
|
readyClickOperation = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void settingsOverlayVisibilityChanged(ValueChangedEvent<Visibility> settingsOverlayVisibilityChangedEvent)
|
||||||
|
{
|
||||||
|
if (client.Room != null)
|
||||||
|
{
|
||||||
|
subScreenContainer.Show();
|
||||||
|
settingsOverlayVisibility.ValueChanged -= settingsOverlayVisibilityChanged;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (settingsOverlayVisibilityChangedEvent.NewValue == Visibility.Visible)
|
||||||
|
subScreenContainer.Hide();
|
||||||
|
else
|
||||||
|
subScreenContainer.Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
Loading…
Reference in New Issue
Block a user