Fix Player slot when changing map

This commit is contained in:
rob-v
2017-05-13 22:41:09 +02:00
committed by reaperrr
parent d8edcb1bad
commit 224bda6de5

View File

@@ -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<LabelWidget>("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;
}
}
}