From f63d0272a71239917327962e7e8bef76e4e1c1ea Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 23 Feb 2019 15:21:03 +0000 Subject: [PATCH] Fix map title not updating after remote query completes. --- .../Widgets/Logic/ServerListLogic.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs index dfb75fff35..672151d006 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs @@ -235,9 +235,22 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (mapTitle != null) { var font = Game.Renderer.Fonts[mapTitle.Font]; - var title = new CachedTransform(m => m == null ? "No Server Selected" : + var title = new CachedTransform(m => WidgetUtils.TruncateText(m.Title, mapTitle.Bounds.Width, font)); - mapTitle.GetText = () => title.Update(currentMap); + + mapTitle.GetText = () => + { + if (currentMap == null) + return "No Server Selected"; + + if (currentMap.Status == MapStatus.Searching) + return "Searching..."; + + if (currentMap.Class == MapClassification.Unknown) + return "Unknown Map"; + + return title.Update(currentMap); + }; } var ip = widget.GetOrNull("SELECTED_IP");