diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs index 30cfaba1e3..00c9d9a13e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs @@ -18,28 +18,31 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic { - public enum IngameInfoPanel { AutoSelect, Map, Objectives, Debug, Chat } + public enum IngameInfoPanel { AutoSelect, Map, Objectives, Debug, Chat, LobbbyOptions } class GameInfoLogic : ChromeLogic { readonly World world; + readonly ModData modData; readonly Action hideMenu; readonly IObjectivesPanel iop; IngameInfoPanel activePanel; bool hasError; [ObjectCreator.UseCtor] - public GameInfoLogic(Widget widget, World world, IngameInfoPanel initialPanel, Action hideMenu) + public GameInfoLogic(Widget widget, ModData modData, World world, IngameInfoPanel initialPanel, Action hideMenu) { var panels = new Dictionary Setup)>() { { IngameInfoPanel.Objectives, ("OBJECTIVES_PANEL", "Objectives", SetupObjectivesPanel) }, { IngameInfoPanel.Map, ("MAP_PANEL", "Briefing", SetupMapPanel) }, + { IngameInfoPanel.LobbbyOptions, ("LOBBY_OPTIONS_PANEL", "Options", SetupLobbyOptionsPanel) }, { IngameInfoPanel.Debug, ("DEBUG_PANEL", "Debug", SetupDebugPanel) }, { IngameInfoPanel.Chat, ("CHAT_PANEL", "Chat", SetupChatPanel) } }; this.world = world; + this.modData = modData; this.hideMenu = hideMenu; activePanel = initialPanel; @@ -58,6 +61,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (missionData != null && !string.IsNullOrEmpty(missionData.Briefing)) visiblePanels.Add(IngameInfoPanel.Map); + // Lobby Options tab + visiblePanels.Add(IngameInfoPanel.LobbbyOptions); + // Debug/Cheats tab // Can't use DeveloperMode.Enabled because there is a hardcoded hack to *always* // enable developer mode for singleplayer games, but we only want to show the button @@ -135,6 +141,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic Game.LoadWidget(world, "MAP_PANEL", mapPanelContainer, new WidgetArgs()); } + void SetupLobbyOptionsPanel(ButtonWidget mapTabButton, Widget optionsPanelContainer) + { + Game.LoadWidget(world, "LOBBY_OPTIONS_PANEL", optionsPanelContainer, new WidgetArgs() + { + { "getMap", (Func)(() => modData.MapCache[world.Map.Uid]) }, + { "configurationDisabled", (Func)(() => true) } + }); + } + void SetupDebugPanel(ButtonWidget debugTabButton, Widget debugPanelContainer) { if (debugTabButton != null) diff --git a/mods/cnc/chrome/ingame-info-lobby-options.yaml b/mods/cnc/chrome/ingame-info-lobby-options.yaml new file mode 100644 index 0000000000..a9e06cf885 --- /dev/null +++ b/mods/cnc/chrome/ingame-info-lobby-options.yaml @@ -0,0 +1,48 @@ +Container@LOBBY_OPTIONS_PANEL: + Height: PARENT_BOTTOM + Width: PARENT_RIGHT + Children: + ScrollPanel: + Logic: LobbyOptionsLogic + X: 15 + Y: 15 + Width: 482 + Height: 345 + Children: + Container@LOBBY_OPTIONS: + X: 18 + Y: 9 + Width: PARENT_RIGHT - 24 - 18 + Children: + Container@CHECKBOX_ROW_TEMPLATE: + Height: 34 + Children: + Checkbox@A: + Width: 220 + Height: 20 + Font: Regular + Visible: False + TooltipContainer: TOOLTIP_CONTAINER + Checkbox@B: + X: 225 + Width: 220 + Height: 20 + Font: Regular + Visible: False + TooltipContainer: TOOLTIP_CONTAINER + Container@DROPDOWN_ROW_TEMPLATE: + Height: 34 + Width: PARENT_RIGHT + Children: + Label@A_DESC: + Width: 140 + Height: 25 + Align: Right + Visible: False + DropDownButton@A: + X: 145 + Width: 180 + Height: 25 + Font: Regular + Visible: False + TooltipContainer: TOOLTIP_CONTAINER diff --git a/mods/cnc/chrome/ingame-info.yaml b/mods/cnc/chrome/ingame-info.yaml index 92b82d43ca..14b6320180 100644 --- a/mods/cnc/chrome/ingame-info.yaml +++ b/mods/cnc/chrome/ingame-info.yaml @@ -116,3 +116,6 @@ Container@GAME_INFO_PANEL: Container@CHAT_PANEL: Width: PARENT_RIGHT Height: PARENT_BOTTOM + Container@LOBBY_OPTIONS_PANEL: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM diff --git a/mods/cnc/chrome/ingame-infostats.yaml b/mods/cnc/chrome/ingame-infostats.yaml index 1600001b84..3eb33443ff 100644 --- a/mods/cnc/chrome/ingame-infostats.yaml +++ b/mods/cnc/chrome/ingame-infostats.yaml @@ -8,20 +8,20 @@ Container@SKIRMISH_STATS: Children: Label@MISSION: X: 15 - Y: 12 - Width: 85 - Height: 25 + Y: 17 + Width: 80 + Height: 20 Font: MediumBold Text: Mission: Label@STATS_STATUS: - X: 100 - Y: 12 - Width: PARENT_RIGHT - 10 - Height: 25 + X: 95 + Y: 17 + Width: PARENT_RIGHT - 110 + Height: 20 Font: MediumBold Checkbox@STATS_CHECKBOX: X: 15 - Y: 45 + Y: 50 Width: 482 Height: 20 Font: Bold diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 6869d12525..dc1ac4c716 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -123,6 +123,7 @@ ChromeLayout: cnc|chrome/ingame-infoscripterror.yaml cnc|chrome/ingame-infoobjectives.yaml cnc|chrome/ingame-infostats.yaml + cnc|chrome/ingame-info-lobby-options.yaml cnc|chrome/ingame-debuginfo.yaml cnc|chrome/music.yaml cnc|chrome/settings.yaml diff --git a/mods/common/chrome/ingame-info-lobby-options.yaml b/mods/common/chrome/ingame-info-lobby-options.yaml new file mode 100644 index 0000000000..f26e9fd989 --- /dev/null +++ b/mods/common/chrome/ingame-info-lobby-options.yaml @@ -0,0 +1,45 @@ +Container@LOBBY_OPTIONS_PANEL: + Height: PARENT_BOTTOM + Width: PARENT_RIGHT + Children: + ScrollPanel: + Logic: LobbyOptionsLogic + X: 20 + Y: 20 + Width: 482 + Height: 350 + Children: + Container@LOBBY_OPTIONS: + X: 10 + Y: 9 + Width: PARENT_RIGHT - 10 - 24 + Children: + Container@CHECKBOX_ROW_TEMPLATE: + Height: 30 + Children: + Checkbox@A: + Width: 220 + Height: 20 + Visible: False + TooltipContainer: TOOLTIP_CONTAINER + Checkbox@B: + X: 225 + Width: 220 + Height: 20 + Visible: False + TooltipContainer: TOOLTIP_CONTAINER + Container@DROPDOWN_ROW_TEMPLATE: + Height: 30 + Width: PARENT_RIGHT + Children: + Label@A_DESC: + Width: 140 + Height: 25 + Align: Right + Visible: False + DropDownButton@A: + X: 145 + Width: 180 + Height: 25 + Visible: False + TooltipContainer: TOOLTIP_CONTAINER diff --git a/mods/common/chrome/ingame-info.yaml b/mods/common/chrome/ingame-info.yaml index 27412aaaa0..060dd2b208 100644 --- a/mods/common/chrome/ingame-info.yaml +++ b/mods/common/chrome/ingame-info.yaml @@ -146,3 +146,7 @@ Container@GAME_INFO_PANEL: Y: 65 Width: PARENT_RIGHT Height: PARENT_BOTTOM + Container@LOBBY_OPTIONS_PANEL: + Y: 65 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 097234c5b1..f46e0fe52b 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -76,6 +76,7 @@ ChromeLayout: common|chrome/ingame-infobriefing.yaml common|chrome/ingame-infoobjectives.yaml d2k|chrome/ingame-infostats.yaml + common|chrome/ingame-info-lobby-options.yaml d2k|chrome/ingame-observer.yaml d2k|chrome/ingame-player.yaml common|chrome/ingame-perf.yaml diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index b46925fa21..90db419fc7 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -92,6 +92,7 @@ ChromeLayout: common|chrome/ingame-infobriefing.yaml common|chrome/ingame-infoobjectives.yaml common|chrome/ingame-infostats.yaml + common|chrome/ingame-info-lobby-options.yaml common|chrome/ingame-menu.yaml ra|chrome/ingame-observer.yaml ra|chrome/ingame-player.yaml diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index 87b35d7e9f..82840d3108 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -138,6 +138,7 @@ ChromeLayout: common|chrome/ingame-infobriefing.yaml common|chrome/ingame-infoobjectives.yaml common|chrome/ingame-infostats.yaml + common|chrome/ingame-info-lobby-options.yaml ts|chrome/ingame-observer.yaml ts|chrome/ingame-player.yaml common|chrome/ingame-perf.yaml