From: divverent Date: Fri, 2 Sep 2011 21:09:25 +0000 (+0000) Subject: add -noconsole option to block console input and display X-Git-Tag: xonotic-v0.6.0~163^2~231 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=114bbf72f19c5757278b5f00f7bd757c790e9f60;p=xonotic%2Fdarkplaces.git add -noconsole option to block console input and display git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11321 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.c b/cl_screen.c index 0d891b69..26ddc00a 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -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"); diff --git a/console.c b/console.c index 48dcac3d..b604fe13 100644 --- 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 aa84c237..f88ea5a4 100644 --- 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; }