summaryrefslogtreecommitdiff
path: root/src/client/cl_console.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2007-10-02 21:29:25 +0000
committerTim Angus <tim@ngus.net>2007-10-02 21:29:25 +0000
commitdd0dd03f6f94a15b8764973e4c893526d8cfd722 (patch)
tree4a3989e08a16d58e6b4f9fda7380e20ba05b8a28 /src/client/cl_console.c
parente6513f95705560250f00f1ccc0707e01e318192f (diff)
* Merge of ioq3-r1189
+ Fix bug that prevented key up events getting to cgame/ui when not in game + Use Key_[GS]etCatcher everywhere to set keycatcher + Clear all key states when the catcher changes * Slim down client userinfo somewhat * Remove some redundant client autocomplete commands * Actually make use of "menuStack" in the UI module + No longer close all menus when exiting one, instead reverting to the next one on the stack + Cleanup the menu activation functions a little * Truncate text in list columns if it exceeds the column width * Remove maxChars field from columns member of ITEM_TYPE_LISTBOX * Revert r992 due to more general and less buggy/hacky fix from ioq3
Diffstat (limited to 'src/client/cl_console.c')
-rw-r--r--src/client/cl_console.c30
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;
}