diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs index 96a2ab7335..ab919d5952 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs @@ -209,9 +209,18 @@ namespace OpenRA.Mods.Common.Widgets.Logic { titleLabel.IsVisible = () => getMap().Map != MapCache.UnknownMap; var font = Game.Renderer.Fonts[titleLabel.Font]; - var title = new CachedTransform(m => WidgetUtils.TruncateText(m.Title, titleLabel.Bounds.Width, font)); + var title = new CachedTransform(m => + { + var truncated = WidgetUtils.TruncateText(m.Title, titleLabel.Bounds.Width, font); + + if (m.Title != truncated) + titleLabel.GetTooltipText = () => m.Title; + else + titleLabel.GetTooltipText = null; + + return truncated; + }); titleLabel.GetText = () => title.Update(getMap().Map); - titleLabel.GetTooltipText = () => getMap().Map.Title; } var typeLabel = parent.GetOrNull("MAP_TYPE"); diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs index e453d9053f..172fa5028d 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs @@ -61,9 +61,18 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (titleLabel != null) { var font = Game.Renderer.Fonts[titleLabel.Font]; - var title = new CachedTransform(m => WidgetUtils.TruncateText(m.Title, titleLabel.Bounds.Width, font)); + var title = new CachedTransform(m => + { + var truncated = WidgetUtils.TruncateText(m.Title, titleLabel.Bounds.Width, font); + + if (m.Title != truncated) + titleLabel.GetTooltipText = () => m.Title; + else + titleLabel.GetTooltipText = null; + + return truncated; + }); titleLabel.GetText = () => title.Update(preview); - titleLabel.GetTooltipText = () => preview.Title; } var typeLabel = panel.GetOrNull("MAP_TYPE");