Refactored ProductionQueue to support different production styles.

This commit is contained in:
Andre Mohren
2018-09-28 22:54:18 +02:00
committed by abcdefg30
parent 6cd1919cca
commit 3bfcecd539
13 changed files with 98 additions and 82 deletions

View File

@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits.Render
void ITick.Tick(Actor self)
{
var current = queue.CurrentItem();
var current = queue.AllQueued().Where(i => i.Started).OrderBy(i => i.RemainingTime).FirstOrDefault();
value = current != null ? 1 - (float)current.RemainingCost / current.TotalCost : 0;
}

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits.Render
bool IsProducing
{
get { return queues != null && queues.Any(q => q.Enabled && q.CurrentItem() != null && !q.CurrentPaused); }
get { return queues != null && queues.Any(q => q.Enabled && q.AllQueued().Any(i => !i.Paused && i.Started)); }
}
public WithProductionOverlay(Actor self, WithProductionOverlayInfo info)