From 356f24b78c75ae70706e457654a61a453c63d08f Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Thu, 15 Mar 2018 12:54:29 +0300 Subject: [PATCH] Add logic to disallowing On Hold on a queue. --- OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs | 3 +++ OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs index 8dc98cd7fa..632b7a7b57 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs @@ -35,6 +35,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Should the prerequisite remain enabled if the owner changes?")] public readonly bool Sticky = true; + [Desc("Should right clicking on the icon instantly cancel the production instead of putting it on hold?")] + public readonly bool DisallowPaused = false; + [Desc("This percentage value is multiplied with actor cost to translate into build time (lower means faster).")] public readonly int BuildDurationModifier = 100; diff --git a/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs b/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs index f20e6cd620..fee056c682 100644 --- a/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs @@ -294,9 +294,9 @@ namespace OpenRA.Mods.Common.Widgets Game.Sound.Play(SoundType.UI, TabClick); - if (item.Paused || item.Done || item.TotalCost == item.RemainingCost) + if (CurrentQueue.Info.DisallowPaused || item.Paused || item.Done || item.TotalCost == item.RemainingCost) { - // Instant cancel of things we have not started yet and things that are finished + // Instantly cancel items that haven't started, have finished, or if the queue doesn't support pausing Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Faction.InternalName); World.IssueOrder(Order.CancelProduction(CurrentQueue.Actor, icon.Name, handleCount)); }