diff --git a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs index ce3ea47631..10578444de 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs @@ -25,7 +25,6 @@ namespace OpenRA.Mods.Common.Traits World world; Player player; - public double MapControl; public int OrderCount; public int EarnedThisMinute @@ -54,18 +53,6 @@ namespace OpenRA.Mods.Common.Traits player = self.Owner; } - void UpdateMapControl() - { - var total = (double)world.Map.Bounds.Width * world.Map.Bounds.Height; - MapControl = world.Actors - .Where(a => !a.IsDead && a.IsInWorld && a.Owner == player && a.HasTrait()) - .SelectMany(a => world.Map.FindTilesInCircle( - a.Location, - a.Trait().Range.Clamp(WRange.Zero, WRange.FromCells(Map.MaxTilesInCircleRange)).Range / 1024)) - .Distinct() - .Count() / total; - } - void UpdateEarnedThisMinute() { EarnedSamples.Enqueue(EarnedThisMinute); @@ -76,10 +63,8 @@ namespace OpenRA.Mods.Common.Traits public void Tick(Actor self) { - if (self.World.WorldTick % 1500 == 1) + if (world.WorldTick % 1500 == 1) UpdateEarnedThisMinute(); - if (self.World.WorldTick % 250 == 0) - UpdateMapControl(); } public void ResolveOrder(Actor self, Order order) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs index a595c79514..708855fd99 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs @@ -199,7 +199,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic var stats = player.PlayerActor.TraitOrDefault(); if (stats == null) return template; - template.Get("CONTROL").GetText = () => MapControl(stats.MapControl); template.Get("KILLS_COST").GetText = () => "$" + stats.KillsCost; template.Get("DEATHS_COST").GetText = () => "$" + stats.DeathsCost; template.Get("UNITS_KILLED").GetText = () => stats.UnitsKilled.ToString(); diff --git a/mods/cnc/chrome/ingame-observerstats.yaml b/mods/cnc/chrome/ingame-observerstats.yaml index 8a0701160b..6e2e346089 100644 --- a/mods/cnc/chrome/ingame-observerstats.yaml +++ b/mods/cnc/chrome/ingame-observerstats.yaml @@ -193,29 +193,22 @@ Background@INGAME_OBSERVERSTATS_BG: Height: 25 Font: Bold Text: Player - Label@CONTROL_HEADER: - X: 235 - Y: 40 - Width: 60 - Height: 25 - Font: Bold - Text: Control Label@KILLS_COST_HEADER: - X: 315 + X: 235 Y: 40 Width: 60 Height: 25 Font: Bold Text: Kills Label@DEATHS_COST_HEADER: - X: 395 + X: 315 Y: 40 Width: 60 Height: 25 Font: Bold Text: Deaths Label@UNITS_KILLED_HEADER: - X: 495 + X: 415 Y: 40 Width: 40 Height: 25 @@ -223,7 +216,7 @@ Background@INGAME_OBSERVERSTATS_BG: Text: Units Killed Align: Right Label@UNITS_DEAD_HEADER: - X: 595 + X: 515 Y: 40 Width: 40 Height: 25 @@ -231,7 +224,7 @@ Background@INGAME_OBSERVERSTATS_BG: Text: Units Lost Align: Right Label@BUILDINGS_KILLED_HEADER: - X: 715 + X: 635 Y: 40 Width: 40 Height: 25 @@ -239,7 +232,7 @@ Background@INGAME_OBSERVERSTATS_BG: Text: Bldg Killed Align: Right Label@BUILDINGS_DEAD_HEADER: - X: 815 + X: 735 Y: 40 Width: 40 Height: 25 @@ -440,41 +433,36 @@ Background@INGAME_OBSERVERSTATS_BG: Width: 160 Height: PARENT_BOTTOM Font: Bold - Label@CONTROL: + Label@KILLS_COST: X: 215 Y: 0 Width: 60 Height: PARENT_BOTTOM - Label@KILLS_COST: + Label@DEATHS_COST: X: 295 Y: 0 Width: 60 Height: PARENT_BOTTOM - Label@DEATHS_COST: - X: 375 - Y: 0 - Width: 60 - Height: PARENT_BOTTOM Label@UNITS_KILLED: - X: 475 + X: 395 Y: 0 Width: 40 Height: PARENT_BOTTOM Align: Right Label@UNITS_DEAD: - X: 575 + X: 495 Y: 0 Width: 40 Height: PARENT_BOTTOM Align: Right Label@BUILDINGS_KILLED: - X: 695 + X: 615 Y: 0 Width: 40 Height: PARENT_BOTTOM Align: Right Label@BUILDINGS_DEAD: - X: 795 + X: 715 Y: 0 Width: 40 Height: PARENT_BOTTOM diff --git a/mods/ra/chrome/ingame-observerstats.yaml b/mods/ra/chrome/ingame-observerstats.yaml index 8973b353c8..14dd5c30d7 100644 --- a/mods/ra/chrome/ingame-observerstats.yaml +++ b/mods/ra/chrome/ingame-observerstats.yaml @@ -193,29 +193,22 @@ Background@INGAME_OBSERVERSTATS_BG: Height: 25 Font: Bold Text: Player - Label@CONTROL_HEADER: - X: 245 - Y: 40 - Width: 60 - Height: 25 - Font: Bold - Text: Control Label@KILLS_COST_HEADER: - X: 325 + X: 245 Y: 40 Width: 60 Height: 25 Font: Bold Text: Kills Label@DEATHS_COST_HEADER: - X: 405 + X: 325 Y: 40 Width: 60 Height: 25 Font: Bold Text: Deaths Label@UNITS_KILLED_HEADER: - X: 505 + X: 425 Y: 40 Width: 40 Height: 25 @@ -223,7 +216,7 @@ Background@INGAME_OBSERVERSTATS_BG: Text: Units Killed Align: Right Label@UNITS_DEAD_HEADER: - X: 605 + X: 525 Y: 40 Width: 40 Height: 25 @@ -231,7 +224,7 @@ Background@INGAME_OBSERVERSTATS_BG: Text: Units Lost Align: Right Label@BUILDINGS_KILLED_HEADER: - X: 725 + X: 645 Y: 40 Width: 40 Height: 25 @@ -239,7 +232,7 @@ Background@INGAME_OBSERVERSTATS_BG: Text: Bldg Killed Align: Right Label@BUILDINGS_DEAD_HEADER: - X: 825 + X: 745 Y: 40 Width: 40 Height: 25 @@ -440,41 +433,36 @@ Background@INGAME_OBSERVERSTATS_BG: Width: 160 Height: PARENT_BOTTOM Font: Bold - Label@CONTROL: + Label@KILLS_COST: X: 215 Y: 0 Width: 60 Height: PARENT_BOTTOM - Label@KILLS_COST: + Label@DEATHS_COST: X: 295 Y: 0 Width: 60 Height: PARENT_BOTTOM - Label@DEATHS_COST: - X: 375 - Y: 0 - Width: 60 - Height: PARENT_BOTTOM Label@UNITS_KILLED: - X: 475 + X: 395 Y: 0 Width: 40 Height: PARENT_BOTTOM Align: Right Label@UNITS_DEAD: - X: 575 + X: 495 Y: 0 Width: 40 Height: PARENT_BOTTOM Align: Right Label@BUILDINGS_KILLED: - X: 695 + X: 615 Y: 0 Width: 40 Height: PARENT_BOTTOM Align: Right Label@BUILDINGS_DEAD: - X: 795 + X: 715 Y: 0 Width: 40 Height: PARENT_BOTTOM