Fix production tooltip display.

This commit is contained in:
Paul Chote
2014-06-14 19:54:00 +12:00
parent a5cc68efee
commit d4227fa13e
2 changed files with 3 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
nameLabel.GetText = () => tooltip.Name; 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(", ")) : ""; var requiresString = prereqs.Any() ? requiresLabel.Text.F(prereqs.JoinWith(", ")) : "";
requiresLabel.GetText = () => requiresString; requiresLabel.GetText = () => requiresString;

View File

@@ -504,10 +504,10 @@ namespace OpenRA.Mods.RA.Widgets
p += new int2(5, 35); p += new int2(5, 35);
if (!canBuildThis) 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()) 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); p += new int2(0, 8);
} }