Added carryalls to spectator Economy statistics

This commit is contained in:
Gustas
2022-12-19 13:32:41 +02:00
committed by Matthias Mailänder
parent f3e44094a1
commit 55cf40ec52
2 changed files with 21 additions and 2 deletions

View File

@@ -448,6 +448,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var harvesters = template.Get<LabelWidget>("HARVESTERS");
harvesters.GetText = () => world.ActorsWithTrait<Harvester>().Count(a => a.Actor.Owner == player && !a.Actor.IsDead && !a.Trait.IsTraitDisabled).ToString();
var carryalls = template.GetOrNull<LabelWidget>("CARRYALLS");
if (carryalls != null)
carryalls.GetText = () => world.ActorsWithTrait<AutoCarryall>().Count(a => a.Actor.Owner == player && !a.Actor.IsDead).ToString();
var derricks = template.GetOrNull<LabelWidget>("DERRICKS");
if (derricks != null)
derricks.GetText = () => world.ActorsHavingTrait<UpdatesDerrickCount>().Count(a => a.Owner == player && !a.IsDead).ToString();