Add logic to disallowing On Hold on a queue.

This commit is contained in:
Mustafa Alperen Seki
2018-03-15 12:54:29 +03:00
committed by reaperrr
parent f2e270ce06
commit 356f24b78c
2 changed files with 5 additions and 2 deletions

View File

@@ -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;

View File

@@ -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));
}