diff --git a/OpenRA.Game/GameRules/Settings.cs b/OpenRA.Game/GameRules/Settings.cs index 625abb8a8c..7d6d88ba2f 100644 --- a/OpenRA.Game/GameRules/Settings.cs +++ b/OpenRA.Game/GameRules/Settings.cs @@ -77,6 +77,7 @@ namespace OpenRA.GameRules public bool SanityCheckUnsyncedCode = false; public int Samples = 25; public bool IgnoreVersionMismatch = false; + public bool DeveloperMenu = false; } public class GraphicSettings diff --git a/OpenRA.Mods.RA/Widgets/Logic/MainMenuButtonsLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/MainMenuButtonsLogic.cs index 4edf081189..c4b590304b 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/MainMenuButtonsLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/MainMenuButtonsLogic.cs @@ -81,7 +81,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic }); }; - widget.Get("MAINMENU_BUTTON_ASSET_BROWSER").OnClick = () => + var assetBrowserButton = widget.Get("MAINMENU_BUTTON_ASSET_BROWSER"); + assetBrowserButton.OnClick = () => { Menu = MenuType.None; Game.OpenWindow("ASSETBROWSER_BG", new WidgetArgs() @@ -90,7 +91,18 @@ namespace OpenRA.Mods.RA.Widgets.Logic }); }; - widget.Get("MAINMENU_BUTTON_QUIT").OnClick = () => Game.Exit(); + var quitButton = widget.Get("MAINMENU_BUTTON_QUIT"); + quitButton.OnClick = () => Game.Exit(); + + // Hide developer-specific buttons + if (Game.Settings.Debug.DeveloperMenu == false) + { + assetBrowserButton.IsVisible = () => false; + var offset = assetBrowserButton.Bounds.Y - quitButton.Bounds.Y; + quitButton.Bounds.Y += offset; + rootMenu.Bounds.Height += offset; + rootMenu.Bounds.Y -= offset/2; + } } void RemoveShellmapUI() diff --git a/OpenRA.Mods.RA/Widgets/Logic/SettingsMenuLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/SettingsMenuLogic.cs index 194c801ad6..d149a2ef6e 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/SettingsMenuLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/SettingsMenuLogic.cs @@ -234,6 +234,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic verboseNatDiscoveryCheckbox.IsChecked = () => Game.Settings.Server.VerboseNatDiscovery; verboseNatDiscoveryCheckbox.OnClick = () => Game.Settings.Server.VerboseNatDiscovery ^= true; + var developerMenuCheckbox = debug.Get("DEVELOPER_MENU_CHECKBOX"); + developerMenuCheckbox.IsChecked = () => Game.Settings.Debug.DeveloperMenu; + developerMenuCheckbox.OnClick = () => Game.Settings.Debug.DeveloperMenu ^= true; + bg.Get("BUTTON_CLOSE").OnClick = () => { int x, y; diff --git a/mods/ra/chrome/settings.yaml b/mods/ra/chrome/settings.yaml index cf54bbbba1..8ccca04add 100644 --- a/mods/ra/chrome/settings.yaml +++ b/mods/ra/chrome/settings.yaml @@ -379,3 +379,9 @@ Background@SETTINGS_MENU: Width:300 Height:20 Text:Detailed NAT logging + Checkbox@DEVELOPER_MENU_CHECKBOX: + X:0 + Y:180 + Width:300 + Height:20 + Text:Enable Asset Browser (requires restart) \ No newline at end of file