diff --git a/OpenRA.Mods.RA/Widgets/Logic/KickClientLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/KickClientLogic.cs index 6b44eac700..f1f89edef6 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/KickClientLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/KickClientLogic.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic class KickClientLogic { [ObjectCreator.UseCtor] - public KickClientLogic(Widget widget, string clientName, Action okPressed) + public KickClientLogic(Widget widget, string clientName, Action okPressed, Action cancelPressed) { widget.Get("TITLE").GetText = () => "Kick {0}?".F(clientName); @@ -31,7 +31,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic okPressed(tempBan); }; - widget.Get("CANCEL_BUTTON").OnClick = () => widget.Parent.RemoveChild(widget); + widget.Get("CANCEL_BUTTON").OnClick = () => + { + widget.Parent.RemoveChild(widget); + cancelPressed(); + }; } } } diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs index 1a36f38529..c6e024f962 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs @@ -20,6 +20,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic { public class LobbyLogic { + enum PanelType { Players, Options, Kick } + PanelType panel = PanelType.Players; + Widget lobby; Widget EditablePlayerTemplate, NonEditablePlayerTemplate, EmptySlotTemplate, EditableSpectatorTemplate, NonEditableSpectatorTemplate, NewSpectatorTemplate; @@ -37,8 +40,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic readonly Action onExit; readonly OrderManager orderManager; - public bool TeamGame; - // Listen for connection failures void ConnectionStateChanged(OrderManager om) { @@ -103,6 +104,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic UpdateCurrentMap(); Players = Ui.LoadWidget("LOBBY_PLAYER_BIN", lobby, new WidgetArgs()); + Players.IsVisible = () => panel == PanelType.Players; + EditablePlayerTemplate = Players.Get("TEMPLATE_EDITABLE_PLAYER"); NonEditablePlayerTemplate = Players.Get("TEMPLATE_NONEDITABLE_PLAYER"); EmptySlotTemplate = Players.Get("TEMPLATE_EMPTY"); @@ -145,31 +148,36 @@ namespace OpenRA.Mods.RA.Widgets.Logic CountryNames.Add("random", "Any"); var gameStarting = false; + Func configurationDisabled = () => !Game.IsHost || gameStarting || panel == PanelType.Kick || + orderManager.LocalClient == null || orderManager.LocalClient.IsReady; - var mapButton = lobby.Get("CHANGEMAP_BUTTON"); - mapButton.OnClick = () => + var mapButton = lobby.GetOrNull("CHANGEMAP_BUTTON"); + if (mapButton != null) { - var onSelect = new Action(m => + mapButton.IsDisabled = configurationDisabled; + mapButton.OnClick = () => { - orderManager.IssueOrder(Order.Command("map " + m.Uid)); - Game.Settings.Server.Map = m.Uid; - Game.Settings.Save(); - }); + var onSelect = new Action(m => + { + orderManager.IssueOrder(Order.Command("map " + m.Uid)); + Game.Settings.Server.Map = m.Uid; + Game.Settings.Save(); + }); - Ui.OpenWindow("MAPCHOOSER_PANEL", new WidgetArgs() - { - { "initialMap", Map.Uid }, - { "onExit", () => {} }, - { "onSelect", onSelect } - }); - }; - mapButton.IsVisible = () => mapButton.Visible && Game.IsHost; + Ui.OpenWindow("MAPCHOOSER_PANEL", new WidgetArgs() + { + { "initialMap", Map.Uid }, + { "onExit", () => {} }, + { "onSelect", onSelect } + }); + }; + } var slotsButton = lobby.GetOrNull("SLOTS_DROPDOWNBUTTON"); if (slotsButton != null) { - slotsButton.IsDisabled = () => !Game.IsHost || gameStarting || orderManager.LocalClient == null || - orderManager.LocalClient.IsReady || !orderManager.LobbyInfo.Slots.Values.Any(s => s.AllowBots || !s.LockTeam); + slotsButton.IsDisabled = () => configurationDisabled() || panel != PanelType.Players || + !orderManager.LobbyInfo.Slots.Values.Any(s => s.AllowBots || !s.LockTeam); var aiModes = Rules.Info["player"].Traits.WithInterface().Select(t => t.Name); slotsButton.OnMouseDown = _ => @@ -213,7 +221,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic }); } - options.Add("Bots", botOptions); + options.Add("Configure Bots", botOptions); } var teamCount = (orderManager.LobbyInfo.Slots.Count(s => !s.Value.LockTeam && orderManager.LobbyInfo.ClientInSlot(s.Key) != null) + 1) / 2; @@ -226,7 +234,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic OnClick = () => orderManager.IssueOrder(Order.Command("assignteams {0}".F(d.ToString()))) }); - options.Add("Teams", teamOptions); + options.Add("Configure Teams", teamOptions); } Func setupItem = (option, template) => @@ -239,42 +247,59 @@ namespace OpenRA.Mods.RA.Widgets.Logic }; } - var disconnectButton = lobby.Get("DISCONNECT_BUTTON"); - disconnectButton.OnClick = () => { CloseWindow(); onExit(); }; + var optionsBin = Ui.LoadWidget("LOBBY_OPTIONS_BIN", lobby, new WidgetArgs()); + optionsBin.IsVisible = () => panel == PanelType.Options; - var allowCheats = lobby.Get("ALLOWCHEATS_CHECKBOX"); - allowCheats.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.AllowCheats; - allowCheats.IsDisabled = () => !Game.IsHost || gameStarting || orderManager.LocalClient == null - || orderManager.LocalClient.IsReady; - allowCheats.OnClick = () => orderManager.IssueOrder(Order.Command( + var optionsButton = lobby.Get("OPTIONS_BUTTON"); + optionsButton.IsDisabled = () => panel == PanelType.Kick; + optionsButton.GetText = () => panel == PanelType.Options ? "Players" : "Options"; + optionsButton.OnClick = () => panel = (panel == PanelType.Options) ? PanelType.Players : PanelType.Options; + + var startGameButton = lobby.GetOrNull("START_GAME_BUTTON"); + if (startGameButton != null) + { + startGameButton.IsDisabled = () => configurationDisabled() || + orderManager.LobbyInfo.Slots.Any(sl => sl.Value.Required && orderManager.LobbyInfo.ClientInSlot(sl.Key) == null); + startGameButton.OnClick = () => + { + gameStarting = true; + orderManager.IssueOrder(Order.Command("startgame")); + }; + } + + // Options panel + var allowCheats = optionsBin.GetOrNull("ALLOWCHEATS_CHECKBOX"); + if (allowCheats != null) + { + allowCheats.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.AllowCheats; + allowCheats.IsDisabled = configurationDisabled; + allowCheats.OnClick = () => orderManager.IssueOrder(Order.Command( "allowcheats {0}".F(!orderManager.LobbyInfo.GlobalSettings.AllowCheats))); + } - var crates = lobby.GetOrNull("CRATES_CHECKBOX"); + var crates = optionsBin.GetOrNull("CRATES_CHECKBOX"); if (crates != null) { crates.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.Crates; - crates.IsDisabled = () => !Game.IsHost || gameStarting || orderManager.LocalClient == null - || orderManager.LocalClient.IsReady; // maybe disable the checkbox if a map forcefully removes CrateDrop? + crates.IsDisabled = configurationDisabled; crates.OnClick = () => orderManager.IssueOrder(Order.Command( "crates {0}".F(!orderManager.LobbyInfo.GlobalSettings.Crates))); } - var fragileAlliance = lobby.GetOrNull("FRAGILEALLIANCES_CHECKBOX"); + var fragileAlliance = optionsBin.GetOrNull("FRAGILEALLIANCES_CHECKBOX"); if (fragileAlliance != null) { fragileAlliance.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.FragileAlliances; - fragileAlliance.IsDisabled = () => !Game.IsHost || gameStarting - || orderManager.LocalClient == null || orderManager.LocalClient.IsReady; + fragileAlliance.IsDisabled = configurationDisabled; fragileAlliance.OnClick = () => orderManager.IssueOrder(Order.Command( "fragilealliance {0}".F(!orderManager.LobbyInfo.GlobalSettings.FragileAlliances))); }; - - var difficulty = lobby.GetOrNull("DIFFICULTY_DROPDOWNBUTTON"); + var difficulty = optionsBin.GetOrNull("DIFFICULTY_DROPDOWNBUTTON"); if (difficulty != null) { difficulty.IsVisible = () => Map != null && Map.Difficulties != null && Map.Difficulties.Any(); - difficulty.IsDisabled = () => !Game.IsHost || gameStarting || orderManager.LocalClient == null || orderManager.LocalClient.IsReady; + difficulty.IsDisabled = configurationDisabled; difficulty.GetText = () => orderManager.LobbyInfo.GlobalSettings.Difficulty; difficulty.OnMouseDown = _ => { @@ -292,17 +317,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic }; difficulty.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", options.Count() * 30, options, setupItem); }; + + var difficultyDesc = optionsBin.GetOrNull("DIFFICULTY_DESC"); + difficultyDesc.IsVisible = difficulty.IsVisible; } - var startGameButton = lobby.Get("START_GAME_BUTTON"); - startGameButton.IsVisible = () => Game.IsHost; - startGameButton.IsDisabled = () => gameStarting - || orderManager.LobbyInfo.Slots.Any(sl => sl.Value.Required && orderManager.LobbyInfo.ClientInSlot(sl.Key) == null); - startGameButton.OnClick = () => - { - gameStarting = true; - orderManager.IssueOrder(Order.Command("startgame")); - }; + var disconnectButton = lobby.Get("DISCONNECT_BUTTON"); + disconnectButton.OnClick = () => { CloseWindow(); onExit(); }; bool teamChat = false; var chatLabel = lobby.Get("LABEL_CHATTYPE"); @@ -401,8 +422,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic void UpdatePlayerList() { var idx = 0; - TeamGame = false; - foreach (var kv in orderManager.LobbyInfo.Slots) { var key = kv.Key; @@ -449,9 +468,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic LobbyUtils.SetupEditableFactionWidget(template, slot, client, orderManager, CountryNames); LobbyUtils.SetupEditableTeamWidget(template, slot, client, orderManager, Map.GetSpawnPoints().Length); LobbyUtils.SetupEditableReadyWidget(template, slot, client, orderManager); - - if (slot.LockTeam || client.Team > 0) - TeamGame = true; } else { // Non-editable player in slot @@ -460,7 +476,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic LobbyUtils.SetupClientWidget(template, slot, client, orderManager, client.Bot == null); LobbyUtils.SetupNameWidget(template, slot, client); - LobbyUtils.SetupKickWidget(template, slot, client, orderManager, lobby); + LobbyUtils.SetupKickWidget(template, slot, client, orderManager, lobby, + () => panel = PanelType.Kick, () => panel = PanelType.Players); LobbyUtils.SetupColorWidget(template, slot, client); LobbyUtils.SetupFactionWidget(template, slot, client, CountryNames); LobbyUtils.SetupTeamWidget(template, slot, client); @@ -502,7 +519,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic template = NonEditableSpectatorTemplate.Clone(); LobbyUtils.SetupNameWidget(template, null, client); - LobbyUtils.SetupKickWidget(template, null, client, orderManager, lobby); + LobbyUtils.SetupKickWidget(template, null, client, orderManager, lobby, + () => panel = PanelType.Kick, () => panel = PanelType.Players); } LobbyUtils.SetupClientWidget(template, null, c, orderManager, true); diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs index 71453508d3..23fe2e70a9 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs @@ -266,17 +266,23 @@ namespace OpenRA.Mods.RA.Widgets.Logic slot.IsVisible = () => false; } - public static void SetupKickWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, Widget lobby) + public static void SetupKickWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, Widget lobby, Action before, Action after) { var button = parent.Get("KICK"); button.IsVisible = () => Game.IsHost && c.Index != orderManager.LocalClient.Index; button.IsDisabled = () => orderManager.LocalClient.IsReady; - Action okPressed = tempBan => orderManager.IssueOrder(Order.Command("kick {0} {1}".F(c.Index, tempBan))); - button.OnClick = () => Game.LoadWidget(null, "KICK_CLIENT_DIALOG", lobby, new WidgetArgs + Action okPressed = tempBan => { orderManager.IssueOrder(Order.Command("kick {0} {1}".F(c.Index, tempBan))); after(); }; + button.OnClick = () => { - { "clientName", c.Name }, - { "okPressed", okPressed } - }); + before(); + + Game.LoadWidget(null, "KICK_CLIENT_DIALOG", lobby, new WidgetArgs + { + { "clientName", c.Name }, + { "okPressed", okPressed }, + { "cancelPressed", after } + }); + }; } public static void SetupEditableColorWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, ColorPreviewManagerWidget colorPreview) diff --git a/mods/cnc/chrome/dialogs.yaml b/mods/cnc/chrome/dialogs.yaml index ed82c9db78..955cc9f069 100644 --- a/mods/cnc/chrome/dialogs.yaml +++ b/mods/cnc/chrome/dialogs.yaml @@ -148,10 +148,10 @@ Container@CONFIRM_PROMPT: Background@KICK_CLIENT_DIALOG: X:15 Y:30 - Width:503 + Width:501 Height:219 Logic:KickClientLogic - Background:panel-black + Background:scrollpanel-bg Children: Label@TITLE: X:0 @@ -195,4 +195,50 @@ Background@KICK_CLIENT_DIALOG: Width:120 Height:25 Text:Cancel + Font:Bold + +Background@LOBBY_OPTIONS_BIN: + X:15 + Y:30 + Width:501 + Height:219 + Background:scrollpanel-bg + Children: + Label@TITLE: + X:0 + Y:50 + Width:PARENT_RIGHT + Height:25 + Font:Bold + Align:Center + Text: Map Options + Checkbox@ALLOWCHEATS_CHECKBOX: + X:150 + Y:80 + Width:80 + Height:20 + Text:Enable Cheats / Debug Menu + Checkbox@CRATES_CHECKBOX: + X:150 + Y:110 + Width:80 + Height:20 + Text:Enable Crates + Checkbox@FRAGILEALLIANCES_CHECKBOX: + X:150 + Y:140 + Width:80 + Height:20 + Text:Allow Team Changes + Label@DIFFICULTY_DESC: + X:150 + Y:170 + Width:120 + Height:25 + Text:Mission Difficulty: + DropDownButton@DIFFICULTY_DROPDOWNBUTTON: + X:265 + Y:170 + Width:100 + Height:25 Font:Bold \ No newline at end of file diff --git a/mods/cnc/chrome/lobby-playerbin.yaml b/mods/cnc/chrome/lobby-playerbin.yaml index bae503c45f..83c877e61d 100644 --- a/mods/cnc/chrome/lobby-playerbin.yaml +++ b/mods/cnc/chrome/lobby-playerbin.yaml @@ -1,9 +1,9 @@ ScrollPanel@LOBBY_PLAYER_BIN: X:15 Y:30 - Width:503 - ItemSpacing:5 + Width:501 Height:219 + ItemSpacing:5 Children: Container@TEMPLATE_EDITABLE_PLAYER: X:5 @@ -94,7 +94,7 @@ ScrollPanel@LOBBY_PLAYER_BIN: ImageName:checked Checkbox@STATUS_CHECKBOX: Visible:false - X:448 + X:446 Y:2 Width:20 Height:20 @@ -129,11 +129,10 @@ ScrollPanel@LOBBY_PLAYER_BIN: Width:11 Height:25 Label@NAME: - Text:Name - Width:185 - Height:25 - X:15 + X:20 Y:0-1 + Width:180 + Height:25 Button@KICK: Width:25 Height:25 @@ -174,7 +173,7 @@ ScrollPanel@LOBBY_PLAYER_BIN: Y:0 Image@STATUS_IMAGE: Visible:false - X:450 + X:448 Y:4 Width:20 Height:20 @@ -195,16 +194,15 @@ ScrollPanel@LOBBY_PLAYER_BIN: Font:Regular Visible:false Label@NAME: - Text:Name - Width:200 - Height:25 - X:15 + X:20 Y:0-1 + Width:195 + Height:25 Visible:false Button@JOIN: Text:Play in this slot Font:Regular - Width:315-55 + Width:257 Height:25 X:210 Y:0 @@ -283,11 +281,10 @@ ScrollPanel@LOBBY_PLAYER_BIN: Width:11 Height:25 Label@NAME: - Text:Name - Width:185 - Height:25 - X:15 + X:20 Y:0-1 + Width:180 + Height:25 Button@KICK: Text:X Width:25 @@ -306,14 +303,14 @@ ScrollPanel@LOBBY_PLAYER_BIN: Container@TEMPLATE_NEW_SPECTATOR: X:5 Y:0 - Width:475 + Width:474 Height:25 Visible:false Children: Button@SPECTATE: Text:Spectate Font:Regular - Width:455 + Width:453 Height:25 X:15 Y:0 \ No newline at end of file diff --git a/mods/cnc/chrome/lobby.yaml b/mods/cnc/chrome/lobby.yaml index dee972f74b..0adfa45480 100644 --- a/mods/cnc/chrome/lobby.yaml +++ b/mods/cnc/chrome/lobby.yaml @@ -83,36 +83,35 @@ Container@SERVER_LOBBY: Align:Center Font:Bold Label@STATUS: - X:448 + X:446 Width:20 Height:25 Text:Ready Align:Left Font:Bold - Checkbox@ALLOWCHEATS_CHECKBOX: + Button@OPTIONS_BUTTON: X:15 - Y:257 - Width:130 - Height:20 - Text:Cheats - Checkbox@CRATES_CHECKBOX: - X:120 - Y:257 - Width:80 - Height:20 - Text:Crates + Y:254 + Width:112 + Height:25 DropDownButton@SLOTS_DROPDOWNBUTTON: - X:213 - Y:255 + X:132 + Y:254 Width:150 Height:25 - Text:Slot Options + Text:Slot Admin Button@CHANGEMAP_BUTTON: - X:368 - Y:255 - Width:150 + X:287 + Y:254 + Width:112 Height:25 Text:Change Map + Button@START_GAME_BUTTON: + X:404 + Y:254 + Width:112 + Height:25 + Text:Start Game ScrollPanel@CHAT_DISPLAY: X:15 Y:285 @@ -156,21 +155,15 @@ Container@SERVER_LOBBY: Align:Right Text:Chat: Button@DISCONNECT_BUTTON: - X:0 + X:600 Y:499 Width:140 Height:35 Text:Leave Game Button@MUSIC_BUTTON: - X:150 + X:450 Y:499 Width:140 Height:35 Text:Music - Button@START_GAME_BUTTON: - X:600 - Y:499 - Width:140 - Height:35 - Text:Start Game TooltipContainer@TOOLTIP_CONTAINER: diff --git a/mods/d2k/chrome/lobby-playerbin.yaml b/mods/d2k/chrome/lobby-playerbin.yaml index 023612843c..f64d6ed24f 100644 --- a/mods/d2k/chrome/lobby-playerbin.yaml +++ b/mods/d2k/chrome/lobby-playerbin.yaml @@ -2,7 +2,7 @@ ScrollPanel@LOBBY_PLAYER_BIN: X:20 Y:67 ItemSpacing:5 - Width:504 + Width:535 Height:235 Children: Container@TEMPLATE_EDITABLE_PLAYER: @@ -37,21 +37,20 @@ ScrollPanel@LOBBY_PLAYER_BIN: TextField@NAME: Text:Name X:15 - Width:135 + Width:165 Height:25 MaxLength:16 DropDownButton@SLOT_OPTIONS: Text:Name X:15 - Width:135 + Width:165 Height:25 Font:Regular Visible:false DropDownButton@COLOR: + X:190 Width:80 Height:25 - X:160 - Y:0 Children: ColorBlock@COLORBLOCK: X:5 @@ -59,37 +58,35 @@ ScrollPanel@LOBBY_PLAYER_BIN: Width:PARENT_RIGHT-35 Height:PARENT_BOTTOM-12 DropDownButton@FACTION: + X:280 Width:130 Height:25 - X:250 - Y:0 Children: Image@FACTIONFLAG: Width:23 Height:23 - X:5 + X:4 Y:2 Label@FACTIONNAME: Text:Faction Width:70 Height:25 - X:30 + X:34 Y:0 DropDownButton@TEAM: - Text:Team + X:420 Width:48 Height:25 - X:390 - Y:0 + Text:Team Checkbox@STATUS_CHECKBOX: - X:448 + X:477 Y:2 Width:20 Height:20 Visible:false Image@STATUS_IMAGE: Visible:false - X:450 + X:479 Y:4 Width:20 Height:20 @@ -127,7 +124,7 @@ ScrollPanel@LOBBY_PLAYER_BIN: Height:25 Label@NAME: Text:Name - Width:130 + Width:165 Height:25 X:20 Y:0-1 @@ -135,41 +132,41 @@ ScrollPanel@LOBBY_PLAYER_BIN: Text:X Width:25 Height:23 - X:125 + X:155 Y:2 Font:Bold ColorBlock@COLORBLOCK: - X:165 + X:195 Y:6 Width:45 Height:13 Container@FACTION: - Width:130 + Width:160 Height:25 - X:250 + X:280 Y:0 Children: Image@FACTIONFLAG: Width:23 Height:23 - X:5 + X:4 Y:2 Label@FACTIONNAME: Text:Faction Width:60 Height:25 - X:40 + X:34 Y:0 Label@TEAM: Text:Team Width:23 Height:25 Align:Center - X:390 + X:420 Y:0 Image@STATUS_IMAGE: Visible:false - X:450 + X:479 Y:4 Width:20 Height:20 @@ -184,13 +181,13 @@ ScrollPanel@LOBBY_PLAYER_BIN: Children: Label@NAME: Text:Name - Width:130 + Width:165 Height:25 X:20 Y:0-1 DropDownButton@SLOT_OPTIONS: Text:Name - Width:135 + Width:165 Height:25 X:15 Y:0 @@ -199,7 +196,7 @@ ScrollPanel@LOBBY_PLAYER_BIN: Text:Play in this slot Width:278 Height:25 - X:160 + X:190 Y:0 Container@TEMPLATE_EDITABLE_SPECTATOR: X:5 @@ -233,14 +230,14 @@ ScrollPanel@LOBBY_PLAYER_BIN: TextField@NAME: Text:Name X:15 - Width:135 + Width:165 Height:25 MaxLength:16 Label@SPECTATOR: Text:Spectator Width:278 Height:25 - X:160 + X:190 Y:0 Align:Center Font:Bold @@ -275,7 +272,7 @@ ScrollPanel@LOBBY_PLAYER_BIN: Height:25 Label@NAME: Text:Name - Width:130 + Width:160 Height:25 X:20 Y:0-1 @@ -283,14 +280,14 @@ ScrollPanel@LOBBY_PLAYER_BIN: Text:X Width:25 Height:23 - X:125 + X:155 Y:2 Font:Bold Label@SPECTATOR: Text:Spectator Width:278 Height:25 - X:160 + X:190 Y:0 Align:Center Font:Bold @@ -306,5 +303,25 @@ ScrollPanel@LOBBY_PLAYER_BIN: Font:Regular Width:278 Height:25 - X:160 - Y:0 \ No newline at end of file + X:190 + Y:0 + +ScrollPanel@RACE_DROPDOWN_TEMPLATE: + Width:DROPDOWN_WIDTH + Children: + ScrollItem@TEMPLATE: + Width:PARENT_RIGHT-27 + Height:25 + X:2 + Y:0 + Visible:false + Children: + Image@FLAG: + X:2 + Y:2 + Width:30 + Height:15 + Label@LABEL: + X:30 + Width:70 + Height:25 \ No newline at end of file diff --git a/mods/ra/chrome/dropdowns.yaml b/mods/ra/chrome/dropdowns.yaml index 2c5289aa72..59fdfd9345 100644 --- a/mods/ra/chrome/dropdowns.yaml +++ b/mods/ra/chrome/dropdowns.yaml @@ -25,26 +25,6 @@ ScrollPanel@LABEL_DROPDOWN_TEMPLATE: Width:PARENT_RIGHT-20 Height:25 -ScrollPanel@RACE_DROPDOWN_TEMPLATE: - Width:DROPDOWN_WIDTH - Children: - ScrollItem@TEMPLATE: - Width:PARENT_RIGHT-27 - Height:25 - X:2 - Y:0 - Visible:false - Children: - Image@FLAG: - X:5 - Y:5 - Width:30 - Height:15 - Label@LABEL: - X:40 - Width:60 - Height:25 - ScrollPanel@TEAM_DROPDOWN_TEMPLATE: Width:DROPDOWN_WIDTH Children: diff --git a/mods/ra/chrome/lobby-dialogs.yaml b/mods/ra/chrome/lobby-dialogs.yaml index 1253732b44..550781adb2 100644 --- a/mods/ra/chrome/lobby-dialogs.yaml +++ b/mods/ra/chrome/lobby-dialogs.yaml @@ -1,7 +1,7 @@ Background@KICK_CLIENT_DIALOG: X:20 Y:67 - Width:504 + Width:535 Height:235 Logic:KickClientLogic Background:dialog3 @@ -48,4 +48,50 @@ Background@KICK_CLIENT_DIALOG: Width:120 Height:25 Text:Cancel + Font:Bold + +Background@LOBBY_OPTIONS_BIN: + X:20 + Y:67 + Width:535 + Height:235 + Background:dialog3 + Children: + Label@TITLE: + X:0 + Y:50 + Width:PARENT_RIGHT + Height:25 + Font:Bold + Align:Center + Text: Map Options + Checkbox@ALLOWCHEATS_CHECKBOX: + X:150 + Y:80 + Width:80 + Height:20 + Text:Enable Cheats / Debug Menu + Checkbox@CRATES_CHECKBOX: + X:150 + Y:110 + Width:80 + Height:20 + Text:Enable Crates + Checkbox@FRAGILEALLIANCES_CHECKBOX: + X:150 + Y:140 + Width:80 + Height:20 + Text:Allow Team Changes + Label@DIFFICULTY_DESC: + X:150 + Y:170 + Width:120 + Height:25 + Text:Mission Difficulty: + DropDownButton@DIFFICULTY_DROPDOWNBUTTON: + X:265 + Y:170 + Width:100 + Height:25 Font:Bold \ No newline at end of file diff --git a/mods/ra/chrome/lobby-playerbin.yaml b/mods/ra/chrome/lobby-playerbin.yaml index 39ee1c7128..c6d2c6b88c 100644 --- a/mods/ra/chrome/lobby-playerbin.yaml +++ b/mods/ra/chrome/lobby-playerbin.yaml @@ -2,7 +2,7 @@ ScrollPanel@LOBBY_PLAYER_BIN: X:20 Y:67 ItemSpacing:5 - Width:504 + Width:535 Height:235 Children: Container@TEMPLATE_EDITABLE_PLAYER: @@ -37,21 +37,20 @@ ScrollPanel@LOBBY_PLAYER_BIN: TextField@NAME: Text:Name X:15 - Width:135 + Width:165 Height:25 MaxLength:16 DropDownButton@SLOT_OPTIONS: Text:Name X:15 - Width:135 + Width:165 Height:25 Font:Regular Visible:false DropDownButton@COLOR: + X:190 Width:80 Height:25 - X:160 - Y:0 Children: ColorBlock@COLORBLOCK: X:5 @@ -59,10 +58,9 @@ ScrollPanel@LOBBY_PLAYER_BIN: Width:PARENT_RIGHT-35 Height:PARENT_BOTTOM-12 DropDownButton@FACTION: + X:280 Width:130 Height:25 - X:250 - Y:0 Children: Image@FACTIONFLAG: Width:30 @@ -76,20 +74,19 @@ ScrollPanel@LOBBY_PLAYER_BIN: X:40 Y:0 DropDownButton@TEAM: - Text:Team + X:420 Width:48 Height:25 - X:390 - Y:0 + Text:Team Checkbox@STATUS_CHECKBOX: - X:448 + X:477 Y:2 Width:20 Height:20 Visible:false Image@STATUS_IMAGE: Visible:false - X:450 + X:479 Y:4 Width:20 Height:20 @@ -127,7 +124,7 @@ ScrollPanel@LOBBY_PLAYER_BIN: Height:25 Label@NAME: Text:Name - Width:130 + Width:165 Height:25 X:20 Y:0-1 @@ -135,18 +132,18 @@ ScrollPanel@LOBBY_PLAYER_BIN: Text:X Width:25 Height:23 - X:125 + X:155 Y:2 Font:Bold ColorBlock@COLORBLOCK: - X:165 + X:195 Y:6 Width:45 Height:13 Container@FACTION: - Width:130 + Width:160 Height:25 - X:250 + X:280 Y:0 Children: Image@FACTIONFLAG: @@ -165,11 +162,11 @@ ScrollPanel@LOBBY_PLAYER_BIN: Width:23 Height:25 Align:Center - X:390 + X:420 Y:0 Image@STATUS_IMAGE: Visible:false - X:450 + X:479 Y:4 Width:20 Height:20 @@ -184,13 +181,13 @@ ScrollPanel@LOBBY_PLAYER_BIN: Children: Label@NAME: Text:Name - Width:130 + Width:165 Height:25 X:20 Y:0-1 DropDownButton@SLOT_OPTIONS: Text:Name - Width:135 + Width:165 Height:25 X:15 Y:0 @@ -199,7 +196,7 @@ ScrollPanel@LOBBY_PLAYER_BIN: Text:Play in this slot Width:278 Height:25 - X:160 + X:190 Y:0 Container@TEMPLATE_EDITABLE_SPECTATOR: X:5 @@ -233,14 +230,14 @@ ScrollPanel@LOBBY_PLAYER_BIN: TextField@NAME: Text:Name X:15 - Width:135 + Width:165 Height:25 MaxLength:16 Label@SPECTATOR: Text:Spectator Width:278 Height:25 - X:160 + X:190 Y:0 Align:Center Font:Bold @@ -275,7 +272,7 @@ ScrollPanel@LOBBY_PLAYER_BIN: Height:25 Label@NAME: Text:Name - Width:130 + Width:160 Height:25 X:20 Y:0-1 @@ -283,14 +280,14 @@ ScrollPanel@LOBBY_PLAYER_BIN: Text:X Width:25 Height:23 - X:125 + X:155 Y:2 Font:Bold Label@SPECTATOR: Text:Spectator Width:278 Height:25 - X:160 + X:190 Y:0 Align:Center Font:Bold @@ -306,5 +303,25 @@ ScrollPanel@LOBBY_PLAYER_BIN: Font:Regular Width:278 Height:25 - X:160 - Y:0 \ No newline at end of file + X:190 + Y:0 + +ScrollPanel@RACE_DROPDOWN_TEMPLATE: + Width:DROPDOWN_WIDTH + Children: + ScrollItem@TEMPLATE: + Width:PARENT_RIGHT-27 + Height:25 + X:2 + Y:0 + Visible:false + Children: + Image@FLAG: + X:5 + Y:5 + Width:30 + Height:15 + Label@LABEL: + X:40 + Width:60 + Height:25 \ No newline at end of file diff --git a/mods/ra/chrome/lobby.yaml b/mods/ra/chrome/lobby.yaml index 29210a6f0e..4d6c820957 100644 --- a/mods/ra/chrome/lobby.yaml +++ b/mods/ra/chrome/lobby.yaml @@ -10,78 +10,115 @@ Background@SERVER_LOBBY: X:0 Y:17 Align:Center - Width:530 + Width:PARENT_RIGHT Height:20 Font:Bold - Label@MAP_TITLE: - X:532 - Y:17 - Align:Center - Width:250 - Height:20 - Font:Bold - Background@LOBBY_MAP_BG: - X:PARENT_RIGHT-268 - Y:50 - Width:252 - Height:252 + Background@MAP_BG: + X:PARENT_RIGHT-20-WIDTH + Y:67 + Width:214 + Height:214 Background:dialog3 Children: MapPreview@MAP_PREVIEW: - X:4 - Y:4 - Width:244 - Height:244 + X:2 + Y:2 + Width:210 + Height:210 TooltipContainer:TOOLTIP_CONTAINER + Label@MAP_TITLE: + X:PARENT_RIGHT-20-WIDTH + Y:282 + Width:214 + Height:25 + Font:Bold + Align:Center + Label@MAP_TYPE: + X:PARENT_RIGHT-20-WIDTH + Y:297 + Width:214 + Height:25 + Font:TinyBold + Align:Center + Label@MAP_AUTHOR: + X:PARENT_RIGHT-20-WIDTH + Y:310 + Width:214 + Height:25 + Font:Tiny + Align:Center Container@LABEL_CONTAINER: X:25 Y:40 Children: Label@LABEL_LOBBY_NAME: - Width:150 - Height:25 X:0 - Y:0 + Width:180 + Height:25 Text:Name Align:Center Font:Bold Label@LABEL_LOBBY_COLOR: + X:190 Width:80 Height:25 - X:160 - Y:0 Text:Color Align:Center Font:Bold Label@LABEL_LOBBY_FACTION: + X:280 Width:130 Height:25 - X:250 - Y:0 Text:Faction Align:Center Font:Bold Label@LABEL_LOBBY_TEAM: + X:420 Width:48 Height:25 - X:390 - Y:0 Text:Team Align:Center Font:Bold Label@LABEL_LOBBY_STATUS: - X:448 - Y:0 + X:477 Width:20 Height:25 Text:Ready Align:Left Font:Bold + DropDownButton@SLOTS_DROPDOWNBUTTON: + X:20 + Y:PARENT_BOTTOM - 291 + Width:151 + Height:25 + Font:Bold + Text:Slot Admin + Button@OPTIONS_BUTTON: + X:178 + Y:PARENT_BOTTOM - 291 + Width:121 + Height:25 + Font:Bold + Text:Game Options + Button@CHANGEMAP_BUTTON: + X:306 + Y:PARENT_BOTTOM - 291 + Width:121 + Height:25 + Text:Change Map + Font:Bold + Button@START_GAME_BUTTON: + X:434 + Y:PARENT_BOTTOM - 291 + Width:121 + Height:25 + Text:Start Game + Font:Bold ScrollPanel@CHAT_DISPLAY: X:20 - Y:PARENT_BOTTOM - 289 - Width:PARENT_RIGHT - 200 - Height:230 + Y:PARENT_BOTTOM - HEIGHT - 52 + Width:760 + Height:210 ItemSpacing:1 Children: Container@CHAT_TEMPLATE: @@ -106,69 +143,24 @@ Background@SERVER_LOBBY: Height:15 WordWrap:true VAlign:Top - Label@LABEL_CHATTYPE: - Width:65 - Height:25 - X:0 - Y:PARENT_BOTTOM - 50 - Text:Chat: - Align:Right TextField@CHAT_TEXTFIELD: - X:70 - Y:PARENT_BOTTOM - 49 - Width:550 + X:20 + Y:PARENT_BOTTOM - HEIGHT - 20 + Width:PARENT_RIGHT - 167 Height:25 - Button@CHANGEMAP_BUTTON: - X:PARENT_RIGHT-154 - Y:PARENT_BOTTOM-289 - Width:120 - Height:25 - Text:Change Map - Font:Bold - DropDownButton@SLOTS_DROPDOWNBUTTON: - X:PARENT_RIGHT-154 - Y:PARENT_BOTTOM-229 - Width:120 - Height:25 - Font:Bold - Text:Admin - DropDownButton@DIFFICULTY_DROPDOWNBUTTON: - X:PARENT_RIGHT-154 - Y:PARENT_BOTTOM-199 - Width:120 - Height:25 - Font:Bold - Visible:false - Checkbox@ALLOWCHEATS_CHECKBOX: - X: PARENT_RIGHT-154 - Y: PARENT_BOTTOM-169 - Width: 80 - Height: 20 - Text: Allow Cheats - Checkbox@CRATES_CHECKBOX: - X: PARENT_RIGHT-154 - Y: PARENT_BOTTOM-144 - Width: 80 - Height: 20 - Text: Crates - Checkbox@FRAGILEALLIANCES_CHECKBOX: - X: PARENT_RIGHT-154 - Y: PARENT_BOTTOM-119 - Width: 80 - Height: 20 - Text: Fragile Alliances + LeftMargin:50 + Children: + Label@LABEL_CHATTYPE: + Y:0-1 + Width:45 + Height:25 + Align:Right + Text:Chat: Button@DISCONNECT_BUTTON: - X:PARENT_RIGHT-154 - Y:PARENT_BOTTOM-94 + X:PARENT_RIGHT - WIDTH - 20 + Y:PARENT_BOTTOM - HEIGHT - 20 Width:120 Height:25 Text:Disconnect Font:Bold - Button@START_GAME_BUTTON: - X:PARENT_RIGHT-154 - Y:PARENT_BOTTOM-49 - Width:120 - Height:25 - Text:Start Game - Font:Bold TooltipContainer@TOOLTIP_CONTAINER: \ No newline at end of file