From cfc92f66a49e02902505bd1b1e8c3dfb6d712cca Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 7 Nov 2015 17:42:19 +0000 Subject: [PATCH] Truncate long server names in MP browser. --- OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs index 9c9a98c1ef..0e85b65068 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs @@ -366,7 +366,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic var title = item.GetOrNull("TITLE"); if (title != null) { - title.GetText = () => game.Name; + var font = Game.Renderer.Fonts[title.Font]; + var label = WidgetUtils.TruncateText(game.Name, title.Bounds.Width, font); + title.GetText = () => label; title.GetColor = () => canJoin ? title.TextColor : incompatibleGameColor; }