diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index cbca0783a5..f73008306c 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -566,7 +566,6 @@ - @@ -620,7 +619,6 @@ - @@ -706,6 +704,7 @@ + diff --git a/OpenRA.Mods.Common/Widgets/Logic/DirectConnectLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/DirectConnectLogic.cs deleted file mode 100644 index d00e94d772..0000000000 --- a/OpenRA.Mods.Common/Widgets/Logic/DirectConnectLogic.cs +++ /dev/null @@ -1,43 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2015 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using System; -using OpenRA.Widgets; - -namespace OpenRA.Mods.Common.Widgets.Logic -{ - public class DirectConnectLogic : ChromeLogic - { - [ObjectCreator.UseCtor] - public DirectConnectLogic(Widget widget, Action onExit, Action openLobby) - { - var panel = widget; - var ipField = panel.Get("IP"); - var portField = panel.Get("PORT"); - - var last = Game.Settings.Player.LastServer.Split(':'); - ipField.Text = last.Length > 1 ? last[0] : "localhost"; - portField.Text = last.Length == 2 ? last[1] : "1234"; - - panel.Get("JOIN_BUTTON").OnClick = () => - { - var port = Exts.WithDefault(1234, () => Exts.ParseIntegerInvariant(portField.Text)); - - Game.Settings.Player.LastServer = "{0}:{1}".F(ipField.Text, port); - Game.Settings.Save(); - - Ui.CloseWindow(); - ConnectionLogic.Connect(ipField.Text, port, "", openLobby, onExit); - }; - - panel.Get("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); }; - } - } -} diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index 4a944cb647..698f679156 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic mainMenu.Get("MULTIPLAYER_BUTTON").OnClick = () => { menuType = MenuType.None; - Ui.OpenWindow("SERVERBROWSER_PANEL", new WidgetArgs + Ui.OpenWindow("MULTIPLAYER_PANEL", new WidgetArgs { { "onStart", RemoveShellmapUI }, { "onExit", () => menuType = MenuType.Main }, @@ -220,7 +220,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic Game.OnRemoteDirectConnect += (host, port) => { menuType = MenuType.None; - Ui.OpenWindow("SERVERBROWSER_PANEL", new WidgetArgs + Ui.OpenWindow("MULTIPLAYER_PANEL", new WidgetArgs { { "onStart", RemoveShellmapUI }, { "onExit", () => menuType = MenuType.Main }, diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs similarity index 53% rename from OpenRA.Mods.Common/Widgets/Logic/ServerBrowserLogic.cs rename to OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs index 65a0622778..e2a9d38571 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs @@ -20,10 +20,14 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic { - public class ServerBrowserLogic : ChromeLogic + public class MultiplayerLogic : ChromeLogic { static readonly Action DoNothing = () => { }; + enum PanelType { Browser, DirectConnect, CreateServer } + PanelType panel = PanelType.Browser; + + readonly Color incompatibleVersionColor; readonly Color incompatibleProtectedGameColor; readonly Color protectedGameColor; readonly Color incompatibleWaitingGameColor; @@ -31,18 +35,20 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly Color incompatibleGameStartedColor; readonly Color gameStartedColor; readonly Color incompatibleGameColor; - readonly Color cantJoinGameColor; GameServer currentServer; + MapPreview currentMap; + ScrollItemWidget serverTemplate; ScrollItemWidget headerTemplate; Action onStart; + Action onExit; enum SearchStatus { Fetching, Failed, NoGames, Hidden } SearchStatus searchStatus = SearchStatus.Fetching; Download currentQuery; - Widget panel, serverList; + Widget serverList; bool showWaiting = true; bool showEmpty = true; @@ -55,87 +61,52 @@ namespace OpenRA.Mods.Common.Widgets.Logic switch (searchStatus) { case SearchStatus.Failed: return "Failed to contact master server."; - case SearchStatus.NoGames: return "No games found."; + case SearchStatus.NoGames: return "No games found. Try changing filters."; default: return ""; } } [ObjectCreator.UseCtor] - public ServerBrowserLogic(Widget widget, Action onStart, Action onExit, string directConnectHost, int directConnectPort) + public MultiplayerLogic(Widget widget, Action onStart, Action onExit, string directConnectHost, int directConnectPort) { - panel = widget; this.onStart = onStart; + this.onExit = onExit; + incompatibleVersionColor = ChromeMetrics.Get("IncompatibleVersionColor"); incompatibleGameColor = ChromeMetrics.Get("IncompatibleGameColor"); - cantJoinGameColor = ChromeMetrics.Get("CantJoinGameColor"); - protectedGameColor = ChromeMetrics.Get("ProtectedGameColor"); incompatibleProtectedGameColor = ChromeMetrics.Get("IncompatibleProtectedGameColor"); + protectedGameColor = ChromeMetrics.Get("ProtectedGameColor"); waitingGameColor = ChromeMetrics.Get("WaitingGameColor"); incompatibleWaitingGameColor = ChromeMetrics.Get("IncompatibleWaitingGameColor"); gameStartedColor = ChromeMetrics.Get("GameStartedColor"); incompatibleGameStartedColor = ChromeMetrics.Get("IncompatibleGameStartedColor"); - serverList = panel.Get("SERVER_LIST"); - headerTemplate = serverList.Get("HEADER_TEMPLATE"); - serverTemplate = serverList.Get("SERVER_TEMPLATE"); + LoadBrowserPanel(widget); + LoadDirectConnectPanel(widget); + LoadCreateServerPanel(widget); - // Menu buttons - var refreshButton = panel.Get("REFRESH_BUTTON"); - refreshButton.IsDisabled = () => searchStatus == SearchStatus.Fetching; - refreshButton.GetText = () => searchStatus == SearchStatus.Fetching ? "Refreshing..." : "Refresh"; - refreshButton.OnClick = RefreshServerList; + // 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 || panel != PanelType.Browser; - panel.Get("DIRECTCONNECT_BUTTON").OnClick = OpenDirectConnectPanel; - panel.Get("CREATE_BUTTON").OnClick = OpenCreateServerPanel; + var filtersButton = widget.GetOrNull("FILTERS_DROPDOWNBUTTON"); + filtersButton.IsDisabled = () => searchStatus == SearchStatus.Fetching || panel != PanelType.Browser; - var join = panel.Get("JOIN_BUTTON"); - join.IsDisabled = () => currentServer == null || !currentServer.IsJoinable; - join.OnClick = () => Join(currentServer); + var browserTab = widget.Get("BROWSER_TAB"); + browserTab.IsHighlighted = () => panel == PanelType.Browser; + browserTab.OnClick = () => panel = PanelType.Browser; - panel.Get("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); }; + var directConnectTab = widget.Get("DIRECTCONNECT_TAB"); + directConnectTab.IsHighlighted = () => panel == PanelType.DirectConnect; + directConnectTab.OnClick = () => panel = PanelType.DirectConnect; - // Display the progress label over the server list - // The text is only visible when the list is empty - var progressText = panel.Get("PROGRESS_LABEL"); - progressText.IsVisible = () => searchStatus != SearchStatus.Hidden; - progressText.GetText = ProgressLabelText; + var createServerTab = widget.Get("CREATE_TAB"); + createServerTab.IsHighlighted = () => panel == PanelType.CreateServer; + createServerTab.OnClick = () => panel = PanelType.CreateServer; - var showWaitingCheckbox = panel.GetOrNull("WAITING_FOR_PLAYERS"); - if (showWaitingCheckbox != null) - { - showWaitingCheckbox.IsChecked = () => showWaiting; - showWaitingCheckbox.OnClick = () => { showWaiting ^= true; RefreshServerList(); }; - } - - var showEmptyCheckbox = panel.GetOrNull("EMPTY"); - if (showEmptyCheckbox != null) - { - showEmptyCheckbox.IsChecked = () => showEmpty; - showEmptyCheckbox.OnClick = () => { showEmpty ^= true; RefreshServerList(); }; - } - - var showAlreadyStartedCheckbox = panel.GetOrNull("ALREADY_STARTED"); - if (showAlreadyStartedCheckbox != null) - { - showAlreadyStartedCheckbox.IsChecked = () => showStarted; - showAlreadyStartedCheckbox.OnClick = () => { showStarted ^= true; RefreshServerList(); }; - } - - var showProtectedCheckbox = panel.GetOrNull("PASSWORD_PROTECTED"); - if (showProtectedCheckbox != null) - { - showProtectedCheckbox.IsChecked = () => showProtected; - showProtectedCheckbox.OnClick = () => { showProtected ^= true; RefreshServerList(); }; - } - - var showIncompatibleCheckbox = panel.GetOrNull("INCOMPATIBLE_VERSION"); - if (showIncompatibleCheckbox != null) - { - showIncompatibleCheckbox.IsChecked = () => showIncompatible; - showIncompatibleCheckbox.OnClick = () => { showIncompatible ^= true; RefreshServerList(); }; - } - - Game.LoadWidget(null, "GLOBALCHAT_PANEL", panel.Get("GLOBALCHAT_ROOT"), new WidgetArgs()); + widget.Get("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); }; + Game.LoadWidget(null, "GLOBALCHAT_PANEL", widget.Get("GLOBALCHAT_ROOT"), new WidgetArgs()); RefreshServerList(); @@ -152,6 +123,158 @@ 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()); + browserPanel.IsVisible = () => panel == PanelType.Browser; + + 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 filtersPanel = Ui.LoadWidget("MULTIPLAYER_FILTER_PANEL", null, new WidgetArgs()); + var showWaitingCheckbox = filtersPanel.GetOrNull("WAITING_FOR_PLAYERS"); + if (showWaitingCheckbox != null) + { + showWaitingCheckbox.IsChecked = () => showWaiting; + showWaitingCheckbox.OnClick = () => { showWaiting ^= true; RefreshServerList(); }; + } + + var showEmptyCheckbox = filtersPanel.GetOrNull("EMPTY"); + if (showEmptyCheckbox != null) + { + showEmptyCheckbox.IsChecked = () => showEmpty; + showEmptyCheckbox.OnClick = () => { showEmpty ^= true; RefreshServerList(); }; + } + + var showAlreadyStartedCheckbox = filtersPanel.GetOrNull("ALREADY_STARTED"); + if (showAlreadyStartedCheckbox != null) + { + showAlreadyStartedCheckbox.IsChecked = () => showStarted; + showAlreadyStartedCheckbox.OnClick = () => { showStarted ^= true; RefreshServerList(); }; + } + + var showProtectedCheckbox = filtersPanel.GetOrNull("PASSWORD_PROTECTED"); + if (showProtectedCheckbox != null) + { + showProtectedCheckbox.IsChecked = () => showProtected; + showProtectedCheckbox.OnClick = () => { showProtected ^= true; RefreshServerList(); }; + } + + var showIncompatibleCheckbox = filtersPanel.GetOrNull("INCOMPATIBLE_VERSION"); + if (showIncompatibleCheckbox != null) + { + showIncompatibleCheckbox.IsChecked = () => showIncompatible; + showIncompatibleCheckbox.OnClick = () => { showIncompatible ^= true; RefreshServerList(); }; + } + + 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) + mapTitle.GetText = () => currentMap != null ? currentMap.Title : "No Server Selected"; + + 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.GetText = () => currentServer.ModLabel; + modVersion.GetColor = () => currentServer.IsCompatible ? modVersion.TextColor : incompatibleVersionColor; + } + + var players = widget.GetOrNull("SELECTED_PLAYERS"); + if (players != null) + { + players.IsVisible = () => currentServer != null; + players.GetText = () => PlayersLabel(currentServer); + } + } + + void LoadDirectConnectPanel(Widget widget) + { + var directConnectPanel = Game.LoadWidget(null, "MULTIPLAYER_DIRECTCONNECT_PANEL", + widget.Get("TOP_PANELS_ROOT"), new WidgetArgs()); + directConnectPanel.IsVisible = () => panel == PanelType.DirectConnect; + + var ipField = directConnectPanel.Get("IP"); + var portField = directConnectPanel.Get("PORT"); + + var last = Game.Settings.Player.LastServer.Split(':'); + ipField.Text = last.Length > 1 ? last[0] : "localhost"; + portField.Text = last.Length == 2 ? last[1] : "1234"; + + directConnectPanel.Get("JOIN_BUTTON").OnClick = () => + { + var port = Exts.WithDefault(1234, () => Exts.ParseIntegerInvariant(portField.Text)); + + Game.Settings.Player.LastServer = "{0}:{1}".F(ipField.Text, port); + Game.Settings.Save(); + + ConnectionLogic.Connect(ipField.Text, port, "", OpenLobby, DoNothing); + }; + } + + void LoadCreateServerPanel(Widget widget) + { + var createServerPanel = Game.LoadWidget(null, "MULTIPLAYER_CREATESERVER_PANEL", + widget.Get("TOP_PANELS_ROOT"), new WidgetArgs + { + { "openLobby", OpenLobby }, + { "onExit", DoNothing } + }); + + createServerPanel.IsVisible = () => panel == PanelType.CreateServer; + } + + string PlayersLabel(GameServer game) + { + return "{0}{1}{2}".F( + "{0} Player{1}".F(game.Players > 0 ? game.Players.ToString() : "No", game.Players != 1 ? "s" : ""), + game.Bots > 0 ? ", {0} Bot{1}".F(game.Bots, game.Bots != 1 ? "s" : "") : "", + game.Spectators > 0 ? ", {0} Spectator{1}".F(game.Spectators, game.Spectators != 1 ? "s" : "") : ""); + } + void RefreshServerList() { // Query in progress @@ -196,6 +319,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic return 1; } + void SelectServer(GameServer server) + { + currentServer = server; + currentMap = server != null ? Game.ModData.MapCache[server.Map] : null; + } + void RefreshServerListInner(IEnumerable games) { if (games == null) @@ -205,6 +334,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic .OrderByDescending(g => GroupSortOrder(g.First())) .ThenByDescending(g => g.Count()); + ScrollItemWidget nextServerRow = null; var rows = new List(); foreach (var modGames in mods) { @@ -224,49 +354,39 @@ namespace OpenRA.Mods.Common.Widgets.Logic continue; var canJoin = game.IsJoinable; - var compatible = game.IsCompatible; - - var item = ScrollItemWidget.Setup(serverTemplate, () => currentServer == game, () => currentServer = game, () => Join(game)); - - var map = Game.ModData.MapCache[game.Map]; - var preview = item.GetOrNull("MAP_PREVIEW"); - if (preview != null) - preview.Preview = () => map; - + var item = ScrollItemWidget.Setup(serverTemplate, () => currentServer == game, () => SelectServer(game), () => Join(game)); var title = item.GetOrNull("TITLE"); if (title != null) { title.GetText = () => game.Name; - title.GetColor = () => !compatible ? incompatibleGameColor : !canJoin ? cantJoinGameColor : title.TextColor; + title.GetColor = () => canJoin ? title.TextColor : incompatibleGameColor; } - var maptitle = item.GetOrNull("MAP"); - if (maptitle != null) + var password = item.GetOrNull("PASSWORD_PROTECTED"); + if (password != null) { - maptitle.GetText = () => map.Title; - maptitle.GetColor = () => !compatible ? Color.DarkGray : !canJoin ? Color.LightGray : maptitle.TextColor; + password.IsVisible = () => game.Protected; + password.GetImageName = () => canJoin ? "protected" : "protected-disabled"; } var players = item.GetOrNull("PLAYERS"); if (players != null) { players.GetText = () => "{0} / {1}".F(game.Players, game.MaxPlayers) - + (game.Spectators > 0 ? " ({0} Spectator{1})".F(game.Spectators, game.Spectators > 1 ? "s" : "") : ""); - players.GetColor = () => !compatible ? incompatibleGameColor : !canJoin ? cantJoinGameColor : players.TextColor; + + (game.Spectators > 0 ? " + {0}".F(game.Spectators) : ""); + + players.GetColor = () => canJoin ? players.TextColor : incompatibleGameColor; } - var state = item.GetOrNull("STATE"); + var state = item.GetOrNull("STATUS"); if (state != null) { - state.GetText = () => GetStateLabel(game); - state.GetColor = () => GetStateColor(game, state, !compatible || !canJoin); - } + var label = game.State >= (int)ServerState.GameStarted ? + "Playing" : "Waiting"; + state.GetText = () => label; - var ip = item.GetOrNull("IP"); - if (ip != null) - { - ip.GetText = () => game.Address; - ip.GetColor = () => !compatible ? incompatibleGameColor : !canJoin ? cantJoinGameColor : ip.TextColor; + var color = GetStateColor(game, state, !canJoin); + state.GetColor = () => color; } var location = item.GetOrNull("LOCATION"); @@ -274,9 +394,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic { var cachedServerLocation = GeoIP.LookupCountry(game.Address.Split(':')[0]); location.GetText = () => cachedServerLocation; - location.GetColor = () => !compatible ? incompatibleGameColor : !canJoin ? cantJoinGameColor : location.TextColor; + location.GetColor = () => canJoin ? location.TextColor : incompatibleGameColor; } + if (currentServer != null && game.Address == currentServer.Address) + nextServerRow = item; + rows.Add(item); } } @@ -284,7 +407,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic Game.RunAfterTick(() => { serverList.RemoveChildren(); - currentServer = null; + SelectServer(null); if (games == null) { @@ -292,13 +415,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic return; } - if (!games.Any()) + if (!rows.Any()) { searchStatus = SearchStatus.NoGames; return; } - currentServer = games.FirstOrDefault(); searchStatus = SearchStatus.Hidden; // Search for any unknown maps @@ -307,28 +429,39 @@ namespace OpenRA.Mods.Common.Widgets.Logic foreach (var row in rows) serverList.AddChild(row); + + if (nextServerRow != null) + nextServerRow.OnClick(); }); } void OpenLobby() { + // Close the multiplayer browser + Ui.CloseWindow(); + + Action onLobbyExit = () => + { + // Open a fresh copy of the multiplayer browser + Ui.OpenWindow("MULTIPLAYER_PANEL", new WidgetArgs + { + { "onStart", onStart }, + { "onExit", onExit }, + { "directConnectHost", null }, + { "directConnectPort", 0 }, + }); + + Game.Disconnect(); + }; + Game.OpenWindow("SERVER_LOBBY", new WidgetArgs { - { "onExit", Game.Disconnect }, { "onStart", onStart }, + { "onExit", onLobbyExit }, { "skirmishMode", false } }); } - void OpenDirectConnectPanel() - { - Ui.OpenWindow("DIRECTCONNECT_PANEL", new WidgetArgs - { - { "openLobby", OpenLobby }, - { "onExit", DoNothing } - }); - } - void OpenCreateServerPanel() { Ui.OpenWindow("CREATESERVER_PANEL", new WidgetArgs @@ -365,14 +498,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic label += " for {0} minute{1}".F(totalMinutes, totalMinutes > 1 ? "s" : ""); } - return game.Protected ? label + " (Password protected)" : label; + return label; } if (game.State == (int)ServerState.WaitingPlayers) - { - var label = "Waiting for players"; - return game.Protected ? label + " (Password protected)" : label; - } + return game.Protected ? "Password protected" : "Waiting for players"; if (game.State == (int)ServerState.ShuttingDown) return "Server shutting down"; @@ -380,14 +510,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic return "Unknown server state"; } - Color GetStateColor(GameServer game, LabelWidget label, bool darkened) + Color GetStateColor(GameServer game, LabelWidget label, bool darkened = false) { + if (!game.Protected && game.State == (int)ServerState.WaitingPlayers) + return darkened ? incompatibleWaitingGameColor : waitingGameColor; + if (game.Protected && game.State == (int)ServerState.WaitingPlayers) return darkened ? incompatibleProtectedGameColor : protectedGameColor; - if (game.State == (int)ServerState.WaitingPlayers) - return darkened ? incompatibleWaitingGameColor : waitingGameColor; - if (game.State == (int)ServerState.GameStarted) return darkened ? incompatibleGameStartedColor : gameStartedColor; @@ -396,13 +526,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic bool Filtered(GameServer game) { - if ((game.State == (int)ServerState.GameStarted) && !showStarted) + if (game.State == (int)ServerState.GameStarted && !showStarted) return true; - if ((game.State == (int)ServerState.WaitingPlayers) && !showWaiting && game.Players != 0) + if (game.State == (int)ServerState.WaitingPlayers && !showWaiting && game.Players != 0) return true; - if ((game.Players == 0) && !showEmpty) + if (game.Players == 0 && !showEmpty) return true; if (!game.IsCompatible && !showIncompatible) diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs index bf2891b404..1f81894f2f 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs @@ -33,7 +33,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic var settings = Game.Settings; preview = Game.ModData.MapCache[WidgetUtils.ChooseInitialMap(Game.Settings.Server.Map)]; - panel.Get("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); }; panel.Get("CREATE_BUTTON").OnClick = CreateAndJoin; var mapButton = panel.GetOrNull("MAP_BUTTON"); @@ -132,7 +131,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic return; } - Ui.CloseWindow(); ConnectionLogic.Connect(IPAddress.Loopback.ToString(), Game.Settings.Server.ListenPort, password, onCreate, onExit); } } diff --git a/mods/cnc/chrome.yaml b/mods/cnc/chrome.yaml index 9f4a6e826a..9a2fc2709e 100644 --- a/mods/cnc/chrome.yaml +++ b/mods/cnc/chrome.yaml @@ -449,6 +449,8 @@ lobby-bits: chrome.png colorpicker: 257,33,14,14 huepicker: 388,96,7,15 kick: 386,115,11,11 + protected: 403,97,10,13 + protected-disabled: 403,113,10,13 checkbox-bits: chrome.png checked: 272,32,16,16 diff --git a/mods/cnc/chrome/createserver.yaml b/mods/cnc/chrome/createserver.yaml deleted file mode 100644 index 8888069335..0000000000 --- a/mods/cnc/chrome/createserver.yaml +++ /dev/null @@ -1,135 +0,0 @@ -Container@CREATESERVER_PANEL: - Logic: ServerCreationLogic - X: (WINDOW_RIGHT - WIDTH)/2 - Y: (WINDOW_BOTTOM - 260)/2 - Width: 521 - Height: 250 - Children: - Label@TITLE: - Text: Create Server - Width: PARENT_RIGHT - Y: 0-25 - Font: BigBold - Contrast: true - Align: Center - Background@bg: - Width: PARENT_RIGHT - Height: 215 - Background: panel-black - Children: - Background@MAP_BG: - X: PARENT_RIGHT-WIDTH-15 - Y: 15 - Width: 162 - Height: 162 - Background: panel-gray - Children: - MapPreview@MAP_PREVIEW: - X: 1 - Y: 1 - Width: 160 - Height: 160 - Label@MAP_NAME: - X: PARENT_RIGHT-WIDTH-15 - Y: PARENT_BOTTOM - 33 - Width: 162 - Height: 25 - Align: Center - Font: Bold - Label@SERVER_NAME_LABEL: - X: 15 - Y: 14 - Width: 90 - Height: 25 - Align: Right - Text: Server Name: - TextField@SERVER_NAME: - X: 110 - Y: 15 - Width: 215 - MaxLength: 50 - Height: 25 - Text: My OpenRA Server - Label@PASSWORD_LABEL: - X: 10 - Y: 49 - Width: 95 - Height: 25 - Align: Right - Text: Password: - PasswordField@PASSWORD: - X: 110 - Y: 50 - Width: 145 - MaxLength: 20 - Height: 25 - Label@AFTER_PASSWORD_LABEL: - X: 265 - Y: 49 - Width: 95 - Height: 25 - Align: Left - Text: (optional) - Label@LISTEN_PORT_LABEL: - X: 15 - Y: 84 - Width: 90 - Height: 25 - Align: Right - Text: Port: - TextField@LISTEN_PORT: - X: 110 - Y: 85 - Width: 50 - MaxLength: 5 - Height: 25 - Text: 1234 - Label@EXTERNAL_PORT_LABEL: - X: 180 - Y: 84 - Width: 90 - Height: 25 - Align: Right - Text: External Port: - TextField@EXTERNAL_PORT: - X: 275 - Y: 85 - Width: 50 - MaxLength: 5 - Height: 25 - Text: 1234 - Checkbox@ADVERTISE_CHECKBOX: - X: 110 - Y: 135 - Width: 150 - Height: 20 - Font: Regular - Text: Advertise Online - Checkbox@UPNP_CHECKBOX: - X: 110 - Y: 165 - Width: 300 - Height: 20 - Font: Regular - Text: Automatic port forwarding - Button@BACK_BUTTON: - Key: escape - X: 0 - Y: 214 - Width: 140 - Height: 35 - Text: Back - Button@MAP_BUTTON: - X: 231 - Y: 214 - Width: 140 - Height: 35 - Text: Choose Map - Button@CREATE_BUTTON: - Key: return - X: 381 - Y: 214 - Width: 140 - Height: 35 - Text: Create - diff --git a/mods/cnc/chrome/directconnect.yaml b/mods/cnc/chrome/directconnect.yaml deleted file mode 100644 index a7918dfe40..0000000000 --- a/mods/cnc/chrome/directconnect.yaml +++ /dev/null @@ -1,58 +0,0 @@ -Container@DIRECTCONNECT_PANEL: - Logic: DirectConnectLogic - X: (WINDOW_RIGHT - WIDTH)/2 - Y: (WINDOW_BOTTOM - 90)/2 - Width: 370 - Height: 130 - Children: - Label@TITLE: - Width: PARENT_RIGHT - Y: 0-25 - Font: BigBold - Contrast: true - Align: Center - Text: Connect to Server - Background@bg: - Width: 370 - Height: 95 - Background: panel-black - Children: - Label@ADDRESS_LABEL: - X: 50 - Y: 14 - Width: 95 - Height: 25 - Align: Right - Text: Address: - TextField@IP: - X: 150 - Y: 15 - Width: 200 - Height: 25 - Label@PORT_LABEL: - X: 50 - Y: 49 - Width: 95 - Height: 25 - Align: Right - Text: Port: - TextField@PORT: - X: 150 - Y: 50 - Width: 200 - Height: 25 - Button@BACK_BUTTON: - Key: escape - X: 0 - Y: 94 - Width: 140 - Height: 35 - Text: Back - Button@JOIN_BUTTON: - Key: return - X: 230 - Y: 94 - Width: 140 - Height: 35 - Text: Join - diff --git a/mods/cnc/chrome/lobby-globalchat.yaml b/mods/cnc/chrome/lobby-globalchat.yaml index cda13de434..1f3b095305 100644 --- a/mods/cnc/chrome/lobby-globalchat.yaml +++ b/mods/cnc/chrome/lobby-globalchat.yaml @@ -20,8 +20,8 @@ Container@LOBBY_GLOBALCHAT_PANEL: Font: TinyBold Align: Center ScrollPanel@HISTORY_PANEL: - Width: 582 Y: 19 + Width: 582 Height: PARENT_BOTTOM - 19 ItemSpacing: 5 Children: diff --git a/mods/cnc/chrome/multiplayer-browser.yaml b/mods/cnc/chrome/multiplayer-browser.yaml new file mode 100644 index 0000000000..fb351bdb49 --- /dev/null +++ b/mods/cnc/chrome/multiplayer-browser.yaml @@ -0,0 +1,140 @@ +Container@MULTIPLAYER_BROWSER_PANEL: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Children: + Container@LABEL_CONTAINER: + Y: 5 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + 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: 120 + Height: 25 + Text: Country + 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 + 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: 120 + Height: 25 + 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 + Children: + MapPreview@SELECTED_MAP_PREVIEW: + X: 1 + Y: 1 + Width: PARENT_RIGHT-2 + Height: PARENT_BOTTOM-2 + TooltipContainer: TOOLTIP_CONTAINER + 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 + X: PARENT_RIGHT - WIDTH + Y: 284 + Width: 174 + Height: 25 + Text: Join diff --git a/mods/cnc/chrome/multiplayer-createserver.yaml b/mods/cnc/chrome/multiplayer-createserver.yaml new file mode 100644 index 0000000000..a247ec7155 --- /dev/null +++ b/mods/cnc/chrome/multiplayer-createserver.yaml @@ -0,0 +1,129 @@ +Container@MULTIPLAYER_CREATESERVER_PANEL: + Logic: ServerCreationLogic + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Children: + Label@TITLE: + Y: 5 + Width: 582 + Height: 25 + Text: Create Server + Align: Center + Font: Bold + ScrollPanel: + Y: 30 + Width: 582 + Height: 249 + Children: + Container: + X: 185 + Y: 25 + Children: + Label@SERVER_NAME_LABEL: + Y: 14 + Width: 95 + Height: 25 + Align: Right + Text: Server Name: + TextField@SERVER_NAME: + X: 100 + Y: 15 + Width: 215 + MaxLength: 50 + Height: 25 + Text: My OpenRA Server + Label@PASSWORD_LABEL: + Y: 49 + Width: 95 + Height: 25 + Align: Right + Text: Password: + PasswordField@PASSWORD: + X: 100 + Y: 50 + Width: 145 + MaxLength: 20 + Height: 25 + Label@AFTER_PASSWORD_LABEL: + X: 255 + Y: 49 + Width: 95 + Height: 25 + Align: Left + Text: (optional) + Label@LISTEN_PORT_LABEL: + Y: 84 + Width: 95 + Height: 25 + Align: Right + Text: Port: + TextField@LISTEN_PORT: + X: 100 + Y: 85 + Width: 50 + Height: 25 + MaxLength: 5 + Text: 1234 + Label@EXTERNAL_PORT_LABEL: + X: 170 + Y: 84 + Width: 90 + Height: 25 + Align: Right + Text: External Port: + TextField@EXTERNAL_PORT: + X: 265 + Y: 85 + Width: 50 + MaxLength: 5 + Height: 25 + Text: 1234 + Checkbox@ADVERTISE_CHECKBOX: + X: 100 + Y: 135 + Width: 150 + Height: 20 + Font: Regular + Text: Advertise Online + Checkbox@UPNP_CHECKBOX: + X: 100 + Y: 165 + Width: 300 + Height: 20 + Font: Regular + Text: Automatic port forwarding + Container@SIDEBAR: + X: PARENT_RIGHT-WIDTH + Y: 30 + Width: 174 + Height: 280 + Children: + Background@MAP_BG: + Width: PARENT_RIGHT + Height: 174 + Background: panel-gray + Children: + MapPreview@MAP_PREVIEW: + X: 1 + Y: 1 + Width: PARENT_RIGHT - 2 + Height: PARENT_RIGHT - 2 + Label@MAP_NAME: + Y: 172 + Width: PARENT_RIGHT + Height: 25 + Font: Bold + Align: Center + Button@MAP_BUTTON: + X: PARENT_RIGHT - WIDTH + Y: 284-30 + Width: 174 + Height: 25 + Text: Choose Map + Button@CREATE_BUTTON: + Key: return + X: PARENT_RIGHT - WIDTH + Y: 284 + Width: 174 + Height: 25 + Text: Create diff --git a/mods/cnc/chrome/multiplayer-directconnect.yaml b/mods/cnc/chrome/multiplayer-directconnect.yaml new file mode 100644 index 0000000000..5d54a63e09 --- /dev/null +++ b/mods/cnc/chrome/multiplayer-directconnect.yaml @@ -0,0 +1,95 @@ +Container@MULTIPLAYER_DIRECTCONNECT_PANEL: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Children: + Label@TITLE: + Y: 5 + Width: 582 + Height: 25 + Text: Connect to Server + Align: Center + Font: Bold + ScrollPanel: + Y: 30 + Width: 582 + Height: 249 + Children: + Container: + X: 185 + Y: 60 + Children: + Label@ADDRESS_LABEL: + Y: 14 + Width: 95 + Height: 25 + Align: Right + Text: Address: + TextField@IP: + X: 100 + Y: 15 + Width: 215 + Height: 25 + Label@PORT_LABEL: + Y: 49 + Width: 95 + Height: 25 + Align: Right + Text: Port: + TextField@PORT: + X: 100 + Y: 50 + Width: 50 + Height: 25 + MaxLength: 5 + Container@SIDEBAR: + X: PARENT_RIGHT-WIDTH + Y: 30 + Width: 174 + Height: 280 + Children: + Background@MAP_BG: + Width: PARENT_RIGHT + Height: 174 + Background: panel-gray + Label@TITLE: + Y: 172 + Width: PARENT_RIGHT + Height: 25 + Font: Bold + Align: Center + Text: Direct Connect + Label@DESCA: + Y: 190 + Width: PARENT_RIGHT + Height: 25 + Font: Tiny + Align: Center + Text: Enter the server IP and port in the + Label@DESCB: + Y: 203 + Width: PARENT_RIGHT + Height: 25 + Font: Tiny + Align: Center + Text: fields to the left, and then press Join. + Label@DESCC: + Y: 216 + Width: PARENT_RIGHT + Height: 25 + Font: Tiny + Align: Center + Text: The mod and game version will be + Label@DESCD: + Y: 229 + Width: PARENT_RIGHT + Height: 25 + Font: Tiny + Align: Center + Text: verified when connecting. + Button@JOIN_BUTTON: + Key: return + X: PARENT_RIGHT - WIDTH + Y: 284 + Width: 174 + Height: 25 + Text: Join diff --git a/mods/cnc/chrome/globalchat.yaml b/mods/cnc/chrome/multiplayer-globalchat.yaml similarity index 86% rename from mods/cnc/chrome/globalchat.yaml rename to mods/cnc/chrome/multiplayer-globalchat.yaml index fb23ac5d0c..4bb61bd9c7 100644 --- a/mods/cnc/chrome/globalchat.yaml +++ b/mods/cnc/chrome/multiplayer-globalchat.yaml @@ -8,7 +8,7 @@ Container@GLOBALCHAT_PANEL: Height: PARENT_BOTTOM Children: Background@TOPIC: - Width: 565 + Width: 582 Height: 20 Background: panel-transparent Children: @@ -20,8 +20,8 @@ Container@GLOBALCHAT_PANEL: Font: TinyBold Align: Center ScrollPanel@HISTORY_PANEL: - Width: 565 Y: 19 + Width: 582 Height: PARENT_BOTTOM - 49 ItemSpacing: 5 Children: @@ -32,11 +32,19 @@ Container@GLOBALCHAT_PANEL: WordWrap: True TextField@CHAT_TEXTFIELD: Y: PARENT_BOTTOM - 25 - Width: 565 + Width: 582 Height: 25 + LeftMargin: 60 + Children: + Label@LABEL_CHATTYPE: + Y: 0-1 + Width: 55 + Height: 25 + Align: Right + Text: Global: ScrollPanel@NICKNAME_PANEL: - X: 570 - Width: 130 + X: PARENT_RIGHT-WIDTH + Width: 174 Height: PARENT_BOTTOM - 30 Children: Container@NICKNAME_TEMPLATE: @@ -53,11 +61,11 @@ Container@GLOBALCHAT_PANEL: Width: PARENT_RIGHT-15 Height: 20 Button@DISCONNECT_BUTTON: - X: 570 + X: PARENT_RIGHT-WIDTH Y: PARENT_BOTTOM - 25 - Width: 130 + Width: 174 Height: 25 - Text: Disconnect + Text: Leave Chat Font: Bold Background@GLOBALCHAT_CONNECT_PANEL: Width: PARENT_RIGHT diff --git a/mods/cnc/chrome/multiplayer.yaml b/mods/cnc/chrome/multiplayer.yaml new file mode 100644 index 0000000000..a3ecb9f48d --- /dev/null +++ b/mods/cnc/chrome/multiplayer.yaml @@ -0,0 +1,111 @@ +Container@MULTIPLAYER_PANEL: + Logic: MultiplayerLogic + X: (WINDOW_RIGHT - WIDTH)/2 + Y: (WINDOW_BOTTOM - 560)/2 + Width: 800 + Height: 575 + 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: 147 + Height: 25 + Text: Filter Games + Button@REFRESH_BUTTON: + X: 167 + Y: 284 + Width: 100 + Height: 25 + Text: Refresh + Button@BROWSER_TAB: + X: 272 + Y: 278 + Width: 105 + Height: 31 + Text: Browse + Button@DIRECTCONNECT_TAB: + X: 382 + Y: 278 + Width: 105 + Height: 31 + Text: Direct IP + Button@CREATE_TAB: + X: 492 + Y: 278 + Width: 105 + Height: 31 + Text: Create + Container@TOP_PANELS_ROOT: + X: 15 + Width: PARENT_RIGHT - 30 + Height: PARENT_BOTTOM + Container@GLOBALCHAT_ROOT: + X: 15 + Y: 315 + Width: PARENT_RIGHT - 30 + Height: PARENT_BOTTOM - 330 + 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: 137 + Height: 20 + Text: Waiting + TextColor: 50,205,50 + Font: Regular + Checkbox@EMPTY: + X: 5 + Y: 30 + Width: 137 + Height: 20 + Text: Empty + Font: Regular + Checkbox@PASSWORD_PROTECTED: + X: 5 + Y: 55 + Width: 137 + Height: 20 + Text: Protected + TextColor: 255,0,0 + Font: Regular + Checkbox@ALREADY_STARTED: + X: 5 + Y: 80 + Width: 137 + Height: 20 + Text: Started + TextColor: 255,165,0 + Font: Regular + Checkbox@INCOMPATIBLE_VERSION: + X: 5 + Y: 105 + Width: 137 + Height: 20 + Text: Incompatible + TextColor: 190,190,190 + Font: Regular \ No newline at end of file diff --git a/mods/cnc/chrome/serverbrowser.yaml b/mods/cnc/chrome/serverbrowser.yaml deleted file mode 100644 index 431baa27b8..0000000000 --- a/mods/cnc/chrome/serverbrowser.yaml +++ /dev/null @@ -1,170 +0,0 @@ -Container@SERVERBROWSER_PANEL: - Logic: ServerBrowserLogic - X: (WINDOW_RIGHT - WIDTH)/2 - Y: (WINDOW_BOTTOM - HEIGHT)/2 - Width: 730 - Height: 595 - Children: - Label@TITLE: - Text: Multiplayer - Width: 740 - Y: 0-10 - Font: BigBold - Contrast: true - Align: Center - Background@bg: - Width: 730 - Height: PARENT_BOTTOM - 30 - Background: panel-black - Y: 15 - Children: - Container@GLOBALCHAT_ROOT: - X: 15 - Y: 15 - Width: 700 - Height: 260 - ScrollPanel@SERVER_LIST: - X: 15 - Y: 280 - Width: 700 - Height: 240 - Children: - ScrollItem@HEADER_TEMPLATE: - Width: PARENT_RIGHT-27 - Height: 25 - X: 2 - Visible: false - Children: - Label@LABEL: - Y: 0-1 - Font: Bold - Width: PARENT_RIGHT - Height: 25 - Align: Center - ScrollItem@SERVER_TEMPLATE: - Width: PARENT_RIGHT-27 - Height: 68 - X: 2 - Y: 0 - Children: - MapPreview@MAP_PREVIEW: - X: 2 - Y: 2 - Width: 64 - Height: 64 - ShowSpawnPoints: no - Label@TITLE: - X: 70 - Width: 200 - Height: 25 - Font: Bold - Label@MAP: - X: 70 - Y: 20 - Width: 250 - Height: 25 - Label@PLAYERS: - X: 70 - Y: 40 - Width: 50 - Height: 25 - Label@STATE: - Width: 140 - X: PARENT_RIGHT-150 - Align: Right - Height: 25 - Font: Bold - Label@IP: - Width: 140 - X: PARENT_RIGHT-150 - Y: 20 - Align: Right - Height: 25 - Label@LOCATION: - Width: 140 - X: PARENT_RIGHT-150 - Y: 40 - Align: Right - Height: 25 - Label@PROGRESS_LABEL: - X: (PARENT_RIGHT - WIDTH) / 2 - Y: PARENT_BOTTOM / 2 - HEIGHT + (280 / 2) - Width: 710 - Height: 25 - Font: Bold - Align: Center - Visible: false - Label@SHOW_LABEL_TITLE: - X: 20 - Y: 525 - Width: 20 - Height: 25 - Text: Show: - Font: Bold - Checkbox@WAITING_FOR_PLAYERS: - X: 80 - Y: 527 - Width: 100 - Height: 20 - Text: Waiting - TextColor: 50,205,50 - Checkbox@EMPTY: - X: 180 - Y: 527 - Width: 100 - Height: 20 - Text: Empty - Checkbox@PASSWORD_PROTECTED: - X: 270 - Y: 527 - Width: 100 - Height: 20 - Text: Protected - TextColor: 255,0,0 - Checkbox@ALREADY_STARTED: - X: 385 - Y: 527 - Width: 100 - Height: 20 - Text: Started - TextColor: 255,165,0 - Checkbox@INCOMPATIBLE_VERSION: - X: 480 - Y: 527 - Width: 100 - Height: 20 - Text: Incompatible - TextColor: 190,190,190 - Button@REFRESH_BUTTON: - X: PARENT_RIGHT - WIDTH - 15 - Y: 525 - Width: 100 - Height: 25 - Text: Refresh - Button@BACK_BUTTON: - Key: escape - X: 0 - Y: PARENT_BOTTOM - 16 - Width: 140 - Height: 35 - Text: Back - Button@CREATE_BUTTON: - X: PARENT_RIGHT - 140 - 10 - 140 - 10 - 140 - Y: PARENT_BOTTOM - 16 - Width: 140 - Height: 35 - Text: Create - Button@DIRECTCONNECT_BUTTON: - X: PARENT_RIGHT - 140 - 10 - 140 - Y: PARENT_BOTTOM - 16 - Width: 140 - Height: 35 - Text: Direct IP - Button@JOIN_BUTTON: - Key: return - X: PARENT_RIGHT - 140 - Y: PARENT_BOTTOM - 16 - Width: 140 - Height: 35 - Text: Join - diff --git a/mods/cnc/metrics.yaml b/mods/cnc/metrics.yaml index b221d9049f..222f8a3e6a 100644 --- a/mods/cnc/metrics.yaml +++ b/mods/cnc/metrics.yaml @@ -26,8 +26,8 @@ Metrics: SpawnColor: 255,255,255 SpawnContrastColor: 0,0,0 SpawnLabelOffset: 0,1 + IncompatibleVersionColor: 255,0,0 IncompatibleGameColor: 169,169,169 - CantJoinGameColor: 211,211,211 ProtectedGameColor: 255,0,0 IncompatibleProtectedGameColor: 139,0,0 WaitingGameColor: 0,255,0 diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 4220f8d721..47669e350d 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -91,9 +91,11 @@ Assemblies: ChromeLayout: ./mods/cnc/chrome/mainmenu.yaml - ./mods/cnc/chrome/serverbrowser.yaml - ./mods/cnc/chrome/createserver.yaml - ./mods/cnc/chrome/directconnect.yaml + ./mods/cnc/chrome/multiplayer.yaml + ./mods/cnc/chrome/multiplayer-browser.yaml + ./mods/cnc/chrome/multiplayer-createserver.yaml + ./mods/cnc/chrome/multiplayer-directconnect.yaml + ./mods/cnc/chrome/multiplayer-globalchat.yaml ./mods/cnc/chrome/lobby.yaml ./mods/cnc/chrome/lobby-mappreview.yaml ./mods/cnc/chrome/lobby-players.yaml @@ -123,7 +125,6 @@ ChromeLayout: ./mods/cnc/chrome/assetbrowser.yaml ./mods/cnc/chrome/missionbrowser.yaml ./mods/cnc/chrome/editor.yaml - ./mods/cnc/chrome/globalchat.yaml Voices: ./mods/cnc/audio/voices.yaml diff --git a/mods/cnc/uibits/chrome.png b/mods/cnc/uibits/chrome.png index d0d555297e..7080da5ef0 100644 Binary files a/mods/cnc/uibits/chrome.png and b/mods/cnc/uibits/chrome.png differ diff --git a/mods/d2k/chrome.yaml b/mods/d2k/chrome.yaml index e354ae0813..70cf4f8567 100644 --- a/mods/d2k/chrome.yaml +++ b/mods/d2k/chrome.yaml @@ -155,6 +155,8 @@ lobby-bits: spawnpoints.png admin: 64,5,7,5 colorpicker: 5,5,22,22 huepicker: 71,0,7,15 + protected: 79,0,10,13 + protected-disabled: 90,0,10,13 strategic: strategic.png unowned: 0,0,32,32 diff --git a/mods/d2k/metrics.yaml b/mods/d2k/metrics.yaml index 351ec7393b..d6f47cfa80 100644 --- a/mods/d2k/metrics.yaml +++ b/mods/d2k/metrics.yaml @@ -26,8 +26,8 @@ Metrics: SpawnColor: 255,255,255 SpawnContrastColor: 0,0,0 SpawnLabelOffset: 0,1 + IncompatibleVersionColor: 255,0,0 IncompatibleGameColor: 169,169,169 - CantJoinGameColor: 211,211,211 ProtectedGameColor: 255,0,0 IncompatibleProtectedGameColor: 139,0,0 WaitingGameColor: 0,255,0 diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index d3dc0ced77..047b0290c9 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -93,11 +93,12 @@ ChromeLayout: ./mods/ra/chrome/lobby-globalchat.yaml ./mods/d2k/chrome/color-picker.yaml ./mods/ra/chrome/map-chooser.yaml - ./mods/ra/chrome/create-server.yaml - ./mods/ra/chrome/serverbrowser.yaml + ./mods/ra/chrome/multiplayer.yaml + ./mods/ra/chrome/multiplayer-browser.yaml + ./mods/ra/chrome/multiplayer-createserver.yaml + ./mods/ra/chrome/multiplayer-directconnect.yaml + ./mods/ra/chrome/multiplayer-globalchat.yaml ./mods/ra/chrome/connection.yaml - ./mods/ra/chrome/directconnect.yaml - ./mods/ra/chrome/replaybrowser.yaml ./mods/d2k/chrome/dropdowns.yaml ./mods/ra/chrome/musicplayer.yaml ./mods/d2k/chrome/tooltips.yaml @@ -105,7 +106,6 @@ ChromeLayout: ./mods/d2k/chrome/missionbrowser.yaml ./mods/ra/chrome/confirmation-dialogs.yaml ./mods/ra/chrome/editor.yaml - ./mods/ra/chrome/globalchat.yaml Weapons: ./mods/d2k/weapons.yaml diff --git a/mods/ra/chrome.yaml b/mods/ra/chrome.yaml index 3179ad2a68..4506d38ed1 100644 --- a/mods/ra/chrome.yaml +++ b/mods/ra/chrome.yaml @@ -461,6 +461,8 @@ lobby-bits: spawnpoints.png admin: 64,5,7,5 colorpicker: 5,5,22,22 huepicker: 71,0,7,15 + protected: 79,0,10,13 + protected-disabled: 90,0,10,13 strategic: strategic.png unowned: 0,0,32,32 diff --git a/mods/ra/chrome/create-server.yaml b/mods/ra/chrome/create-server.yaml deleted file mode 100644 index 90773e17ab..0000000000 --- a/mods/ra/chrome/create-server.yaml +++ /dev/null @@ -1,105 +0,0 @@ -Background@CREATESERVER_PANEL: - Logic: ServerCreationLogic - X: (WINDOW_RIGHT - WIDTH)/2 - Y: (WINDOW_BOTTOM - HEIGHT)/2 - Width: 400 - Height: 300 - Children: - Label@LABEL_TITLE: - X: 0 - Y: 20 - Width: 400 - Height: 25 - Text: Create Server - Align: Center - Font: Bold - Label@SERVER_NAME_LABEL: - X: 50 - Y: 59 - Width: 95 - Height: 25 - Align: Right - Text: Game Title: - TextField@SERVER_NAME: - X: 150 - Y: 60 - Width: 210 - MaxLength: 50 - Height: 25 - Text: OpenRA Game - Label@PASSWORD_LABEL: - X: 50 - Y: 94 - Width: 95 - Height: 25 - Align: Right - Text: Password: - PasswordField@PASSWORD: - X: 150 - Y: 95 - Width: 145 - MaxLength: 20 - Height: 25 - Label@AFTER_PASSWORD_LABEL: - X: 300 - Y: 94 - Width: 95 - Height: 25 - Align: Left - Text: (optional) - Label@EXTERNAL_PORT_LABEL: - X: 50 - Y: 129 - Width: 95 - Height: 25 - Align: Right - Text: External Port: - TextField@EXTERNAL_PORT: - X: 150 - Y: 130 - Width: 50 - MaxLength: 5 - Height: 25 - Text: OpenRA Game - Label@LISTEN_PORT_LABEL: - X: 210 - Y: 129 - Width: 95 - Height: 25 - Align: Right - Text: Listen Port: - TextField@LISTEN_PORT: - X: 310 - Y: 130 - Width: 50 - MaxLength: 5 - Height: 25 - Checkbox@UPNP_CHECKBOX: - X: 150 - Y: 165 - Width: 300 - Height: 20 - Text: Automatic port forwarding - Checkbox@ADVERTISE_CHECKBOX: - X: 150 - Y: 200 - Width: 300 - Height: 20 - Text: Advertise game Online - Button@CREATE_BUTTON: - X: 130 - Y: PARENT_BOTTOM - 45 - Width: 120 - Height: 25 - Text: Create - Font: Bold - Key: return - Button@BACK_BUTTON: - X: 260 - Y: PARENT_BOTTOM - 45 - Width: 120 - Height: 25 - Text: Cancel - Font: Bold - Key: escape - diff --git a/mods/ra/chrome/directconnect.yaml b/mods/ra/chrome/directconnect.yaml deleted file mode 100644 index f27b00781c..0000000000 --- a/mods/ra/chrome/directconnect.yaml +++ /dev/null @@ -1,51 +0,0 @@ -Background@DIRECTCONNECT_PANEL: - Logic: DirectConnectLogic - X: (WINDOW_RIGHT - WIDTH)/2 - Y: (WINDOW_BOTTOM - HEIGHT)/2 - Width: 400 - Height: 150 - Children: - Label@DIRECTCONNECT_LABEL_TITLE: - X: 0 - Y: 20 - Width: 400 - Height: 25 - Text: Connect to Server - Align: Center - Font: Bold - Label@ADDRESS_LABEL: - X: 50 - Y: 59 - Width: 95 - Height: 25 - Align: Right - Text: Server Address: - TextField@IP: - X: 150 - Y: 60 - Width: 160 - MaxLength: 50 - Height: 25 - TextField@PORT: - X: 315 - Y: 60 - Width: 55 - MaxLength: 5 - Height: 25 - Button@JOIN_BUTTON: - X: 130 - Y: PARENT_BOTTOM - 45 - Width: 120 - Height: 25 - Text: Join - Font: Bold - Key: return - Button@BACK_BUTTON: - X: 260 - Y: PARENT_BOTTOM - 45 - Width: 120 - Height: 25 - Text: Cancel - Font: Bold - Key: escape - diff --git a/mods/ra/chrome/lobby-globalchat.yaml b/mods/ra/chrome/lobby-globalchat.yaml index 63e96e0047..9d9ab38ca1 100644 --- a/mods/ra/chrome/lobby-globalchat.yaml +++ b/mods/ra/chrome/lobby-globalchat.yaml @@ -49,8 +49,8 @@ Container@LOBBY_GLOBALCHAT_PANEL: Height: PARENT_BOTTOM - 30 Children: Container@NICKNAME_TEMPLATE: - Height: 20 Width: PARENT_RIGHT-25 + Height: 20 Children: Image@INDICATOR: ImageCollection: lobby-bits diff --git a/mods/ra/chrome/lobby.yaml b/mods/ra/chrome/lobby.yaml index bf0c684d3f..24f17b051a 100644 --- a/mods/ra/chrome/lobby.yaml +++ b/mods/ra/chrome/lobby.yaml @@ -7,11 +7,10 @@ Background@SERVER_LOBBY: Children: ColorPreviewManager@COLOR_MANAGER: Label@SERVER_NAME: - X: 0 Y: 15 Align: Center Width: PARENT_RIGHT - Height: 20 + Height: 25 Font: Bold Container@MAP_PREVIEW_ROOT: X: PARENT_RIGHT-20-WIDTH @@ -85,9 +84,9 @@ Background@SERVER_LOBBY: ItemSpacing: 2 Children: Container@CHAT_TEMPLATE: + X: 2 Width: PARENT_RIGHT-27 Height: 16 - X: 2 Children: Label@TIME: X: 3 diff --git a/mods/ra/chrome/multiplayer-browser.yaml b/mods/ra/chrome/multiplayer-browser.yaml new file mode 100644 index 0000000000..d7623af41e --- /dev/null +++ b/mods/ra/chrome/multiplayer-browser.yaml @@ -0,0 +1,142 @@ +Container@MULTIPLAYER_BROWSER_PANEL: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Children: + Container@LABEL_CONTAINER: + Y: 5 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + 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: 120 + Height: 25 + Text: Country + Font: Bold + Label@STATUS: + X: 495 + Width: 50 + Height: 25 + Text: Status + Font: Bold + ScrollPanel@SERVER_LIST: + Y: 30 + Width: 583 + Height: 249 + TopBottomSpacing: 2 + Children: + ScrollItem@HEADER_TEMPLATE: + X: 2 + Width: PARENT_RIGHT-27 + Height: 20 + BaseName: scrollheader + Visible: false + Children: + Label@LABEL: + Y: 0-1 + Font: TinyBold + Width: PARENT_RIGHT + Height: 20 + Align: Center + ScrollItem@SERVER_TEMPLATE: + X: 2 + Width: PARENT_RIGHT-27 + Height: 25 + 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: 120 + Height: 25 + 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: dialog3 + Children: + MapPreview@SELECTED_MAP_PREVIEW: + X: 1 + Y: 1 + Width: PARENT_RIGHT-2 + Height: PARENT_BOTTOM-2 + TooltipContainer: TOOLTIP_CONTAINER + 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 + X: PARENT_RIGHT - WIDTH + Y: 284 + Width: 174 + Height: 25 + Text: Join + Font: Bold diff --git a/mods/ra/chrome/multiplayer-createserver.yaml b/mods/ra/chrome/multiplayer-createserver.yaml new file mode 100644 index 0000000000..838e762ec1 --- /dev/null +++ b/mods/ra/chrome/multiplayer-createserver.yaml @@ -0,0 +1,131 @@ +Container@MULTIPLAYER_CREATESERVER_PANEL: + Logic: ServerCreationLogic + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Children: + Label@TITLE: + Y: 5 + Width: 582 + Height: 25 + Text: Create Server + Align: Center + Font: Bold + ScrollPanel: + Y: 30 + Width: 583 + Height: 249 + Children: + Container: + X: 185 + Y: 25 + Children: + Label@SERVER_NAME_LABEL: + Y: 14 + Width: 95 + Height: 25 + Align: Right + Text: Server Name: + TextField@SERVER_NAME: + X: 100 + Y: 15 + Width: 215 + MaxLength: 50 + Height: 25 + Text: My OpenRA Server + Label@PASSWORD_LABEL: + Y: 49 + Width: 95 + Height: 25 + Align: Right + Text: Password: + PasswordField@PASSWORD: + X: 100 + Y: 50 + Width: 145 + MaxLength: 20 + Height: 25 + Label@AFTER_PASSWORD_LABEL: + X: 255 + Y: 49 + Width: 95 + Height: 25 + Align: Left + Text: (optional) + Label@LISTEN_PORT_LABEL: + Y: 84 + Width: 95 + Height: 25 + Align: Right + Text: Port: + TextField@LISTEN_PORT: + X: 100 + Y: 85 + Width: 50 + Height: 25 + MaxLength: 5 + Text: 1234 + Label@EXTERNAL_PORT_LABEL: + X: 170 + Y: 84 + Width: 90 + Height: 25 + Align: Right + Text: External Port: + TextField@EXTERNAL_PORT: + X: 265 + Y: 85 + Width: 50 + MaxLength: 5 + Height: 25 + Text: 1234 + Checkbox@ADVERTISE_CHECKBOX: + X: 100 + Y: 135 + Width: 150 + Height: 20 + Font: Regular + Text: Advertise Online + Checkbox@UPNP_CHECKBOX: + X: 100 + Y: 165 + Width: 300 + Height: 20 + Font: Regular + Text: Automatic port forwarding + Container@SIDEBAR: + X: PARENT_RIGHT-WIDTH + Y: 30 + Width: 174 + Height: 280 + Children: + Background@MAP_BG: + Width: PARENT_RIGHT + Height: 174 + Background: dialog3 + Children: + MapPreview@MAP_PREVIEW: + X: 1 + Y: 1 + Width: PARENT_RIGHT - 2 + Height: PARENT_RIGHT - 2 + Label@MAP_NAME: + Y: 172 + Width: PARENT_RIGHT + Height: 25 + Font: Bold + Align: Center + Button@MAP_BUTTON: + X: PARENT_RIGHT - WIDTH + Y: 284-30 + Width: 174 + Height: 25 + Text: Choose Map + Font: Bold + Button@CREATE_BUTTON: + Key: return + X: PARENT_RIGHT - WIDTH + Y: 284 + Width: 174 + Height: 25 + Text: Create + Font: Bold diff --git a/mods/ra/chrome/multiplayer-directconnect.yaml b/mods/ra/chrome/multiplayer-directconnect.yaml new file mode 100644 index 0000000000..a692b5e4e5 --- /dev/null +++ b/mods/ra/chrome/multiplayer-directconnect.yaml @@ -0,0 +1,96 @@ +Container@MULTIPLAYER_DIRECTCONNECT_PANEL: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Children: + Label@TITLE: + Y: 5 + Width: 583 + Height: 25 + Text: Connect to Server + Align: Center + Font: Bold + ScrollPanel: + Y: 30 + Width: 583 + Height: 249 + Children: + Container: + X: 185 + Y: 60 + Children: + Label@ADDRESS_LABEL: + Y: 14 + Width: 95 + Height: 25 + Align: Right + Text: Address: + TextField@IP: + X: 100 + Y: 15 + Width: 215 + Height: 25 + Label@PORT_LABEL: + Y: 49 + Width: 95 + Height: 25 + Align: Right + Text: Port: + TextField@PORT: + X: 100 + Y: 50 + Width: 50 + Height: 25 + MaxLength: 5 + Container@SIDEBAR: + X: PARENT_RIGHT-WIDTH + Y: 30 + Width: 174 + Height: 280 + Children: + Background@MAP_BG: + Width: PARENT_RIGHT + Height: 174 + Background: dialog3 + Label@TITLE: + Y: 172 + Width: PARENT_RIGHT + Height: 25 + Font: Bold + Align: Center + Text: Direct Connect + Label@DESCA: + Y: 190 + Width: PARENT_RIGHT + Height: 25 + Font: Tiny + Align: Center + Text: Enter the server IP and port in the + Label@DESCB: + Y: 203 + Width: PARENT_RIGHT + Height: 25 + Font: Tiny + Align: Center + Text: fields to the left, and then press Join. + Label@DESCC: + Y: 216 + Width: PARENT_RIGHT + Height: 25 + Font: Tiny + Align: Center + Text: The mod and game version will be + Label@DESCD: + Y: 229 + Width: PARENT_RIGHT + Height: 25 + Font: Tiny + Align: Center + Text: verified when connecting. + Button@JOIN_BUTTON: + Key: return + X: PARENT_RIGHT - WIDTH + Y: 284 + Width: 174 + Height: 25 + Text: Join + Font: Bold diff --git a/mods/ra/chrome/globalchat.yaml b/mods/ra/chrome/multiplayer-globalchat.yaml similarity index 85% rename from mods/ra/chrome/globalchat.yaml rename to mods/ra/chrome/multiplayer-globalchat.yaml index 67b799ef8d..23b48b03a3 100644 --- a/mods/ra/chrome/globalchat.yaml +++ b/mods/ra/chrome/multiplayer-globalchat.yaml @@ -8,7 +8,7 @@ Container@GLOBALCHAT_PANEL: Height: PARENT_BOTTOM Children: Background@TOPIC: - Width: 565 + Width: 582 Height: 20 Background: dialog2 Children: @@ -21,7 +21,7 @@ Container@GLOBALCHAT_PANEL: Align: Center ScrollPanel@HISTORY_PANEL: Y: 20 - Width: 565 + Width: 582 Height: PARENT_BOTTOM - 50 ItemSpacing: 5 Children: @@ -32,11 +32,19 @@ Container@GLOBALCHAT_PANEL: WordWrap: True TextField@CHAT_TEXTFIELD: Y: PARENT_BOTTOM - 25 - Width: 565 + Width: 582 Height: 25 + LeftMargin: 60 + Children: + Label@LABEL_CHATTYPE: + Y: 0-1 + Width: 55 + Height: 25 + Align: Right + Text: Global: ScrollPanel@NICKNAME_PANEL: - X: 570 - Width: 130 + X: PARENT_RIGHT-WIDTH + Width: 174 Height: PARENT_BOTTOM - 30 Children: Container@NICKNAME_TEMPLATE: @@ -53,11 +61,11 @@ Container@GLOBALCHAT_PANEL: Width: PARENT_RIGHT-15 Height: 20 Button@DISCONNECT_BUTTON: - X: 570 + X: PARENT_RIGHT-WIDTH Y: PARENT_BOTTOM - 25 - Width: 130 + Width: 174 Height: 25 - Text: Disconnect + Text: Leave Chat Font: Bold Background@GLOBALCHAT_CONNECT_PANEL: Width: PARENT_RIGHT @@ -84,6 +92,7 @@ Container@GLOBALCHAT_PANEL: Y: PARENT_BOTTOM / 4 + 75 Height: 20 Width: 180 + Font: Regular Text: Connect Automatically Button@CONNECT_BUTTON: X: 430 diff --git a/mods/ra/chrome/multiplayer.yaml b/mods/ra/chrome/multiplayer.yaml new file mode 100644 index 0000000000..9730367218 --- /dev/null +++ b/mods/ra/chrome/multiplayer.yaml @@ -0,0 +1,112 @@ +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 + DropDownButton@FILTERS_DROPDOWNBUTTON: + X: 20 + Y: 321 + Width: 158 + Height: 25 + Text: Filter Games + Font: Bold + Button@REFRESH_BUTTON: + X: 183 + Y: 321 + Width: 100 + Height: 25 + Text: Refresh + Font: Bold + Button@BROWSER_TAB: + X: 288 + Y: 315 + Width: 105 + Height: 31 + Text: Browse + Font: Bold + Button@DIRECTCONNECT_TAB: + X: 393 + Y: 315 + Width: 105 + Height: 31 + Text: Direct IP + Font: Bold + Button@CREATE_TAB: + X: 498 + Y: 315 + Width: 105 + Height: 31 + Text: Create + Font: Bold + Container@TOP_PANELS_ROOT: + X: 20 + Y: 37 + Width: PARENT_RIGHT - 40 + Height: PARENT_BOTTOM + Container@GLOBALCHAT_ROOT: + X: 20 + Y: 351 + Width: PARENT_RIGHT - 40 + Height: PARENT_BOTTOM - 401 + TooltipContainer@TOOLTIP_CONTAINER: + Button@BACK_BUTTON: + Key: escape + X: PARENT_RIGHT - WIDTH - 20 + Y: PARENT_BOTTOM - HEIGHT - 20 + Width: 120 + Height: 25 + Text: Back + Font: Bold + +ScrollPanel@MULTIPLAYER_FILTER_PANEL: + Width: 147 + Height: 130 + Children: + Checkbox@WAITING_FOR_PLAYERS: + X: 5 + Y: 5 + Width: 137 + Height: 20 + Text: Waiting + TextColor: 50,205,50 + Font: Regular + Checkbox@EMPTY: + X: 5 + Y: 30 + Width: 137 + Height: 20 + Text: Empty + Font: Regular + Checkbox@PASSWORD_PROTECTED: + X: 5 + Y: 55 + Width: 137 + Height: 20 + Text: Protected + TextColor: 255,0,0 + Font: Regular + Checkbox@ALREADY_STARTED: + X: 5 + Y: 80 + Width: 137 + Height: 20 + Text: Started + TextColor: 255,165,0 + Font: Regular + Checkbox@INCOMPATIBLE_VERSION: + X: 5 + Y: 105 + Width: 137 + Height: 20 + Text: Incompatible + TextColor: 190,190,190 + Font: Regular \ No newline at end of file diff --git a/mods/ra/chrome/serverbrowser.yaml b/mods/ra/chrome/serverbrowser.yaml deleted file mode 100644 index ceaa3c0cf6..0000000000 --- a/mods/ra/chrome/serverbrowser.yaml +++ /dev/null @@ -1,170 +0,0 @@ -Background@SERVERBROWSER_PANEL: - Logic: ServerBrowserLogic - X: (WINDOW_RIGHT - WIDTH)/2 - Y: (WINDOW_BOTTOM - HEIGHT)/2 - Width: 740 - Height: 645 - Children: - Label@MULTIPLAYER_LABEL_TITLE: - X: 0 - Y: 15 - Width: PARENT_RIGHT - Height: 25 - Text: Multiplayer - Align: Center - Font: Bold - Label@SHOW_LABEL_TITLE: - X: 20 - Y: 48 - Width: 20 - Height: 25 - Text: Show: - Font: Bold - Checkbox@WAITING_FOR_PLAYERS: - X: 80 - Y: 50 - Width: 100 - Height: 20 - Text: Waiting - TextColor: 50,205,50 - Checkbox@EMPTY: - X: 180 - Y: 50 - Width: 100 - Height: 20 - Text: Empty - Checkbox@PASSWORD_PROTECTED: - X: 270 - Y: 50 - Width: 100 - Height: 20 - Text: Protected - TextColor: 255,0,0 - Checkbox@ALREADY_STARTED: - X: 385 - Y: 50 - Width: 100 - Height: 20 - Text: Started - TextColor: 255,165,0 - Checkbox@INCOMPATIBLE_VERSION: - X: 480 - Y: 50 - Width: 100 - Height: 20 - Text: Incompatible - TextColor: 190,190,190 - ScrollPanel@SERVER_LIST: - X: 20 - Y: 80 - Width: 700 - Height: 240 - Children: - ScrollItem@HEADER_TEMPLATE: - BaseName: scrollheader - Width: PARENT_RIGHT-27 - Height: 25 - X: 2 - Visible: false - Children: - Label@LABEL: - Y: 0-1 - Font: Bold - Width: PARENT_RIGHT - Height: 25 - Align: Center - ScrollItem@SERVER_TEMPLATE: - Width: PARENT_RIGHT-27 - Height: 68 - X: 2 - Y: 0 - Children: - MapPreview@MAP_PREVIEW: - X: 2 - Y: 2 - Width: 64 - Height: 64 - ShowSpawnPoints: no - Label@TITLE: - X: 70 - Width: 200 - Height: 25 - Font: Bold - Label@MAP: - X: 70 - Y: 20 - Width: 250 - Height: 25 - Label@PLAYERS: - X: 70 - Y: 40 - Width: 50 - Height: 25 - Label@STATE: - Width: 140 - X: PARENT_RIGHT-150 - Align: Right - Height: 25 - Font: Bold - Label@IP: - Width: 140 - X: PARENT_RIGHT-150 - Y: 20 - Align: Right - Height: 25 - Label@LOCATION: - Width: 140 - X: PARENT_RIGHT-150 - Y: 40 - Align: Right - Height: 25 - Container@GLOBALCHAT_ROOT: - X: 20 - Y: 370 - Width: 700 - Height: 255 - Label@PROGRESS_LABEL: - X: (PARENT_RIGHT - WIDTH) / 2 - Y: PARENT_BOTTOM / 2 - HEIGHT - Width: 150 - Height: 30 - Text: Fetching games... - Align: Center - Button@REFRESH_BUTTON: - X: 20 - Y: 325 - Width: 100 - Height: 25 - Text: Refresh - Font: Bold - Button@CREATE_BUTTON: - X: PARENT_RIGHT - 120 - 120 - 120 - 120 - Y: 325 - Width: 100 - Height: 25 - Text: Create - Font: Bold - Button@DIRECTCONNECT_BUTTON: - X: PARENT_RIGHT - 120 - 120 - 120 - Y: 325 - Width: 100 - Height: 25 - Text: Direct IP - Font: Bold - Button@JOIN_BUTTON: - X: PARENT_RIGHT - 120 - 120 - Y: 325 - Width: 100 - Height: 25 - Text: Join - Font: Bold - Key: return - Button@BACK_BUTTON: - X: PARENT_RIGHT - 120 - Y: 325 - Width: 100 - Height: 25 - Text: Cancel - Font: Bold - Key: escape - diff --git a/mods/ra/metrics.yaml b/mods/ra/metrics.yaml index 8e02da14b7..1ec9953198 100644 --- a/mods/ra/metrics.yaml +++ b/mods/ra/metrics.yaml @@ -33,8 +33,8 @@ Metrics: FactionSuffix-soviet: soviet FactionSuffix-russia: soviet FactionSuffix-ukraine: soviet + IncompatibleVersionColor: 211,211,211 IncompatibleGameColor: 169,169,169 - CantJoinGameColor: 211,211,211 ProtectedGameColor: 255,0,0 IncompatibleProtectedGameColor: 178,34,34 WaitingGameColor: 0,255,0 diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index 15341c5fcb..c6e64603d6 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -104,10 +104,12 @@ ChromeLayout: ./mods/ra/chrome/lobby-globalchat.yaml ./mods/ra/chrome/color-picker.yaml ./mods/ra/chrome/map-chooser.yaml - ./mods/ra/chrome/create-server.yaml - ./mods/ra/chrome/serverbrowser.yaml + ./mods/ra/chrome/multiplayer.yaml + ./mods/ra/chrome/multiplayer-browser.yaml + ./mods/ra/chrome/multiplayer-createserver.yaml + ./mods/ra/chrome/multiplayer-directconnect.yaml + ./mods/ra/chrome/multiplayer-globalchat.yaml ./mods/ra/chrome/connection.yaml - ./mods/ra/chrome/directconnect.yaml ./mods/ra/chrome/replaybrowser.yaml ./mods/ra/chrome/dropdowns.yaml ./mods/ra/chrome/musicplayer.yaml @@ -116,7 +118,6 @@ ChromeLayout: ./mods/ra/chrome/missionbrowser.yaml ./mods/ra/chrome/confirmation-dialogs.yaml ./mods/ra/chrome/editor.yaml - ./mods/ra/chrome/globalchat.yaml Weapons: ./mods/ra/weapons/explosions.yaml diff --git a/mods/ra/uibits/spawnpoints.png b/mods/ra/uibits/spawnpoints.png index 575714f0a2..ef3b35756e 100644 Binary files a/mods/ra/uibits/spawnpoints.png and b/mods/ra/uibits/spawnpoints.png differ diff --git a/mods/ts/chrome.yaml b/mods/ts/chrome.yaml index b044bdb67b..fd4df48b03 100644 --- a/mods/ts/chrome.yaml +++ b/mods/ts/chrome.yaml @@ -274,6 +274,8 @@ lobby-bits: spawnpoints.png admin: 64,5,7,5 colorpicker: 5,5,22,22 huepicker: 71,0,7,15 + protected: 79,0,10,13 + protected-disabled: 90,0,10,13 strategic: strategic.png unowned: 0,0,32,32 diff --git a/mods/ts/metrics.yaml b/mods/ts/metrics.yaml index 10eab2bec8..97d2f5ab14 100644 --- a/mods/ts/metrics.yaml +++ b/mods/ts/metrics.yaml @@ -26,8 +26,8 @@ Metrics: SpawnColor: 255,255,255 SpawnContrastColor: 0,0,0 SpawnLabelOffset: 0,1 + IncompatibleVersionColor: 255,0,0 IncompatibleGameColor: 169,169,169 - CantJoinGameColor: 211,211,211 ProtectedGameColor: 255,0,0 IncompatibleProtectedGameColor: 139,0,0 WaitingGameColor: 0,255,0 diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index bab4fda0b6..e90dd9a683 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -158,10 +158,12 @@ ChromeLayout: ./mods/ra/chrome/lobby-globalchat.yaml ./mods/ts/chrome/color-picker.yaml ./mods/ra/chrome/map-chooser.yaml - ./mods/ra/chrome/create-server.yaml - ./mods/ra/chrome/serverbrowser.yaml + ./mods/ra/chrome/multiplayer.yaml + ./mods/ra/chrome/multiplayer-browser.yaml + ./mods/ra/chrome/multiplayer-createserver.yaml + ./mods/ra/chrome/multiplayer-directconnect.yaml + ./mods/ra/chrome/multiplayer-globalchat.yaml ./mods/ra/chrome/connection.yaml - ./mods/ra/chrome/directconnect.yaml ./mods/ra/chrome/replaybrowser.yaml ./mods/ts/chrome/dropdowns.yaml ./mods/ra/chrome/musicplayer.yaml @@ -170,7 +172,6 @@ ChromeLayout: ./mods/ra/chrome/missionbrowser.yaml ./mods/ra/chrome/confirmation-dialogs.yaml ./mods/ra/chrome/editor.yaml - ./mods/ra/chrome/globalchat.yaml Voices: ./mods/ts/audio/voices.yaml