Allow player to add a "priority unit" to production queue

* If production is ordered by `Ctrl + Left Click` the item is added to the top of the stack after the currently produced item
* Works with `Shift` for priority queueing of 5 items
* This modifier is not taken into account for `ParallelProductionQueue` as it doesn't make sense in that context
This commit is contained in:
Ivaylo Draganov
2018-11-03 17:51:19 +02:00
committed by abcdefg30
parent 81d53a4f1a
commit a7279415dc
4 changed files with 18 additions and 8 deletions

View File

@@ -50,6 +50,12 @@ namespace OpenRA.Mods.Common.Traits
return Queue.Contains(item);
}
protected override void BeginProduction(ProductionItem item, bool hasPriority)
{
// Ignore `hasPriority` as it's not relevant in parallel production context.
Queue.Add(item);
}
public override int RemainingTimeActual(ProductionItem item)
{
var parallelBuilds = Queue.FindAll(i => !i.Paused && !i.Done)