Truncate long server names in MP browser.

This commit is contained in:
Paul Chote
2015-11-07 17:42:19 +00:00
parent 19aa07d019
commit cfc92f66a4

View File

@@ -366,7 +366,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var title = item.GetOrNull<LabelWidget>("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;
}