diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs index 6953dbc75d..d10a55ea9f 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs @@ -10,6 +10,7 @@ using System.Drawing; using System.Linq; +using OpenRA.Mods.RA; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets.Logic @@ -60,8 +61,13 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic team.GetText = () => (pp.PlayerReference.Team == 0) ? "-" : pp.PlayerReference.Team.ToString(); scrollpanel.AddChild(item); - item.Get("KILLS").GetText = () => pp.Kills.ToString(); - item.Get("DEATHS").GetText = () => pp.Deaths.ToString(); + var stats = pp.PlayerActor.TraitOrDefault(); + if (stats == null) + break; + var totalKills = stats.UnitsKilled + stats.BuildingsKilled; + var totalDeaths = stats.UnitsDead + stats.BuildingsDead; + item.Get("KILLS").GetText = () => totalKills.ToString(); + item.Get("DEATHS").GetText = () => totalDeaths.ToString(); } } } diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index 751e5b4014..f110faa08f 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -34,6 +34,7 @@ Guard: Guardable: BodyOrientation: + UpdatesPlayerStatistics: ^Tank: AppearsOnRadar: @@ -74,6 +75,7 @@ Guard: Guardable: BodyOrientation: + UpdatesPlayerStatistics: ^Helicopter: AppearsOnRadar: @@ -100,6 +102,7 @@ EmptyWeapon: HeliExplode DebugMuzzlePositions: BodyOrientation: + UpdatesPlayerStatistics: ^Infantry: AppearsOnRadar: @@ -156,6 +159,7 @@ HealIfBelow: 1 DamageCooldown: 125 RequiresTech: InfantryHealing + UpdatesPlayerStatistics: ^CivInfantry: Inherits: ^Infantry @@ -232,6 +236,7 @@ ScanRadius: 4 AttackMove: AttackFrontal: + UpdatesPlayerStatistics: ^Plane: AppearsOnRadar: @@ -270,6 +275,7 @@ Guard: Guardable: BodyOrientation: + UpdatesPlayerStatistics: ^Building: AppearsOnRadar: @@ -318,6 +324,7 @@ Range: 3 BodyOrientation: FrozenUnderFog: + UpdatesPlayerStatistics: ^CivBuilding: Inherits: ^Building diff --git a/mods/cnc/rules/system.yaml b/mods/cnc/rules/system.yaml index 1f1d4c1268..99c425c102 100644 --- a/mods/cnc/rules/system.yaml +++ b/mods/cnc/rules/system.yaml @@ -202,6 +202,7 @@ Player: RemapIndex: 176, 178, 180, 182, 184, 186, 189, 191, 177, 179, 181, 183, 185, 187, 188, 190 BaseAttackNotifier: Shroud: + PlayerStatistics: World: LoadWidgetAtGameStart: