From 224bda6de51f608e186f6921a220793abe1fc35e Mon Sep 17 00:00:00 2001 From: rob-v Date: Sat, 13 May 2017 22:41:09 +0200 Subject: [PATCH] Fix Player slot when changing map --- .../Widgets/Logic/Lobby/LobbyUtils.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index 48427d8d45..3132abd418 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -294,6 +294,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic name.YieldKeyboardFocus(); return true; }; + + HideChildWidget(parent, "SLOT_OPTIONS"); } public static void SetupNameWidget(Widget parent, Session.Slot s, Session.Client c) @@ -455,13 +457,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic HideChildWidget(parent, "SPAWN"); } - static void HideChildWidget(Widget parent, string widgetId) - { - var widget = parent.GetOrNull(widgetId); - if (widget != null) - widget.IsVisible = () => false; - } - public static void SetupSpawnWidget(Widget parent, Session.Slot s, Session.Client c) { parent.Get("SPAWN").GetText = () => (c.SpawnPoint == 0) ? "-" : Convert.ToChar('A' - 1 + c.SpawnPoint).ToString(); @@ -558,5 +553,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic template.Bounds.Height += dh; } } + + static void HideChildWidget(Widget parent, string widgetId) + { + var widget = parent.GetOrNull(widgetId); + if (widget != null) + widget.IsVisible = () => false; + } } }