Index: client/console.c =================================================================== --- client/console.c (revision 6643) +++ client/console.c (working copy) @@ -41,6 +41,7 @@ static cvar_t *con_notifytime; static cvar_t *con_drawNotify; +static cvar_t *con_chatConsole; static cvar_t *con_chatmode; cvar_t *con_printText; @@ -290,6 +291,7 @@ con_notifytime = Cvar_Get( "con_notifytime", "3", CVAR_ARCHIVE ); con_drawNotify = Cvar_Get( "con_drawNotify", "1", CVAR_ARCHIVE ); con_printText = Cvar_Get( "con_printText", "1", CVAR_ARCHIVE ); + con_chatConsole = Cvar_Get( "con_chatConsole", "1", CVAR_ARCHIVE ); con_chatmode = Cvar_Get( "con_chatmode", "3", CVAR_ARCHIVE ); Cmd_AddCommand( "toggleconsole", Con_ToggleConsole_f ); @@ -549,14 +551,16 @@ //================ void Con_DrawNotify( void ) { - int v; + int v, y, lines; char *text; int i; int time; char *s; int skip; unsigned int charbuffer_width; - + int rows = 10; + int smallCharHeight = SCR_strHeight( cls.fontSystemSmall ); + v = 0; if( con_drawNotify->integer ) { @@ -575,9 +579,19 @@ v += SCR_strHeight( cls.fontSystemSmall ); } } - + if( cls.key_dest == key_message ) { + if( con_chatConsole->integer ) + { + // prepare to draw the chat console + lines = smallCharHeight * rows; + y = lines - smallCharHeight-14; + v = v + y; + Con_ClearNotify(); + Con_DrawChatConsole(); + } + if( chat_team ) { SCR_DrawString( 8, v, ALIGN_LEFT_TOP, "say_team:", cls.fontSystemSmall, colorWhite ); @@ -680,6 +694,36 @@ Con_DrawInput( lines ); } +//================ +//Con_DrawChatConsole +// +//Draws the chat console +//================ +void Con_DrawChatConsole( void ) +{ + int i, y; + int rows = 10; + char *text; + int row; + unsigned int lines; + int smallCharHeight = SCR_strHeight( cls.fontSystemSmall ); + + lines = smallCharHeight * rows; + + // prepare to draw the text + y = lines - smallCharHeight-14-smallCharHeight; + + row = con.display; // first line to be drawn + + // draw from the bottom up + for( i = 0; i < rows; i++, y -= smallCharHeight, row++ ) + { + if( row >= con.numlines ) + break; // reached top of scrollback + text = con.text[row] ? con.text[row] : ""; + SCR_DrawString( 8, y, ALIGN_LEFT_TOP, text, cls.fontSystemSmall, colorWhite ); + } +} //================ //Con_DisplayList Index: client/console.h =================================================================== --- client/console.h (revision 6643) +++ client/console.h (working copy) @@ -33,6 +33,7 @@ void Con_Init( void ); void Con_Shutdown( void ); void Con_DrawConsole( float frac ); +void Con_DrawChatConsole( void ); void Con_Print( char *txt ); void Con_CenteredPrint( char *text ); void Con_Clear_f( void );