diff --git a/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs index 392f9b0b18..f7eb4f9851 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs @@ -20,15 +20,17 @@ namespace OpenRA.Mods.RA.Widgets.Logic { public class ObserverStatsLogic { + ContainerWidget basicStats; ScrollPanelWidget playersPanel; - ScrollItemWidget playerTemplate; + ScrollItemWidget basicPlayerTemplate; ScrollItemWidget teamTemplate; [ObjectCreator.UseCtor] public ObserverStatsLogic(World world, Widget widget) { - playersPanel = widget.Get("PLAYERS"); - playerTemplate = playersPanel.Get("PLAYER_TEMPLATE"); + basicStats = widget.Get("BASIC_STATS"); + playersPanel = widget.Get("PLAYERS_PANEL"); + basicPlayerTemplate = playersPanel.Get("BASIC_PLAYER_TEMPLATE"); teamTemplate = playersPanel.Get("TEAM_TEMPLATE"); playersPanel.RemoveChildren(); playersPanel.Layout = new GridLayout(playersPanel); @@ -36,7 +38,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic var players = world.Players.Where(p => !p.NonCombatant); widget.Height = (200 + (Math.Min(8, players.Count()) * 25)).ToString(); - Initialize(widget, widget.Get("BACKGROUND"), widget.Get("PLAYERS")); + Initialize(widget, widget.Get("BACKGROUND"), widget.Get("PLAYERS_PANEL")); var teams = players.GroupBy(p => (world.LobbyInfo.ClientWithIndex(p.ClientIndex) ?? new Session.Client()).Team).OrderBy(g => g.Key); foreach (var t in teams) @@ -49,7 +51,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic foreach (var p in team) { var player = p; - var template = ScrollItemWidget.Setup(playerTemplate, () => false, () => + var template = ScrollItemWidget.Setup(basicPlayerTemplate, () => false, () => { var playerBase = world.Actors.FirstOrDefault(a => !a.IsDead() && a.HasTrait() && a.Owner == player); if (playerBase != null) diff --git a/mods/ra/chrome/ingame.yaml b/mods/ra/chrome/ingame.yaml index 7f18d17eaf..66879f0c9d 100644 --- a/mods/ra/chrome/ingame.yaml +++ b/mods/ra/chrome/ingame.yaml @@ -412,59 +412,65 @@ Container@OBSERVER_ROOT: Font:Bold Align:Center Text:Players - Label@PLAYER_HEADER: - X:85 - Y:40 - Width:160 - Height:25 - Font:Bold - Text:Player - Label@CASH_HEADER: - X:245 - Y:40 - Width:80 - Height:25 - Font:Bold - Text:Cash - Label@INCOME_HEADER: - X:325 - Y:40 - Width:160 - Height:25 - Font:Bold - Text:Income - Label@POWER_HEADER - X:445 - Y:40 - Width:80 - Height:25 - Font:Bold - Text:Power - Label@KILLS_HEADER: - X:525 - Y:40 - Width:40 - Height:25 - Font:Bold - Text:Kills - Align:Right - Label@DEATHS_HEADER: - X:585 - Y:40 - Width:40 - Height:25 - Font:Bold - Text:Deaths - Align:Right - Label@PRODUCTION_HEADER - X:625 - Y:40 - Width:PARENT_RIGHT-625 - Height:25 - Font:Bold - Text:Production - Align:Center - ScrollPanel@PLAYERS: + Container@BASIC_STATS: + X:0 + Y:0 + Width:PARENT_RIGHT + Height:PARENT_BOTTOM + Children: + Label@PLAYER_HEADER: + X:85 + Y:40 + Width:160 + Height:25 + Font:Bold + Text:Player + Label@CASH_HEADER: + X:245 + Y:40 + Width:80 + Height:25 + Font:Bold + Text:Cash + Label@INCOME_HEADER: + X:325 + Y:40 + Width:160 + Height:25 + Font:Bold + Text:Income + Label@POWER_HEADER + X:445 + Y:40 + Width:80 + Height:25 + Font:Bold + Text:Power + Label@KILLS_HEADER: + X:525 + Y:40 + Width:40 + Height:25 + Font:Bold + Text:Kills + Align:Right + Label@DEATHS_HEADER: + X:585 + Y:40 + Width:40 + Height:25 + Font:Bold + Text:Deaths + Align:Right + Label@PRODUCTION_HEADER + X:625 + Y:40 + Width:PARENT_RIGHT-625 + Height:25 + Font:Bold + Text:Production + Align:Center + ScrollPanel@PLAYERS_PANEL: X:25 Y:70 Width:PARENT_RIGHT-50 @@ -483,7 +489,7 @@ Container@OBSERVER_ROOT: Width:PARENT_RIGHT Height:PARENT_BOTTOM Font:Bold - ScrollItem@PLAYER_TEMPLATE: + ScrollItem@BASIC_PLAYER_TEMPLATE: X:0 Y:0 Width:PARENT_RIGHT-35