Fix several NREs during setup of client tooltips in GameInfoStatsLogic
This commit is contained in:
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var pp = p;
|
var pp = p;
|
||||||
var client = world.LobbyInfo.ClientWithIndex(pp.ClientIndex);
|
var client = world.LobbyInfo.ClientWithIndex(pp.ClientIndex);
|
||||||
var item = playerTemplate.Clone();
|
var item = playerTemplate.Clone();
|
||||||
LobbyUtils.SetupClientWidget(item, client, orderManager, client.Bot == null);
|
LobbyUtils.SetupClientWidget(item, client, orderManager, client != null && client.Bot == null);
|
||||||
var nameLabel = item.Get<LabelWidget>("NAME");
|
var nameLabel = item.Get<LabelWidget>("NAME");
|
||||||
var nameFont = Game.Renderer.Fonts[nameLabel.Font];
|
var nameFont = Game.Renderer.Fonts[nameLabel.Font];
|
||||||
|
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var adminIndicator = parent.GetOrNull("ADMIN_INDICATOR");
|
var adminIndicator = parent.GetOrNull("ADMIN_INDICATOR");
|
||||||
if (adminIndicator != null)
|
if (adminIndicator != null)
|
||||||
adminIndicator.IsVisible = () => c.IsAdmin;
|
adminIndicator.IsVisible = () => c != null && c.IsAdmin;
|
||||||
|
|
||||||
var block = parent.GetOrNull("LATENCY");
|
var block = parent.GetOrNull("LATENCY");
|
||||||
if (block != null)
|
if (block != null)
|
||||||
@@ -253,8 +253,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
|
|
||||||
var tooltip = parent.Get<ClientTooltipRegionWidget>("CLIENT_REGION");
|
var tooltip = parent.Get<ClientTooltipRegionWidget>("CLIENT_REGION");
|
||||||
tooltip.IsVisible = () => visible;
|
tooltip.IsVisible = () => c != null && visible;
|
||||||
tooltip.Bind(orderManager, c.Index);
|
if (c != null)
|
||||||
|
tooltip.Bind(orderManager, c.Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetupEditableNameWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager)
|
public static void SetupEditableNameWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager)
|
||||||
|
|||||||
Reference in New Issue
Block a user