diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/SupportPowerTooltipLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/SupportPowerTooltipLogic.cs index bb4d32e01c..fbcda205bc 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/SupportPowerTooltipLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/SupportPowerTooltipLogic.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class SupportPowerTooltipLogic : ChromeLogic { [ObjectCreator.UseCtor] - public SupportPowerTooltipLogic(Widget widget, TooltipContainerWidget tooltipContainer, Player player, SupportPowersWidget palette, World world) + public SupportPowerTooltipLogic(Widget widget, TooltipContainerWidget tooltipContainer, SupportPowersWidget palette, World world) { widget.IsVisible = () => palette.TooltipIcon != null && palette.TooltipIcon.Power.Info != null; var nameLabel = widget.Get("NAME"); @@ -32,7 +32,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic var descFont = Game.Renderer.Fonts[descLabel.Font]; var baseHeight = widget.Bounds.Height; var timeOffset = timeLabel.Bounds.X; - var pm = player.PlayerActor.Trait(); SupportPowerInstance lastPower = null; Hotkey lastHotkey = Hotkey.Invalid; @@ -87,7 +86,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic lastRemainingSeconds = remainingSeconds; }; - timeLabel.GetColor = () => pm.PowerState != PowerState.Normal ? Color.Red : Color.White; + timeLabel.GetColor = () => palette.TooltipIcon != null && !palette.TooltipIcon.Power.Active + ? Color.Red : Color.White; } } }