diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index 5d9117db95..daa6fca16a 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -181,6 +181,7 @@ namespace OpenRA public Hotkey TogglePixelDoubleKey = new Hotkey(Keycode.PERIOD, Modifiers.None); public Hotkey DevReloadChromeKey = new Hotkey(Keycode.C, Modifiers.Ctrl | Modifiers.Shift); + public Hotkey HideUserInterfaceKey = new Hotkey(Keycode.H, Modifiers.Ctrl | Modifiers.Shift); public Hotkey TakeScreenshotKey = new Hotkey(Keycode.P, Modifiers.Ctrl); public Hotkey Production01Key = new Hotkey(Keycode.F1, Modifiers.None); diff --git a/OpenRA.Game/Widgets/RootWidget.cs b/OpenRA.Game/Widgets/RootWidget.cs index 66bd63f2f8..dad5b216b2 100644 --- a/OpenRA.Game/Widgets/RootWidget.cs +++ b/OpenRA.Game/Widgets/RootWidget.cs @@ -31,6 +31,14 @@ namespace OpenRA.Widgets return true; } + if (hk == Game.Settings.Keys.HideUserInterfaceKey) + { + foreach (var child in this.Children) + child.Visible ^= true; + + return true; + } + if (hk == Game.Settings.Keys.TakeScreenshotKey) { if (e.Event == KeyInputEvent.Down) diff --git a/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs index 88d65fb469..6a7412acc1 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs @@ -466,6 +466,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var hotkeys = new Dictionary() { { "DevReloadChromeKey", "Reload Chrome" }, + { "HideUserInterfaceKey", "Hide UI" }, { "TakeScreenshotKey", "Take screenshot" } };