Take screenshot in dialogs #13184

This commit is contained in:
rob-v
2017-04-24 16:41:11 +02:00
parent 12f2fc3410
commit 382fefebfe
3 changed files with 26 additions and 59 deletions

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Widgets
{
public static class Ui
{
public static Widget Root = new RootWidget();
public static Widget Root = new ContainerWidget();
public static long LastTickTime = Game.RunTime;
@@ -128,6 +128,29 @@ namespace OpenRA.Widgets
/// <param name="e">Key input data</param>
public static bool HandleKeyPress(KeyInput e)
{
if (e.Event == KeyInputEvent.Down)
{
var hk = Hotkey.FromKeyInput(e);
if (hk == Game.Settings.Keys.DevReloadChromeKey)
{
ChromeProvider.Initialize(Game.ModData);
return true;
}
if (hk == Game.Settings.Keys.HideUserInterfaceKey)
{
Root.Visible ^= true;
return true;
}
if (hk == Game.Settings.Keys.TakeScreenshotKey)
{
Game.TakeScreenshot = true;
return true;
}
}
if (KeyboardFocusWidget != null)
return KeyboardFocusWidget.HandleKeyPressOuter(e);