Move hardcoded screenshot hotkey into yaml.

This commit is contained in:
Paul Chote
2017-09-03 18:02:52 +00:00
committed by reaperrr
parent 8c4afa414a
commit c759a68492
11 changed files with 53 additions and 16 deletions

View File

@@ -60,6 +60,7 @@ namespace OpenRA
public static string EngineVersion { get; private set; }
static Task discoverNat;
static bool takeScreenshot = false;
public static OrderManager JoinServer(string host, int port, string password, bool recordReplay = true)
{
@@ -630,7 +631,10 @@ namespace OpenRA
InnerLogicTick(worldRenderer.World.OrderManager);
}
public static bool TakeScreenshot = false;
public static void TakeScreenshot()
{
takeScreenshot = true;
}
static void RenderTick()
{
@@ -666,9 +670,9 @@ namespace OpenRA
using (new PerfSample("render_flip"))
Renderer.EndFrame(new DefaultInputHandler(OrderManager.World));
if (TakeScreenshot)
if (takeScreenshot)
{
TakeScreenshot = false;
takeScreenshot = false;
TakeScreenshotInner();
}
}

View File

@@ -143,12 +143,6 @@ namespace OpenRA.Widgets
Root.Visible ^= true;
return true;
}
if (hk == Game.Settings.Keys.TakeScreenshotKey)
{
Game.TakeScreenshot = true;
return true;
}
}
if (KeyboardFocusWidget != null)