diff --git a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs index 2790a3ed21..ebdee86429 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs @@ -63,6 +63,11 @@ namespace OpenRA.Mods.Common.Traits public readonly string CancelledAudio = "Cancelled"; public virtual object Create(ActorInitializer init) { return new ProductionQueue(init, init.Self.Owner.PlayerActor, this); } + + public void RulesetLoaded(Ruleset rules, ActorInfo ai) { + if (LowPowerSlowdown <= 0) + throw new YamlException("Production queue must have LowPowerSlowdown of at least 1."); + } } public class ProductionQueue : IResolveOrder, ITick, ITechTreeElement, INotifyOwnerChanged, INotifyKilled, INotifySold, ISync, INotifyTransform, INotifyCreated diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ProductionTooltipLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ProductionTooltipLogic.cs index fd0735d192..239cc31cce 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ProductionTooltipLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ProductionTooltipLogic.cs @@ -103,7 +103,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var timeMultiplier = pm.PowerState != PowerState.Normal ? tooltipIcon.ProductionQueue.Info.LowPowerSlowdown : 1; timeLabel.Text = formatBuildTime.Update(buildTime * timeMultiplier); - timeLabel.TextColor = pm.PowerState != PowerState.Normal ? Color.Red : Color.White; + timeLabel.TextColor = (pm.PowerState != PowerState.Normal && tooltipIcon.ProductionQueue.Info.LowPowerSlowdown > 1) ? Color.Red : Color.White; var timeSize = font.Measure(timeLabel.Text); costLabel.Text = cost.ToString(); @@ -143,4 +143,4 @@ namespace OpenRA.Mods.Common.Widgets.Logic return a; } } -} \ No newline at end of file +} diff --git a/mods/d2k/rules/player.yaml b/mods/d2k/rules/player.yaml index 447f24535c..a20390a054 100644 --- a/mods/d2k/rules/player.yaml +++ b/mods/d2k/rules/player.yaml @@ -32,7 +32,7 @@ Player: ClassicProductionQueue@Starport: Type: Starport BuildDurationModifier: 212 - LowPowerSlowdown: 0 + LowPowerSlowdown: 1 BlockedAudio: NoRoom QueuedAudio: OrderPlaced ReadyAudio: @@ -46,7 +46,7 @@ Player: ClassicProductionQueue@Upgrade: # Upgrade is defined after others so it won't be automatically selected by ProductionQueueFromSelection. Type: Upgrade BuildDurationModifier: 250 - LowPowerSlowdown: 0 + LowPowerSlowdown: 1 QueuedAudio: Upgrading ReadyAudio: NewOptions BlockedAudio: NoRoom