diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index cbc18d7b2d..474a7ccd25 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -576,7 +576,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (template == null || template.Id != editablePlayerTemplate.Id) template = editablePlayerTemplate.Clone(); - LobbyUtils.SetupLatencyWidget(template, client, orderManager, client.Bot == null); + LobbyUtils.SetupLatencyWidget(template, client, orderManager); if (client.Bot != null) LobbyUtils.SetupEditableSlotWidget(template, slot, client, orderManager, worldRenderer, map); @@ -595,7 +595,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (template == null || template.Id != nonEditablePlayerTemplate.Id) template = nonEditablePlayerTemplate.Clone(); - LobbyUtils.SetupLatencyWidget(template, client, orderManager, client.Bot == null); + LobbyUtils.SetupLatencyWidget(template, client, orderManager); LobbyUtils.SetupColorWidget(template, slot, client); LobbyUtils.SetupFactionWidget(template, slot, client, factions); @@ -667,7 +667,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic LobbyUtils.HideReadyWidgets(template); } - LobbyUtils.SetupLatencyWidget(template, c, orderManager, true); + LobbyUtils.SetupLatencyWidget(template, c, orderManager); template.IsVisible = () => true; if (idx >= players.Children.Count) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index 5878702b5a..fa79155134 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -296,8 +296,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic return "Poor"; } - public static void SetupLatencyWidget(Widget parent, Session.Client c, OrderManager orderManager, bool visible) + public static void SetupLatencyWidget(Widget parent, Session.Client c, OrderManager orderManager) { + var visible = c != null && c.Bot == null; var block = parent.GetOrNull("LATENCY"); if (block != null) { @@ -309,8 +310,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic } var tooltip = parent.Get("LATENCY_REGION"); - tooltip.IsVisible = () => c != null && visible; - if (c != null) + tooltip.IsVisible = () => visible; + if (visible) tooltip.Bind(orderManager, null, c); }