From d4227fa13e471ca003164a540178df0ba7b0211b Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 14 Jun 2014 19:54:00 +1200 Subject: [PATCH] Fix production tooltip display. --- OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs | 2 +- OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs index 925c90bb76..5866e6a71b 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs @@ -54,7 +54,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic nameLabel.GetText = () => tooltip.Name; - var prereqs = buildable.Prerequisites.Select(a => ActorName(mapRules, a)); + var prereqs = buildable.Prerequisites.Select(a => ActorName(mapRules, a)).Where(s => !s.StartsWith("~")); var requiresString = prereqs.Any() ? requiresLabel.Text.F(prereqs.JoinWith(", ")) : ""; requiresLabel.GetText = () => requiresString; diff --git a/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs b/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs index 8e61264fee..2460e9cb3a 100644 --- a/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs +++ b/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs @@ -504,10 +504,10 @@ namespace OpenRA.Mods.RA.Widgets p += new int2(5, 35); if (!canBuildThis) { - var prereqs = buildable.Prerequisites.Select(s => Description(world.Map.Rules, s)); + var prereqs = buildable.Prerequisites.Select(s => Description(world.Map.Rules, s)).Where(s => !s.StartsWith("~")); if (prereqs.Any()) { - Game.Renderer.Fonts["Regular"].DrawText(RequiresText.F(prereqs.Where(s => !s.StartsWith("~")).JoinWith(", ")), p.ToInt2(), Color.White); + Game.Renderer.Fonts["Regular"].DrawText(RequiresText.F(prereqs.JoinWith(", ")), p.ToInt2(), Color.White); p += new int2(0, 8); }