From 3eefcc69f87282fe1d9aba588f34c6e52a75cebd Mon Sep 17 00:00:00 2001 From: Pavlos Touboulidis Date: Sat, 10 May 2014 23:44:00 +0300 Subject: [PATCH] Use proper map rules in ProductionTooltipLogic.cs --- OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs index 6caca43c44..2af35f7f33 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs @@ -21,8 +21,9 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic public class ProductionTooltipLogic { [ObjectCreator.UseCtor] - public ProductionTooltipLogic(Widget widget, Ruleset rules, TooltipContainerWidget tooltipContainer, ProductionPaletteWidget palette) + public ProductionTooltipLogic(Widget widget, TooltipContainerWidget tooltipContainer, ProductionPaletteWidget palette) { + var mapRules = palette.World.Map.Rules; var pm = palette.World.LocalPlayer.PlayerActor.Trait(); var pr = palette.World.LocalPlayer.PlayerActor.Trait(); @@ -45,7 +46,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic if (actor == null || actor == lastActor) return; - var info = rules.Actors[actor]; + var info = mapRules.Actors[actor]; var tooltip = info.Traits.Get(); var buildable = info.Traits.Get(); var cost = info.Traits.Get().Cost; @@ -53,7 +54,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic nameLabel.GetText = () => tooltip.Name; - var prereqs = buildable.Prerequisites.Select(a => ActorName(rules, a)); + var prereqs = buildable.Prerequisites.Select(a => ActorName(mapRules, a)); var requiresString = prereqs.Any() ? requiresLabel.Text.F(prereqs.JoinWith(", ")) : ""; requiresLabel.GetText = () => requiresString;