From 0b446167b6857c07994059244b8e3747504a3e5c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 22 Dec 2017 14:45:52 +0000 Subject: [PATCH] Unify and tweak layout of MP browser window. --- .../Widgets/Logic/MultiplayerLogic.cs | 251 +++++++------- mods/cnc/chrome/multiplayer-browser.yaml | 318 ++++++++++++------ mods/cnc/chrome/multiplayer.yaml | 100 ------ mods/cnc/mod.yaml | 1 - mods/common/chrome/multiplayer-browser.yaml | 121 ++++++- mods/common/chrome/multiplayer.yaml | 100 ------ mods/d2k/mod.yaml | 1 - mods/ra/mod.yaml | 1 - mods/ts/mod.yaml | 1 - 9 files changed, 434 insertions(+), 460 deletions(-) delete mode 100644 mods/cnc/chrome/multiplayer.yaml delete mode 100644 mods/common/chrome/multiplayer.yaml diff --git a/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs index 5bd53fafa6..954ed93037 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs @@ -81,15 +81,129 @@ namespace OpenRA.Mods.Common.Widgets.Logic gameStartedColor = ChromeMetrics.Get("GameStartedColor"); incompatibleGameStartedColor = ChromeMetrics.Get("IncompatibleGameStartedColor"); - LoadBrowserPanel(widget); + serverList = widget.Get("SERVER_LIST"); + headerTemplate = serverList.Get("HEADER_TEMPLATE"); + serverTemplate = serverList.Get("SERVER_TEMPLATE"); - // Filter and refresh buttons act on the browser panel, - // but remain visible (disabled) on the other panels - var refreshButton = widget.Get("REFRESH_BUTTON"); - refreshButton.IsDisabled = () => searchStatus == SearchStatus.Fetching; + var join = widget.Get("JOIN_BUTTON"); + join.IsVisible = () => currentServer != null; + join.IsDisabled = () => !currentServer.IsJoinable; + join.OnClick = () => Join(currentServer); - var filtersButton = widget.Get("FILTERS_DROPDOWNBUTTON"); - filtersButton.IsDisabled = () => searchStatus == SearchStatus.Fetching; + // Display the progress label over the server list + // The text is only visible when the list is empty + var progressText = widget.Get("PROGRESS_LABEL"); + progressText.IsVisible = () => searchStatus != SearchStatus.Hidden; + progressText.GetText = ProgressLabelText; + + var gs = Game.Settings.Game; + Action toggleFilterFlag = f => + { + gs.MPGameFilters ^= f; + Game.Settings.Save(); + RefreshServerList(); + }; + + var filtersPanel = Ui.LoadWidget("MULTIPLAYER_FILTER_PANEL", null, new WidgetArgs()); + var showWaitingCheckbox = filtersPanel.GetOrNull("WAITING_FOR_PLAYERS"); + if (showWaitingCheckbox != null) + { + showWaitingCheckbox.IsChecked = () => gs.MPGameFilters.HasFlag(MPGameFilters.Waiting); + showWaitingCheckbox.OnClick = () => toggleFilterFlag(MPGameFilters.Waiting); + } + + var showEmptyCheckbox = filtersPanel.GetOrNull("EMPTY"); + if (showEmptyCheckbox != null) + { + showEmptyCheckbox.IsChecked = () => gs.MPGameFilters.HasFlag(MPGameFilters.Empty); + showEmptyCheckbox.OnClick = () => toggleFilterFlag(MPGameFilters.Empty); + } + + var showAlreadyStartedCheckbox = filtersPanel.GetOrNull("ALREADY_STARTED"); + if (showAlreadyStartedCheckbox != null) + { + showAlreadyStartedCheckbox.IsChecked = () => gs.MPGameFilters.HasFlag(MPGameFilters.Started); + showAlreadyStartedCheckbox.OnClick = () => toggleFilterFlag(MPGameFilters.Started); + } + + var showProtectedCheckbox = filtersPanel.GetOrNull("PASSWORD_PROTECTED"); + if (showProtectedCheckbox != null) + { + showProtectedCheckbox.IsChecked = () => gs.MPGameFilters.HasFlag(MPGameFilters.Protected); + showProtectedCheckbox.OnClick = () => toggleFilterFlag(MPGameFilters.Protected); + } + + var showIncompatibleCheckbox = filtersPanel.GetOrNull("INCOMPATIBLE_VERSION"); + if (showIncompatibleCheckbox != null) + { + showIncompatibleCheckbox.IsChecked = () => gs.MPGameFilters.HasFlag(MPGameFilters.Incompatible); + showIncompatibleCheckbox.OnClick = () => toggleFilterFlag(MPGameFilters.Incompatible); + } + + var filtersButton = widget.GetOrNull("FILTERS_DROPDOWNBUTTON"); + if (filtersButton != null) + { + filtersButton.IsDisabled = () => searchStatus == SearchStatus.Fetching; + filtersButton.OnMouseDown = _ => + { + filtersButton.RemovePanel(); + filtersButton.AttachPanel(filtersPanel); + }; + } + + var refreshButton = widget.GetOrNull("REFRESH_BUTTON"); + if (refreshButton != null) + { + refreshButton.GetText = () => searchStatus == SearchStatus.Fetching ? "Refreshing..." : "Refresh"; + refreshButton.IsDisabled = () => searchStatus == SearchStatus.Fetching; + refreshButton.OnClick = RefreshServerList; + } + + var mapPreview = widget.GetOrNull("SELECTED_MAP_PREVIEW"); + if (mapPreview != null) + mapPreview.Preview = () => currentMap; + + var mapTitle = widget.GetOrNull("SELECTED_MAP"); + if (mapTitle != null) + { + var font = Game.Renderer.Fonts[mapTitle.Font]; + var title = new CachedTransform(m => m == null ? "No Server Selected" : + WidgetUtils.TruncateText(m.Title, mapTitle.Bounds.Width, font)); + mapTitle.GetText = () => title.Update(currentMap); + } + + var ip = widget.GetOrNull("SELECTED_IP"); + if (ip != null) + { + ip.IsVisible = () => currentServer != null; + ip.GetText = () => currentServer.Address; + } + + var status = widget.GetOrNull("SELECTED_STATUS"); + if (status != null) + { + status.IsVisible = () => currentServer != null; + status.GetText = () => GetStateLabel(currentServer); + status.GetColor = () => GetStateColor(currentServer, status); + } + + var modVersion = widget.GetOrNull("SELECTED_MOD_VERSION"); + if (modVersion != null) + { + modVersion.IsVisible = () => currentServer != null; + modVersion.GetColor = () => currentServer.IsCompatible ? modVersion.TextColor : incompatibleVersionColor; + + var font = Game.Renderer.Fonts[modVersion.Font]; + var version = new CachedTransform(s => WidgetUtils.TruncateText(s.ModLabel, mapTitle.Bounds.Width, font)); + modVersion.GetText = () => version.Update(currentServer); + } + + var players = widget.GetOrNull("SELECTED_PLAYERS"); + if (players != null) + { + players.IsVisible = () => currentServer != null; + players.GetText = () => PlayersLabel(currentServer); + } var directConnectButton = widget.Get("DIRECTCONNECT_BUTTON"); directConnectButton.OnClick = () => @@ -149,129 +263,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic } } - void LoadBrowserPanel(Widget widget) - { - var browserPanel = Game.LoadWidget(null, "MULTIPLAYER_BROWSER_PANEL", widget.Get("TOP_PANELS_ROOT"), new WidgetArgs()); - - serverList = browserPanel.Get("SERVER_LIST"); - headerTemplate = serverList.Get("HEADER_TEMPLATE"); - serverTemplate = serverList.Get("SERVER_TEMPLATE"); - - var join = widget.Get("JOIN_BUTTON"); - join.IsDisabled = () => currentServer == null || !currentServer.IsJoinable; - join.OnClick = () => Join(currentServer); - - // Display the progress label over the server list - // The text is only visible when the list is empty - var progressText = widget.Get("PROGRESS_LABEL"); - progressText.IsVisible = () => searchStatus != SearchStatus.Hidden; - progressText.GetText = ProgressLabelText; - - var gs = Game.Settings.Game; - Action toggleFilterFlag = f => - { - gs.MPGameFilters ^= f; - Game.Settings.Save(); - RefreshServerList(); - }; - - var filtersPanel = Ui.LoadWidget("MULTIPLAYER_FILTER_PANEL", null, new WidgetArgs()); - var showWaitingCheckbox = filtersPanel.GetOrNull("WAITING_FOR_PLAYERS"); - if (showWaitingCheckbox != null) - { - showWaitingCheckbox.IsChecked = () => gs.MPGameFilters.HasFlag(MPGameFilters.Waiting); - showWaitingCheckbox.OnClick = () => toggleFilterFlag(MPGameFilters.Waiting); - } - - var showEmptyCheckbox = filtersPanel.GetOrNull("EMPTY"); - if (showEmptyCheckbox != null) - { - showEmptyCheckbox.IsChecked = () => gs.MPGameFilters.HasFlag(MPGameFilters.Empty); - showEmptyCheckbox.OnClick = () => toggleFilterFlag(MPGameFilters.Empty); - } - - var showAlreadyStartedCheckbox = filtersPanel.GetOrNull("ALREADY_STARTED"); - if (showAlreadyStartedCheckbox != null) - { - showAlreadyStartedCheckbox.IsChecked = () => gs.MPGameFilters.HasFlag(MPGameFilters.Started); - showAlreadyStartedCheckbox.OnClick = () => toggleFilterFlag(MPGameFilters.Started); - } - - var showProtectedCheckbox = filtersPanel.GetOrNull("PASSWORD_PROTECTED"); - if (showProtectedCheckbox != null) - { - showProtectedCheckbox.IsChecked = () => gs.MPGameFilters.HasFlag(MPGameFilters.Protected); - showProtectedCheckbox.OnClick = () => toggleFilterFlag(MPGameFilters.Protected); - } - - var showIncompatibleCheckbox = filtersPanel.GetOrNull("INCOMPATIBLE_VERSION"); - if (showIncompatibleCheckbox != null) - { - showIncompatibleCheckbox.IsChecked = () => gs.MPGameFilters.HasFlag(MPGameFilters.Incompatible); - showIncompatibleCheckbox.OnClick = () => toggleFilterFlag(MPGameFilters.Incompatible); - } - - var filtersButton = widget.GetOrNull("FILTERS_DROPDOWNBUTTON"); - if (filtersButton != null) - { - filtersButton.OnMouseDown = _ => - { - filtersButton.RemovePanel(); - filtersButton.AttachPanel(filtersPanel); - }; - } - - var refreshButton = widget.Get("REFRESH_BUTTON"); - refreshButton.GetText = () => searchStatus == SearchStatus.Fetching ? "Refreshing..." : "Refresh"; - refreshButton.OnClick = RefreshServerList; - - var mapPreview = widget.GetOrNull("SELECTED_MAP_PREVIEW"); - if (mapPreview != null) - mapPreview.Preview = () => currentMap; - - var mapTitle = widget.GetOrNull("SELECTED_MAP"); - if (mapTitle != null) - { - var font = Game.Renderer.Fonts[mapTitle.Font]; - var title = new CachedTransform(m => m == null ? "No Server Selected" : - WidgetUtils.TruncateText(m.Title, mapTitle.Bounds.Width, font)); - mapTitle.GetText = () => title.Update(currentMap); - } - - var ip = widget.GetOrNull("SELECTED_IP"); - if (ip != null) - { - ip.IsVisible = () => currentServer != null; - ip.GetText = () => currentServer.Address; - } - - var status = widget.GetOrNull("SELECTED_STATUS"); - if (status != null) - { - status.IsVisible = () => currentServer != null; - status.GetText = () => GetStateLabel(currentServer); - status.GetColor = () => GetStateColor(currentServer, status); - } - - var modVersion = widget.GetOrNull("SELECTED_MOD_VERSION"); - if (modVersion != null) - { - modVersion.IsVisible = () => currentServer != null; - modVersion.GetColor = () => currentServer.IsCompatible ? modVersion.TextColor : incompatibleVersionColor; - - var font = Game.Renderer.Fonts[modVersion.Font]; - var version = new CachedTransform(s => WidgetUtils.TruncateText(s.ModLabel, mapTitle.Bounds.Width, font)); - modVersion.GetText = () => version.Update(currentServer); - } - - var players = widget.GetOrNull("SELECTED_PLAYERS"); - if (players != null) - { - players.IsVisible = () => currentServer != null; - players.GetText = () => PlayersLabel(currentServer); - } - } - string PlayersLabel(GameServer game) { return "{0}{1}{2}".F( diff --git a/mods/cnc/chrome/multiplayer-browser.yaml b/mods/cnc/chrome/multiplayer-browser.yaml index 2c57ed2fa3..4a13574d8d 100644 --- a/mods/cnc/chrome/multiplayer-browser.yaml +++ b/mods/cnc/chrome/multiplayer-browser.yaml @@ -1,139 +1,233 @@ -Container@MULTIPLAYER_BROWSER_PANEL: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM +Container@MULTIPLAYER_PANEL: + Logic: MultiplayerLogic + X: (WINDOW_RIGHT - WIDTH) / 2 + Y: (WINDOW_BOTTOM - 560) / 2 + Width: 800 + Height: 575 Children: - Container@LABEL_CONTAINER: - Y: 5 + Label@TITLE: + Text: Multiplayer Width: PARENT_RIGHT - Height: PARENT_BOTTOM + Y: 0 - 25 + Font: BigBold + Contrast: true + Align: Center + Background@bg: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM - 35 + Background: panel-black Children: - Label@NAME: - X: 5 - Width: 255 - Height: 25 - Text: Server - Align: Center - Font: Bold - Label@PLAYERS: - X: 290 - Width: 85 - Height: 25 - Text: Players - Font: Bold - Label@LOCATION: - X: 380 - Width: 110 - Height: 25 - Text: Location - Font: Bold - Label@STATUS: - X: 495 - Width: 50 - Height: 25 - Text: Status - Font: Bold - ScrollPanel@SERVER_LIST: - Y: 30 - Width: 582 - Height: 249 - TopBottomSpacing: 2 - Children: - ScrollItem@HEADER_TEMPLATE: - Width: PARENT_RIGHT - 27 - Height: 20 - X: 2 - Visible: false + Container@LABEL_CONTAINER: + X: 15 + Y: 5 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM Children: - Label@LABEL: - Y: 0 - 1 - Font: TinyBold - Width: PARENT_RIGHT - Height: 20 - Align: Center - ScrollItem@SERVER_TEMPLATE: - Width: PARENT_RIGHT - 27 - Height: 25 - X: 2 - Children: - Label@TITLE: + Label@NAME: X: 5 Width: 255 Height: 25 - Image@PASSWORD_PROTECTED: - X: 272 - Y: 6 - Width: 8 - Height: 10 - ImageCollection: lobby-bits + Text: Server + Align: Center + Font: Bold Label@PLAYERS: X: 290 Width: 85 Height: 25 + Text: Players + Font: Bold Label@LOCATION: X: 380 Width: 110 Height: 25 + Text: Location + Font: Bold Label@STATUS: X: 495 Width: 50 Height: 25 - Label@PROGRESS_LABEL: - Y: 30 + (249 - HEIGHT) / 2 - Width: 582 - Height: 25 - Font: Bold - Align: Center - Visible: false - Container@SELECTED_SERVER: - X: PARENT_RIGHT - WIDTH - Y: 30 - Width: 174 - Height: 280 - Children: - Background@MAP_BG: - Width: PARENT_RIGHT - Height: 174 - Background: panel-gray + Text: Status + Font: Bold + ScrollPanel@SERVER_LIST: + X: 15 + Y: 30 + Width: 582 + Height: PARENT_BOTTOM - 75 + TopBottomSpacing: 2 Children: - MapPreview@SELECTED_MAP_PREVIEW: - X: 1 - Y: 1 - Width: PARENT_RIGHT - 2 - Height: PARENT_BOTTOM - 2 - Label@SELECTED_MAP: - Y: 172 - Width: PARENT_RIGHT + ScrollItem@HEADER_TEMPLATE: + Width: PARENT_RIGHT - 27 + Height: 20 + X: 2 + Visible: false + Children: + Label@LABEL: + Y: 0 - 1 + Font: TinyBold + Width: PARENT_RIGHT + Height: 20 + Align: Center + ScrollItem@SERVER_TEMPLATE: + Width: PARENT_RIGHT - 27 + Height: 25 + X: 2 + Children: + Label@TITLE: + X: 5 + Width: 255 + Height: 25 + Image@PASSWORD_PROTECTED: + X: 272 + Y: 6 + Width: 8 + Height: 10 + ImageCollection: lobby-bits + Label@PLAYERS: + X: 290 + Width: 85 + Height: 25 + Label@LOCATION: + X: 380 + Width: 110 + Height: 25 + Label@STATUS: + X: 495 + Width: 50 + Height: 25 + Label@PROGRESS_LABEL: + X: 15 + Y: 30 + (PARENT_BOTTOM - 75 - HEIGHT) / 2 + Width: 582 Height: 25 Font: Bold Align: Center - Label@SELECTED_IP: - Y: 187 - Width: PARENT_RIGHT + Visible: false + Container@SELECTED_SERVER: + X: PARENT_RIGHT - WIDTH - 15 + Y: 30 + Width: 174 + Height: 280 + Children: + Background@MAP_BG: + Width: PARENT_RIGHT + Height: 174 + Background: panel-gray + Children: + MapPreview@SELECTED_MAP_PREVIEW: + X: 1 + Y: 1 + Width: PARENT_RIGHT - 2 + Height: PARENT_BOTTOM - 2 + Label@SELECTED_MAP: + Y: 172 + Width: PARENT_RIGHT + Height: 25 + Font: Bold + Align: Center + Label@SELECTED_IP: + Y: 187 + Width: PARENT_RIGHT + Height: 25 + Font: Tiny + Align: Center + Label@SELECTED_STATUS: + Y: 203 + Width: PARENT_RIGHT + Height: 25 + Font: TinyBold + Align: Center + Label@SELECTED_MOD_VERSION: + Y: 216 + Width: PARENT_RIGHT + Height: 25 + Font: Tiny + Align: Center + Label@SELECTED_PLAYERS: + Y: 229 + Width: PARENT_RIGHT + Height: 25 + Font: TinyBold + Align: Center + Button@JOIN_BUTTON: + Key: return + Y: 255 + Width: PARENT_RIGHT + Height: 25 + Text: Join + DropDownButton@FILTERS_DROPDOWNBUTTON: + X: 15 + Y: PARENT_BOTTOM - 40 + Width: 152 Height: 25 - Font: Tiny - Align: Center - Label@SELECTED_STATUS: - Y: 203 - Width: PARENT_RIGHT + Text: Filter Games + Button@REFRESH_BUTTON: + X: 172 + Y: PARENT_BOTTOM - 40 + Width: 100 Height: 25 - Font: TinyBold - Align: Center - Label@SELECTED_MOD_VERSION: - Y: 216 - Width: PARENT_RIGHT + Text: Refresh + Button@DIRECTCONNECT_BUTTON: + X: 387 + Y: PARENT_BOTTOM - 40 + Width: 100 Height: 25 - Font: Tiny - Align: Center - Label@SELECTED_PLAYERS: - Y: 229 - Width: PARENT_RIGHT + Text: Direct IP + Button@CREATE_BUTTON: + X: 492 + Y: PARENT_BOTTOM - 40 + Width: 105 Height: 25 - Font: TinyBold - Align: Center - Button@JOIN_BUTTON: - Key: return - X: PARENT_RIGHT - WIDTH - Y: 284 - Width: 174 - Height: 25 - Text: Join + Text: Create + Button@BACK_BUTTON: + Key: escape + X: 0 + Y: PARENT_BOTTOM - 36 + Width: 140 + Height: 35 + Text: Back + TooltipContainer@TOOLTIP_CONTAINER: + +ScrollPanel@MULTIPLAYER_FILTER_PANEL: + Width: 147 + Height: 130 + Background: panel-black + Children: + Checkbox@WAITING_FOR_PLAYERS: + X: 5 + Y: 5 + Width: PARENT_RIGHT - 29 + Height: 20 + Text: Waiting + TextColor: 32CD32 + Font: Regular + Checkbox@EMPTY: + X: 5 + Y: 30 + Width: PARENT_RIGHT - 29 + Height: 20 + Text: Empty + Font: Regular + Checkbox@PASSWORD_PROTECTED: + X: 5 + Y: 55 + Width: PARENT_RIGHT - 29 + Height: 20 + Text: Protected + TextColor: FF0000 + Font: Regular + Checkbox@ALREADY_STARTED: + X: 5 + Y: 80 + Width: PARENT_RIGHT - 29 + Height: 20 + Text: Started + TextColor: FFA500 + Font: Regular + Checkbox@INCOMPATIBLE_VERSION: + X: 5 + Y: 105 + Width: PARENT_RIGHT - 29 + Height: 20 + Text: Incompatible + TextColor: BEBEBE + Font: Regular diff --git a/mods/cnc/chrome/multiplayer.yaml b/mods/cnc/chrome/multiplayer.yaml deleted file mode 100644 index df98f5b4c0..0000000000 --- a/mods/cnc/chrome/multiplayer.yaml +++ /dev/null @@ -1,100 +0,0 @@ -Container@MULTIPLAYER_PANEL: - Logic: MultiplayerLogic - X: (WINDOW_RIGHT - WIDTH) / 2 - Y: (WINDOW_BOTTOM - 345) / 2 - Width: 800 - Height: 360 - Children: - Label@TITLE: - Text: Multiplayer - Width: PARENT_RIGHT - Y: 0 - 25 - Font: BigBold - Contrast: true - Align: Center - Background@bg: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - 35 - Background: panel-black - Children: - DropDownButton@FILTERS_DROPDOWNBUTTON: - X: 15 - Y: 284 - Width: 152 - Height: 25 - Text: Filter Games - Button@REFRESH_BUTTON: - X: 172 - Y: 284 - Width: 100 - Height: 25 - Text: Refresh - Button@DIRECTCONNECT_BUTTON: - X: 387 - Y: 284 - Width: 100 - Height: 25 - Text: Direct IP - Button@CREATE_BUTTON: - X: 492 - Y: 284 - Width: 105 - Height: 25 - Text: Create - Container@TOP_PANELS_ROOT: - X: 15 - Width: PARENT_RIGHT - 30 - Height: PARENT_BOTTOM - TooltipContainer@TOOLTIP_CONTAINER: - Button@BACK_BUTTON: - Key: escape - X: 0 - Y: PARENT_BOTTOM - 36 - Width: 140 - Height: 35 - Text: Back - -ScrollPanel@MULTIPLAYER_FILTER_PANEL: - Width: 147 - Height: 130 - Background: panel-black - Children: - Checkbox@WAITING_FOR_PLAYERS: - X: 5 - Y: 5 - Width: PARENT_RIGHT - 29 - Height: 20 - Text: Waiting - TextColor: 32CD32 - Font: Regular - Checkbox@EMPTY: - X: 5 - Y: 30 - Width: PARENT_RIGHT - 29 - Height: 20 - Text: Empty - Font: Regular - Checkbox@PASSWORD_PROTECTED: - X: 5 - Y: 55 - Width: PARENT_RIGHT - 29 - Height: 20 - Text: Protected - TextColor: FF0000 - Font: Regular - Checkbox@ALREADY_STARTED: - X: 5 - Y: 80 - Width: PARENT_RIGHT - 29 - Height: 20 - Text: Started - TextColor: FFA500 - Font: Regular - Checkbox@INCOMPATIBLE_VERSION: - X: 5 - Y: 105 - Width: PARENT_RIGHT - 29 - Height: 20 - Text: Incompatible - TextColor: BEBEBE - Font: Regular diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 6b37be1040..9521f37d37 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -89,7 +89,6 @@ Assemblies: ChromeLayout: cnc|chrome/mainmenu.yaml - cnc|chrome/multiplayer.yaml cnc|chrome/multiplayer-browser.yaml cnc|chrome/multiplayer-createserver.yaml cnc|chrome/multiplayer-directconnect.yaml diff --git a/mods/common/chrome/multiplayer-browser.yaml b/mods/common/chrome/multiplayer-browser.yaml index fcd22e92b8..6c5469a28d 100644 --- a/mods/common/chrome/multiplayer-browser.yaml +++ b/mods/common/chrome/multiplayer-browser.yaml @@ -1,9 +1,20 @@ -Container@MULTIPLAYER_BROWSER_PANEL: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM +Background@MULTIPLAYER_PANEL: + Logic: MultiplayerLogic + X: (WINDOW_RIGHT - WIDTH) / 2 + Y: (WINDOW_BOTTOM - HEIGHT) / 2 + Width: 808 + Height: 600 Children: + Label@TITLE: + Y: 15 + Width: PARENT_RIGHT + Height: 25 + Text: Multiplayer + Align: Center + Font: Bold Container@LABEL_CONTAINER: - Y: 5 + X: 20 + Y: 42 Width: PARENT_RIGHT Height: PARENT_BOTTOM Children: @@ -33,9 +44,10 @@ Container@MULTIPLAYER_BROWSER_PANEL: Text: Status Font: Bold ScrollPanel@SERVER_LIST: - Y: 30 + X: 20 + Y: 67 Width: 583 - Height: 279 + Height: PARENT_BOTTOM - 119 TopBottomSpacing: 2 Children: ScrollItem@HEADER_TEMPLATE: @@ -79,15 +91,16 @@ Container@MULTIPLAYER_BROWSER_PANEL: Width: 50 Height: 25 Label@PROGRESS_LABEL: - Y: 30 + (249 - HEIGHT) / 2 + X: 20 + Y: 67 + (PARENT_BOTTOM - 119 - HEIGHT) / 2 Width: 582 Height: 25 Font: Bold Align: Center Visible: false Container@SELECTED_SERVER: - X: PARENT_RIGHT - WIDTH - Y: 30 + X: PARENT_RIGHT - WIDTH - 20 + Y: 67 Width: 174 Height: 280 Children: @@ -131,11 +144,91 @@ Container@MULTIPLAYER_BROWSER_PANEL: Height: 25 Font: TinyBold Align: Center - Button@JOIN_BUTTON: - Key: return - X: PARENT_RIGHT - WIDTH - Y: 284 + Button@JOIN_BUTTON: + Key: return + Y: 255 + Width: PARENT_RIGHT + Height: 25 + Text: Join + Font: Bold + DropDownButton@FILTERS_DROPDOWNBUTTON: + X: 20 + Y: PARENT_BOTTOM - HEIGHT - 20 + Width: 158 + Height: 25 + Text: Filter Games + Font: Bold + Button@REFRESH_BUTTON: + X: 182 + Y: PARENT_BOTTOM - HEIGHT - 20 + Width: 100 + Height: 25 + Text: Refresh + Font: Bold + Button@DIRECTCONNECT_BUTTON: + X: 398 + Y: PARENT_BOTTOM - HEIGHT - 20 + Width: 100 + Height: 25 + Text: Direct IP + Font: Bold + Button@CREATE_BUTTON: + X: 503 + Y: PARENT_BOTTOM - HEIGHT - 20 + Width: 100 + Height: 25 + Text: Create + Font: Bold + Button@BACK_BUTTON: + Key: escape + X: PARENT_RIGHT - WIDTH - 20 + Y: PARENT_BOTTOM - HEIGHT - 20 Width: 174 Height: 25 - Text: Join + Text: Back Font: Bold + TooltipContainer@TOOLTIP_CONTAINER: + +ScrollPanel@MULTIPLAYER_FILTER_PANEL: + Width: 158 + Height: 130 + Children: + Checkbox@WAITING_FOR_PLAYERS: + X: 5 + Y: 5 + Width: PARENT_RIGHT - 29 + Height: 20 + Text: Waiting + TextColor: 32CD32 + Font: Regular + Checkbox@EMPTY: + X: 5 + Y: 30 + Width: PARENT_RIGHT - 29 + Height: 20 + Text: Empty + Font: Regular + Checkbox@PASSWORD_PROTECTED: + X: 5 + Y: 55 + Width: PARENT_RIGHT - 29 + Height: 20 + Text: Protected + TextColor: FF0000 + Font: Regular + Checkbox@ALREADY_STARTED: + X: 5 + Y: 80 + Width: PARENT_RIGHT - 29 + Height: 20 + Text: Started + TextColor: FFA500 + Font: Regular + Checkbox@INCOMPATIBLE_VERSION: + X: 5 + Y: 105 + Width: PARENT_RIGHT - 29 + Height: 20 + Text: Incompatible + TextColor: BEBEBE + Font: Regular \ No newline at end of file diff --git a/mods/common/chrome/multiplayer.yaml b/mods/common/chrome/multiplayer.yaml deleted file mode 100644 index b20dd687e3..0000000000 --- a/mods/common/chrome/multiplayer.yaml +++ /dev/null @@ -1,100 +0,0 @@ -Background@MULTIPLAYER_PANEL: - Logic: MultiplayerLogic - X: (WINDOW_RIGHT - WIDTH) / 2 - Y: (WINDOW_BOTTOM - HEIGHT) / 2 - Width: 808 - Height: 395 - Children: - Label@TITLE: - Y: 15 - Width: PARENT_RIGHT - Height: 25 - Text: Multiplayer - Align: Center - Font: Bold - DropDownButton@FILTERS_DROPDOWNBUTTON: - X: 20 - Y: PARENT_BOTTOM - HEIGHT - 20 - Width: 158 - Height: 25 - Text: Filter Games - Font: Bold - Button@REFRESH_BUTTON: - X: 182 - Y: PARENT_BOTTOM - HEIGHT - 20 - Width: 100 - Height: 25 - Text: Refresh - Font: Bold - Button@DIRECTCONNECT_BUTTON: - X: 398 - Y: PARENT_BOTTOM - HEIGHT - 20 - Width: 100 - Height: 25 - Text: Direct IP - Font: Bold - Button@CREATE_BUTTON: - X: 503 - Y: PARENT_BOTTOM - HEIGHT - 20 - Width: 100 - Height: 25 - Text: Create - Font: Bold - Container@TOP_PANELS_ROOT: - X: 20 - Y: 37 - Width: PARENT_RIGHT - 40 - Height: PARENT_BOTTOM - 87 - TooltipContainer@TOOLTIP_CONTAINER: - Button@BACK_BUTTON: - Key: escape - X: PARENT_RIGHT - WIDTH - 20 - Y: PARENT_BOTTOM - HEIGHT - 20 - Width: 174 - Height: 25 - Text: Back - Font: Bold - -ScrollPanel@MULTIPLAYER_FILTER_PANEL: - Width: 158 - Height: 130 - Children: - Checkbox@WAITING_FOR_PLAYERS: - X: 5 - Y: 5 - Width: PARENT_RIGHT - 29 - Height: 20 - Text: Waiting - TextColor: 32CD32 - Font: Regular - Checkbox@EMPTY: - X: 5 - Y: 30 - Width: PARENT_RIGHT - 29 - Height: 20 - Text: Empty - Font: Regular - Checkbox@PASSWORD_PROTECTED: - X: 5 - Y: 55 - Width: PARENT_RIGHT - 29 - Height: 20 - Text: Protected - TextColor: FF0000 - Font: Regular - Checkbox@ALREADY_STARTED: - X: 5 - Y: 80 - Width: PARENT_RIGHT - 29 - Height: 20 - Text: Started - TextColor: FFA500 - Font: Regular - Checkbox@INCOMPATIBLE_VERSION: - X: 5 - Y: 105 - Width: PARENT_RIGHT - 29 - Height: 20 - Text: Incompatible - TextColor: BEBEBE - Font: Regular diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 58ae989899..fb675a42b2 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -90,7 +90,6 @@ ChromeLayout: common|chrome/lobby-kickdialogs.yaml common|chrome/color-picker.yaml common|chrome/map-chooser.yaml - common|chrome/multiplayer.yaml common|chrome/multiplayer-browser.yaml common|chrome/multiplayer-createserver.yaml common|chrome/multiplayer-directconnect.yaml diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index 076efa3206..d23e8a8352 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -105,7 +105,6 @@ ChromeLayout: common|chrome/lobby-kickdialogs.yaml common|chrome/color-picker.yaml common|chrome/map-chooser.yaml - common|chrome/multiplayer.yaml common|chrome/multiplayer-browser.yaml common|chrome/multiplayer-createserver.yaml common|chrome/multiplayer-directconnect.yaml diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index 6c23b84c0c..cd1f69b472 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -153,7 +153,6 @@ ChromeLayout: common|chrome/lobby-kickdialogs.yaml ts|chrome/color-picker.yaml common|chrome/map-chooser.yaml - common|chrome/multiplayer.yaml common|chrome/multiplayer-browser.yaml common|chrome/multiplayer-createserver.yaml common|chrome/multiplayer-directconnect.yaml