Merge pull request #8582 from Mailaender/hide-ui-hotkey
Added a hide UI hotkey
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -346,6 +346,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var globalTemplate = hotkeyList.Get("GLOBAL_TEMPLATE");
|
||||
var unitTemplate = hotkeyList.Get("UNIT_TEMPLATE");
|
||||
var productionTemplate = hotkeyList.Get("PRODUCTION_TEMPLATE");
|
||||
var developerTemplate = hotkeyList.Get("DEVELOPER_TEMPLATE");
|
||||
hotkeyList.RemoveChildren();
|
||||
|
||||
Func<bool> returnTrue = () => true;
|
||||
@@ -465,6 +466,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var hotkeys = new Dictionary<string, string>()
|
||||
{
|
||||
{ "DevReloadChromeKey", "Reload Chrome" },
|
||||
{ "HideUserInterfaceKey", "Hide UI" },
|
||||
{ "TakeScreenshotKey", "Take screenshot" }
|
||||
};
|
||||
|
||||
@@ -473,7 +475,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
hotkeyList.AddChild(header);
|
||||
|
||||
foreach (var kv in hotkeys)
|
||||
BindHotkeyPref(kv, ks, globalTemplate, hotkeyList);
|
||||
BindHotkeyPref(kv, ks, developerTemplate, hotkeyList);
|
||||
}
|
||||
|
||||
return () =>
|
||||
|
||||
@@ -451,6 +451,20 @@ Container@SETTINGS_PANEL:
|
||||
X: PARENT_RIGHT-WIDTH+1
|
||||
Width: 80
|
||||
Height: 25
|
||||
Container@DEVELOPER_TEMPLATE:
|
||||
Width: 262
|
||||
Height: 25
|
||||
Visible: false
|
||||
Children:
|
||||
Label@FUNCTION:
|
||||
Y: 0-1
|
||||
Width: PARENT_RIGHT - 115
|
||||
Height: 25
|
||||
Align: Right
|
||||
HotkeyEntry@HOTKEY:
|
||||
X: PARENT_RIGHT-WIDTH
|
||||
Width: 110
|
||||
Height: 25
|
||||
Container@ADVANCED_PANEL:
|
||||
Width: PARENT_RIGHT
|
||||
Height: PARENT_BOTTOM
|
||||
|
||||
@@ -456,6 +456,20 @@ Background@SETTINGS_PANEL:
|
||||
X: PARENT_RIGHT-WIDTH+1
|
||||
Width: 80
|
||||
Height: 25
|
||||
Container@DEVELOPER_TEMPLATE:
|
||||
Width: 262
|
||||
Height: 25
|
||||
Visible: false
|
||||
Children:
|
||||
Label@FUNCTION:
|
||||
Y: 0-1
|
||||
Width: PARENT_RIGHT - 115
|
||||
Height: 25
|
||||
Align: Right
|
||||
HotkeyEntry@HOTKEY:
|
||||
X: PARENT_RIGHT-WIDTH
|
||||
Width: 110
|
||||
Height: 25
|
||||
Container@ADVANCED_PANEL:
|
||||
X: 5
|
||||
Y: 50
|
||||
|
||||
Reference in New Issue
Block a user