From 9edb8f8a9eb94ca6150a13900716750a710a74bc Mon Sep 17 00:00:00 2001 From: Jeff Kent Date: Thu, 13 Apr 2017 11:30:00 +0000 Subject: multi-protocol: implement messagemode[2] in the ui module, for use in non-1.1 clients --- src/ui/ui_main.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/ui/ui_main.c') diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 33f0012..8eaa77c 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -761,7 +761,7 @@ void _UI_Refresh( int realtime ) UI_SetColor( NULL ); //TA: don't draw the cursor whilst loading - if( Menu_Count( ) > 0 && !trap_Cvar_VariableValue( "ui_loading" ) ) + if( Menu_Count( ) > 0 && !trap_Cvar_VariableValue( "ui_loading" ) && !trap_Cvar_VariableValue( "ui_hideCursor" ) ) UI_DrawHandlePic( uiInfo.uiDC.cursorx-16, uiInfo.uiDC.cursory-16, 32, 32, uiInfo.uiDC.Assets.cursor); #ifndef NDEBUG @@ -4094,6 +4094,23 @@ static void UI_RunMenuScript(char **args) { if( ( cmd = uiInfo.tremHumanBuildList[ uiInfo.tremHumanBuildIndex ].cmd ) ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } + else if( Q_stricmp( name, "Say" ) == 0 ) + { + char buffer[ MAX_CVAR_VALUE_STRING ]; + trap_Cvar_VariableStringBuffer( "ui_sayBuffer", buffer, sizeof( buffer ) ); + + if( !buffer[ 0 ] ) + ; + else if( ui_chatCommands.integer && ( buffer[ 0 ] == '/' || + buffer[ 0 ] == '\\' ) ) + { + trap_Cmd_ExecuteText( EXEC_APPEND, va( "%s\n", buffer + 1 ) ); + } + else if( uiInfo.chatTeam ) + trap_Cmd_ExecuteText( EXEC_APPEND, va( "say_team \"%s\"\n", buffer ) ); + else + trap_Cmd_ExecuteText( EXEC_APPEND, va( "say \"%s\"\n", buffer ) ); + } else if( Q_stricmp( name, "PTRCRestore" ) == 0 ) { int len; @@ -6257,6 +6274,8 @@ vmCvar_t ui_serverStatusTimeOut; vmCvar_t ui_bank; vmCvar_t ui_winner; +vmCvar_t ui_chatCommands; + // bk001129 - made static to avoid aliasing static cvarTable_t cvarTable[] = { @@ -6385,6 +6404,7 @@ static cvarTable_t cvarTable[] = { { &ui_bank, "ui_bank", "0", 0 }, + { &ui_chatCommands, "ui_chatCommands", "1", CVAR_ARCHIVE}, }; // bk001129 - made static to avoid aliasing -- cgit