add -noconsole option to block console input and display
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 2 Sep 2011 21:09:25 +0000 (21:09 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 2 Sep 2011 21:09:25 +0000 (21:09 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11321 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
console.c
keys.c

index 0d891b6..26ddc00 100644 (file)
@@ -966,6 +966,10 @@ void CL_Screen_Init(void)
        Cvar_RegisterVariable(&vid_touchscreen_outlinealpha);
        Cvar_RegisterVariable(&vid_touchscreen_overlayalpha);
 
+       // if we want no console, turn it off here too
+       if (COM_CheckParm ("-noconsole"))
+               Cvar_SetQuick(&scr_conforcewhiledisconnected, "0");
+
        Cmd_AddCommand ("sizeup",SCR_SizeUp_f, "increase view size (increases viewsize cvar)");
        Cmd_AddCommand ("sizedown",SCR_SizeDown_f, "decrease view size (decreases viewsize cvar)");
        Cmd_AddCommand ("screenshot",SCR_ScreenShot_f, "takes a screenshot of the next rendered frame");
index 48dcac3..b604fe1 100644 (file)
--- a/console.c
+++ b/console.c
@@ -596,6 +596,10 @@ Con_ToggleConsole_f
 */
 void Con_ToggleConsole_f (void)
 {
+       if (COM_CheckParm ("-noconsole"))
+               if (!(key_consoleactive & KEY_CONSOLEACTIVE_USER))
+                       return; // only allow the key bind to turn off console
+
        // toggle the 'user wants console' bit
        key_consoleactive ^= KEY_CONSOLEACTIVE_USER;
        Con_ClearNotify();
diff --git a/keys.c b/keys.c
index aa84c23..f88ea5a 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -1899,6 +1899,10 @@ Key_Event (int key, int ascii, qboolean down)
                        Con_ToggleConsole_f ();
                        return;
                }
+
+               if (COM_CheckParm ("-noconsole"))
+                       return; // only allow the key bind to turn off console
+
                Key_Console (key, ascii);
                return;
        }