From ce87e18f902963581efc1ac74024661403725bd9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 27 Feb 2021 13:47:30 +0100 Subject: [PATCH] - block Escape to toggle the console while AppActive is false. This is for testing #174 - this is the only place in the code where the escape key is explicitly checked. --- source/common/console/c_console.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/common/console/c_console.cpp b/source/common/console/c_console.cpp index 365d92889..48c7b86de 100644 --- a/source/common/console/c_console.cpp +++ b/source/common/console/c_console.cpp @@ -70,6 +70,8 @@ #define RIGHTMARGIN 8 #define BOTTOMARGIN 12 +extern bool AppActive; + CUSTOM_CVAR(Int, con_buffersize, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { // ensure a minimum size @@ -1039,7 +1041,7 @@ static bool C_HandleKey (event_t *ev, FCommandBuffer &buffer) // Close console and clear command line. But if we're in the // fullscreen console mode, there's nothing to fall back on // if it's closed, so open the main menu instead. - if (gamestate == GS_STARTUP) + if (gamestate == GS_STARTUP || !AppActive) { return false; }