diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs index 649dd4ee0f..6f6a7b52de 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs @@ -111,17 +111,16 @@ namespace OpenRA.Mods.Common.Widgets.Logic Widget SetupAuthorAndMapType(Widget parent) { var typeLabel = parent.Get("MAP_TYPE"); - var typeCache = new CachedTransform( - m => m.Categories.FirstOrDefault() ?? ""); + var typeCache = new CachedTransform(c => c.FirstOrDefault() ?? ""); - typeLabel.GetText = () => typeCache.Update(getMap().Map); + typeLabel.GetText = () => typeCache.Update(getMap().Map.Categories); var authorLabel = parent.Get("MAP_AUTHOR"); var font = Game.Renderer.Fonts[authorLabel.Font]; - var truncateCache = new CachedTransform( - m => WidgetUtils.TruncateText(authorCache.Update(m.Author), authorLabel.Bounds.Width, font)); + var truncateCache = new CachedTransform(author => + WidgetUtils.TruncateText(authorCache.Update(author), authorLabel.Bounds.Width, font)); - authorLabel.GetText = () => truncateCache.Update(getMap().Map); + authorLabel.GetText = () => truncateCache.Update(getMap().Map.Author); return parent; } diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs index e76d477c50..736a4b2166 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs @@ -335,12 +335,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (mapTitle != null) { var font = Game.Renderer.Fonts[mapTitle.Font]; - var title = new CachedTransform(m => + var title = new CachedTransform(t => { - var truncated = WidgetUtils.TruncateText(m.Title, mapTitle.Bounds.Width, font); + var truncated = WidgetUtils.TruncateText(t, mapTitle.Bounds.Width, font); - if (m.Title != truncated) - mapTitle.GetTooltipText = () => m.Title; + if (t != truncated) + mapTitle.GetTooltipText = () => t; else mapTitle.GetTooltipText = null; @@ -358,7 +358,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (currentMap.Class == MapClassification.Unknown) return mapClassificationUnknown; - return title.Update(currentMap); + return title.Update(currentMap.Title); }; }