diff --git a/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs index 687a8cfd08..9c9a98c1ef 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs @@ -198,7 +198,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic var mapTitle = widget.GetOrNull("SELECTED_MAP"); if (mapTitle != null) - mapTitle.GetText = () => currentMap != null ? currentMap.Title : "No Server Selected"; + { + var font = Game.Renderer.Fonts[mapTitle.Font]; + var title = new CachedTransform(m => m == null ? "No Server Selected" : + WidgetUtils.TruncateText(m.Title, mapTitle.Bounds.Width, font)); + mapTitle.GetText = () => title.Update(currentMap); + } var ip = widget.GetOrNull("SELECTED_IP"); if (ip != null) @@ -219,8 +224,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (modVersion != null) { modVersion.IsVisible = () => currentServer != null; - modVersion.GetText = () => currentServer.ModLabel; modVersion.GetColor = () => currentServer.IsCompatible ? modVersion.TextColor : incompatibleVersionColor; + + var font = Game.Renderer.Fonts[modVersion.Font]; + var version = new CachedTransform(s => WidgetUtils.TruncateText(s.ModLabel, mapTitle.Bounds.Width, font)); + modVersion.GetText = () => version.Update(currentServer); } var players = widget.GetOrNull("SELECTED_PLAYERS"); diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs index 1f81894f2f..46346f0c88 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs @@ -52,7 +52,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic }; panel.Get("MAP_PREVIEW").Preview = () => preview; - panel.Get("MAP_NAME").GetText = () => preview.Title; + + var mapTitle = panel.Get("MAP_NAME"); + if (mapTitle != null) + { + var font = Game.Renderer.Fonts[mapTitle.Font]; + var title = new CachedTransform(m => WidgetUtils.TruncateText(m.Title, mapTitle.Bounds.Width, font)); + mapTitle.GetText = () => title.Update(preview); + } } var serverName = panel.Get("SERVER_NAME");