diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs index 821b28fc95..90962f3d5c 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs @@ -71,9 +71,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic preview.SpawnOccupants = () => selectedSpawns; preview.Preview = () => selectedReplay != null ? selectedReplay.GameInfo.MapPreview : null; - var title = panel.GetOrNull("MAP_TITLE"); - if (title != null) - title.GetText = () => selectedReplay != null ? selectedReplay.GameInfo.MapPreview.Title : null; + var titleLabel = panel.GetOrNull("MAP_TITLE"); + if (titleLabel != null) + { + titleLabel.IsVisible = () => selectedReplay != null; + + var font = Game.Renderer.Fonts[titleLabel.Font]; + var title = new CachedTransform(m => WidgetUtils.TruncateText(m.Title, titleLabel.Bounds.Width, font)); + titleLabel.GetText = () => title.Update(selectedReplay.GameInfo.MapPreview); + } var type = panel.GetOrNull("MAP_TYPE"); if (type != null)