]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
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 0d891b69096c8c39a5865e74a500083655cb9e3b..26ddc00a12f7bbf9277196a0a66649da1e4aae95 100644 (file)
@@ -966,6 +966,10 @@ void CL_Screen_Init(void)
        Cvar_RegisterVariable(&vid_touchscreen_outlinealpha);
        Cvar_RegisterVariable(&vid_touchscreen_overlayalpha);
 
        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");
        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 48dcac3ddf6405878af9dda911f8b66e08c06cfb..b604fe139a0a7e7952628c11314d6791c627fc69 100644 (file)
--- a/console.c
+++ b/console.c
@@ -596,6 +596,10 @@ Con_ToggleConsole_f
 */
 void Con_ToggleConsole_f (void)
 {
 */
 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();
        // toggle the 'user wants console' bit
        key_consoleactive ^= KEY_CONSOLEACTIVE_USER;
        Con_ClearNotify();
diff --git a/keys.c b/keys.c
index aa84c237cb6ef7c0474e65b7d5d5731035dbc899..f88ea5a4553394bf681b30679e934a96ee61cf0c 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -1899,6 +1899,10 @@ Key_Event (int key, int ascii, qboolean down)
                        Con_ToggleConsole_f ();
                        return;
                }
                        Con_ToggleConsole_f ();
                        return;
                }
+
+               if (COM_CheckParm ("-noconsole"))
+                       return; // only allow the key bind to turn off console
+
                Key_Console (key, ascii);
                return;
        }
                Key_Console (key, ascii);
                return;
        }