From c6740b1bcba07253e4a186f4f0ff2741a7f70f2c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 4 Oct 2015 17:26:38 +0100 Subject: [PATCH] Inherit lobby bin size from the root. --- .../Widgets/Logic/Lobby/LobbyLogic.cs | 6 ++-- .../Widgets/Logic/Lobby/LobbyUtils.cs | 4 +-- mods/cnc/chrome/lobby-kickdialogs.yaml | 26 ++++------------- mods/cnc/chrome/lobby-options.yaml | 7 ++--- mods/cnc/chrome/lobby-players.yaml | 12 ++++---- mods/cnc/chrome/lobby.yaml | 6 +++- mods/d2k/chrome/lobby-options.yaml | 6 ++-- mods/d2k/chrome/lobby-players.yaml | 12 ++++---- mods/ra/chrome/lobby-kickdialogs.yaml | 28 ++++--------------- mods/ra/chrome/lobby-options.yaml | 6 ++-- mods/ra/chrome/lobby-players.yaml | 12 ++++---- mods/ra/chrome/lobby.yaml | 6 +++- 12 files changed, 51 insertions(+), 80 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index f7688f7c81..c7e4930079 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -129,7 +129,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic UpdateCurrentMap(); - var playerBin = Ui.LoadWidget("LOBBY_PLAYER_BIN", lobby.Get("PLAYER_BIN_ROOT"), new WidgetArgs()); + var playerBin = Ui.LoadWidget("LOBBY_PLAYER_BIN", lobby.Get("TOP_PANELS_ROOT"), new WidgetArgs()); playerBin.IsVisible = () => panel == PanelType.Players; players = playerBin.Get("LOBBY_PLAYERS"); @@ -273,7 +273,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic }; } - var optionsBin = Ui.LoadWidget("LOBBY_OPTIONS_BIN", lobby, new WidgetArgs()); + var optionsBin = Ui.LoadWidget("LOBBY_OPTIONS_BIN", lobby.Get("TOP_PANELS_ROOT"), new WidgetArgs()); optionsBin.IsVisible = () => panel == PanelType.Options; var optionsButton = lobby.Get("OPTIONS_BUTTON"); @@ -303,7 +303,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic }; } - var forceStartBin = Ui.LoadWidget("FORCE_START_DIALOG", lobby, new WidgetArgs()); + var forceStartBin = Ui.LoadWidget("FORCE_START_DIALOG", lobby.Get("TOP_PANELS_ROOT"), new WidgetArgs()); forceStartBin.IsVisible = () => panel == PanelType.ForceStart; forceStartBin.Get("KICK_WARNING").IsVisible = () => orderManager.LobbyInfo.Clients.Any(c => c.IsInvalid); forceStartBin.Get("OK_BUTTON").OnClick = startGame; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index d39933f368..4d796f5fa3 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -330,7 +330,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { before(); - Game.LoadWidget(null, "KICK_CLIENT_DIALOG", lobby, new WidgetArgs + Game.LoadWidget(null, "KICK_CLIENT_DIALOG", lobby.Get("TOP_PANELS_ROOT"), new WidgetArgs { { "clientName", c.Name }, { "okPressed", okPressed }, @@ -364,7 +364,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var spectatorCount = orderManager.LobbyInfo.Clients.Count(c => c.IsObserver); if (spectatorCount > 0) { - Game.LoadWidget(null, "KICK_SPECTATORS_DIALOG", lobby, new WidgetArgs + Game.LoadWidget(null, "KICK_SPECTATORS_DIALOG", lobby.Get("TOP_PANELS_ROOT"), new WidgetArgs { { "clientCount", "{0}".F(spectatorCount) }, { "okPressed", okPressed }, diff --git a/mods/cnc/chrome/lobby-kickdialogs.yaml b/mods/cnc/chrome/lobby-kickdialogs.yaml index e45052f0d1..0eea66c383 100644 --- a/mods/cnc/chrome/lobby-kickdialogs.yaml +++ b/mods/cnc/chrome/lobby-kickdialogs.yaml @@ -1,20 +1,16 @@ Background@KICK_CLIENT_DIALOG: - X: 15 - Y: 30 - Width: 501 - Height: 219 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Logic: KickClientLogic Background: scrollpanel-bg Children: Label@TITLE: - X: 0 Y: 40 Width: PARENT_RIGHT Height: 25 Font: Bold Align: Center Label@TEXTA: - X: 0 Y: 67 Width: PARENT_RIGHT Height: 25 @@ -22,7 +18,6 @@ Background@KICK_CLIENT_DIALOG: Align: Center Text: You may also apply a temporary ban, preventing Label@TEXTB: - X: 0 Y: 85 Width: PARENT_RIGHT Height: 25 @@ -51,15 +46,12 @@ Background@KICK_CLIENT_DIALOG: Text: Cancel Font: Bold Background@KICK_SPECTATORS_DIALOG: - X: 15 - Y: 30 - Width: 501 - Height: 219 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Logic: KickSpectatorsLogic Background: scrollpanel-bg Children: Label@TITLE: - X: 0 Y: 40 Width: PARENT_RIGHT Height: 25 @@ -67,7 +59,6 @@ Background@KICK_SPECTATORS_DIALOG: Align: Center Text: Kick Spectators Label@TEXT: - X: 0 Y: 85 Width: PARENT_RIGHT Height: 25 @@ -88,14 +79,11 @@ Background@KICK_SPECTATORS_DIALOG: Text: Cancel Font: Bold Background@FORCE_START_DIALOG: - X: 15 - Y: 30 - Width: 556 - Height: 219 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Background: scrollpanel-bg Children: Label@TITLE: - X: 0 Y: 40 Width: PARENT_RIGHT Height: 25 @@ -103,7 +91,6 @@ Background@FORCE_START_DIALOG: Align: Center Text: Start Game? Label@TEXTA: - X: 0 Y: 67 Width: PARENT_RIGHT Height: 25 @@ -111,7 +98,6 @@ Background@FORCE_START_DIALOG: Align: Center Text: One or more players are not yet ready. Label@TEXTB: - X: 0 Y: 85 Width: PARENT_RIGHT Height: 25 diff --git a/mods/cnc/chrome/lobby-options.yaml b/mods/cnc/chrome/lobby-options.yaml index 02374ee097..07316ef02a 100644 --- a/mods/cnc/chrome/lobby-options.yaml +++ b/mods/cnc/chrome/lobby-options.yaml @@ -1,12 +1,9 @@ Background@LOBBY_OPTIONS_BIN: - X: 15 - Y: 30 - Width: 556 - Height: 219 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Background: scrollpanel-bg Children: Label@TITLE: - X: 0 Y: 0 - 25 Width: PARENT_RIGHT Height: 25 diff --git a/mods/cnc/chrome/lobby-players.yaml b/mods/cnc/chrome/lobby-players.yaml index f1f5812186..dc05ea8e6b 100644 --- a/mods/cnc/chrome/lobby-players.yaml +++ b/mods/cnc/chrome/lobby-players.yaml @@ -3,8 +3,10 @@ Container@LOBBY_PLAYER_BIN: Height: PARENT_BOTTOM Children: Container@LABEL_CONTAINER: - X: 20 - Y: 5 + X: 5 + Y: 0-25 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Children: Label@NAME: Width: 200 @@ -48,10 +50,8 @@ Container@LOBBY_PLAYER_BIN: Align: Left Font: Bold ScrollPanel@LOBBY_PLAYERS: - X: 15 - Y: 30 - Width: 556 - Height: 219 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM TopBottomSpacing: 5 ItemSpacing: 5 Children: diff --git a/mods/cnc/chrome/lobby.yaml b/mods/cnc/chrome/lobby.yaml index cd9e1e165a..03d197ec18 100644 --- a/mods/cnc/chrome/lobby.yaml +++ b/mods/cnc/chrome/lobby.yaml @@ -20,7 +20,11 @@ Container@SERVER_LOBBY: Container@MAP_PREVIEW_ROOT: Width: PARENT_RIGHT Height: PARENT_BOTTOM - Container@PLAYER_BIN_ROOT: + Container@TOP_PANELS_ROOT: + X: 15 + Y: 30 + Width: 556 + Height: 219 DropDownButton@SLOTS_DROPDOWNBUTTON: X: 15 Y: 254 diff --git a/mods/d2k/chrome/lobby-options.yaml b/mods/d2k/chrome/lobby-options.yaml index 8a8fb6288f..46b4b76476 100644 --- a/mods/d2k/chrome/lobby-options.yaml +++ b/mods/d2k/chrome/lobby-options.yaml @@ -1,8 +1,6 @@ Background@LOBBY_OPTIONS_BIN: - X: 20 - Y: 67 - Width: 593 - Height: 235 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Background: dialog3 Children: Label@TITLE: diff --git a/mods/d2k/chrome/lobby-players.yaml b/mods/d2k/chrome/lobby-players.yaml index 2a5491586f..bd0b74b2b2 100644 --- a/mods/d2k/chrome/lobby-players.yaml +++ b/mods/d2k/chrome/lobby-players.yaml @@ -3,8 +3,10 @@ Container@LOBBY_PLAYER_BIN: Height: PARENT_BOTTOM Children: Container@LABEL_CONTAINER: - X: 25 - Y: 40 + X: 5 + Y: 0-27 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Children: Label@LABEL_LOBBY_NAME: X: 0 @@ -49,12 +51,10 @@ Container@LOBBY_PLAYER_BIN: Align: Left Font: Bold ScrollPanel@LOBBY_PLAYERS: - X: 20 - Y: 67 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM TopBottomSpacing: 5 ItemSpacing: 5 - Width: 593 - Height: 235 Children: Container@TEMPLATE_EDITABLE_PLAYER: X: 5 diff --git a/mods/ra/chrome/lobby-kickdialogs.yaml b/mods/ra/chrome/lobby-kickdialogs.yaml index 84c203ef84..78c91c8078 100644 --- a/mods/ra/chrome/lobby-kickdialogs.yaml +++ b/mods/ra/chrome/lobby-kickdialogs.yaml @@ -1,20 +1,16 @@ Background@KICK_CLIENT_DIALOG: - X: 20 - Y: 67 - Width: 535 - Height: 235 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Logic: KickClientLogic Background: dialog3 Children: Label@TITLE: - X: 0 Y: 40 Width: PARENT_RIGHT Height: 25 Font: Bold Align: Center Label@TEXTA: - X: 0 Y: 67 Width: PARENT_RIGHT Height: 25 @@ -22,7 +18,6 @@ Background@KICK_CLIENT_DIALOG: Align: Center Text: You may also apply a temporary ban, preventing Label@TEXTB: - X: 0 Y: 85 Width: PARENT_RIGHT Height: 25 @@ -51,15 +46,12 @@ Background@KICK_CLIENT_DIALOG: Font: Bold Background@KICK_SPECTATORS_DIALOG: - X: 20 - Y: 67 - Width: 535 - Height: 235 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Logic: KickSpectatorsLogic Background: dialog3 Children: Label@TITLE: - X: 0 Y: 40 Width: PARENT_RIGHT Height: 25 @@ -67,7 +59,6 @@ Background@KICK_SPECTATORS_DIALOG: Align: Center Text: Kick Spectators Label@TEXT: - X: 0 Y: 85 Width: PARENT_RIGHT Height: 25 @@ -89,14 +80,11 @@ Background@KICK_SPECTATORS_DIALOG: Font: Bold Background@FORCE_START_DIALOG: - X: 20 - Y: 67 - Width: 593 - Height: 235 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Background: dialog3 Children: Label@TITLE: - X: 0 Y: 40 Width: PARENT_RIGHT Height: 25 @@ -104,7 +92,6 @@ Background@FORCE_START_DIALOG: Align: Center Text: Start Game? Label@TEXTA: - X: 0 Y: 67 Width: PARENT_RIGHT Height: 25 @@ -112,7 +99,6 @@ Background@FORCE_START_DIALOG: Align: Center Text: One or more players are not yet ready. Label@TEXTB: - X: 0 Y: 85 Width: PARENT_RIGHT Height: 25 @@ -123,7 +109,6 @@ Background@FORCE_START_DIALOG: Width: PARENT_RIGHT Children: Label@KICK_WARNING_A: - X: 0 Y: 106 Width: PARENT_RIGHT Height: 25 @@ -131,7 +116,6 @@ Background@FORCE_START_DIALOG: Align: Center Text: One or more clients are missing the selected Label@KICK_WARNING_B: - X: 0 Y: 123 Width: PARENT_RIGHT Height: 25 diff --git a/mods/ra/chrome/lobby-options.yaml b/mods/ra/chrome/lobby-options.yaml index 0b2d8df349..f19e0fecdf 100644 --- a/mods/ra/chrome/lobby-options.yaml +++ b/mods/ra/chrome/lobby-options.yaml @@ -1,8 +1,6 @@ Background@LOBBY_OPTIONS_BIN: - X: 20 - Y: 67 - Width: 593 - Height: 235 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Background: dialog3 Children: Label@TITLE: diff --git a/mods/ra/chrome/lobby-players.yaml b/mods/ra/chrome/lobby-players.yaml index f78efe2368..004a7661af 100644 --- a/mods/ra/chrome/lobby-players.yaml +++ b/mods/ra/chrome/lobby-players.yaml @@ -3,8 +3,10 @@ Container@LOBBY_PLAYER_BIN: Height: PARENT_BOTTOM Children: Container@LABEL_CONTAINER: - X: 25 - Y: 40 + X: 5 + Y: 0-27 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Children: Label@LABEL_LOBBY_NAME: X: 0 @@ -49,12 +51,10 @@ Container@LOBBY_PLAYER_BIN: Align: Left Font: Bold ScrollPanel@LOBBY_PLAYERS: - X: 20 - Y: 67 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM TopBottomSpacing: 5 ItemSpacing: 5 - Width: 593 - Height: 235 Children: Container@TEMPLATE_EDITABLE_PLAYER: X: 5 diff --git a/mods/ra/chrome/lobby.yaml b/mods/ra/chrome/lobby.yaml index 62d927bfd8..e064726ebb 100644 --- a/mods/ra/chrome/lobby.yaml +++ b/mods/ra/chrome/lobby.yaml @@ -16,7 +16,11 @@ Background@SERVER_LOBBY: Container@MAP_PREVIEW_ROOT: Width: PARENT_RIGHT Height: PARENT_BOTTOM - Container@PLAYER_BIN_ROOT: + Container@TOP_PANELS_ROOT: + X: 20 + Y: 67 + Width: 593 + Height: 235 DropDownButton@SLOTS_DROPDOWNBUTTON: X: 20 Y: PARENT_BOTTOM - 291