diff options
Diffstat (limited to 'src/client/cl_console.c')
-rw-r--r-- | src/client/cl_console.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/client/cl_console.c b/src/client/cl_console.c index 9d2d8e7c..d740696d 100644 --- a/src/client/cl_console.c +++ b/src/client/cl_console.c @@ -70,14 +70,14 @@ Con_ToggleConsole_f */ void Con_ToggleConsole_f (void) { // Can't toggle the console when it's the only thing available - if ( cls.state == CA_DISCONNECTED && cls.keyCatchers == KEYCATCH_CONSOLE ) { + if ( cls.state == CA_DISCONNECTED && Key_GetCatcher( ) == KEYCATCH_CONSOLE ) { return; } Field_Clear( &g_consoleField ); g_consoleField.widthInChars = g_console_field_width; - cls.keyCatchers ^= KEYCATCH_CONSOLE; + Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_CONSOLE ); } /* @@ -91,7 +91,7 @@ void Con_MessageMode_f (void) { Field_Clear( &chatField ); chatField.widthInChars = 30; - cls.keyCatchers ^= KEYCATCH_MESSAGE; + Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE ); } /* @@ -104,7 +104,7 @@ void Con_MessageMode2_f (void) { chat_team = qtrue; Field_Clear( &chatField ); chatField.widthInChars = 25; - cls.keyCatchers ^= KEYCATCH_MESSAGE; + Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE ); } /* @@ -121,7 +121,7 @@ void Con_MessageMode3_f (void) { chat_team = qfalse; Field_Clear( &chatField ); chatField.widthInChars = 30; - cls.keyCatchers ^= KEYCATCH_MESSAGE; + Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE ); } /* @@ -138,7 +138,7 @@ void Con_MessageMode4_f (void) { chat_team = qfalse; Field_Clear( &chatField ); chatField.widthInChars = 30; - cls.keyCatchers ^= KEYCATCH_MESSAGE; + Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE ); } /* @@ -377,7 +377,7 @@ void CL_ConsolePrint( char *txt ) { con.initialized = qtrue; } - if( !skipnotify && !( cls.keyCatchers & KEYCATCH_CONSOLE ) ) { + if( !skipnotify && !( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) ) { Cmd_SaveCmdContext( ); // feed the text to cgame @@ -453,7 +453,7 @@ Draw the editline after a ] prompt void Con_DrawInput (void) { int y; - if ( cls.state != CA_DISCONNECTED && !(cls.keyCatchers & KEYCATCH_CONSOLE ) ) { + if ( cls.state != CA_DISCONNECTED && !(Key_GetCatcher( ) & KEYCATCH_CONSOLE ) ) { return; } @@ -594,7 +594,7 @@ void Con_DrawConsole( void ) { // if disconnected, render console full screen if ( cls.state == CA_DISCONNECTED ) { - if ( !( cls.keyCatchers & (KEYCATCH_UI | KEYCATCH_CGAME)) ) { + if ( !( Key_GetCatcher( ) & (KEYCATCH_UI | KEYCATCH_CGAME)) ) { Con_DrawSolidConsole( 1.0 ); return; } @@ -604,11 +604,11 @@ void Con_DrawConsole( void ) { Con_DrawSolidConsole( con.displayFrac ); } - if( cls.keyCatchers & ( KEYCATCH_UI | KEYCATCH_CGAME ) ) + if( Key_GetCatcher( ) & ( KEYCATCH_UI | KEYCATCH_CGAME ) ) return; // draw the chat line - if( cls.keyCatchers & KEYCATCH_MESSAGE ) + if( Key_GetCatcher( ) & KEYCATCH_MESSAGE ) { int skip; @@ -638,12 +638,8 @@ Scroll it up or down ================== */ void Con_RunConsole (void) { - // Don't allow any key states at all when keycatching - if ( cls.keyCatchers != 0 ) - Key_ClearStates( ); - // decide on the destination height of the console - if ( cls.keyCatchers & KEYCATCH_CONSOLE ) + if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) con.finalFrac = 0.5; // half screen else con.finalFrac = 0; // none visible @@ -697,7 +693,7 @@ void Con_Close( void ) { return; } Field_Clear( &g_consoleField ); - cls.keyCatchers &= ~KEYCATCH_CONSOLE; + Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_CONSOLE ); con.finalFrac = 0; // none visible con.displayFrac = 0; } |