diff options
author | Jeff Kent <jeff@jkent.net> | 2017-04-13 11:30:00 +0000 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-04-15 17:24:15 +0200 |
commit | 9edb8f8a9eb94ca6150a13900716750a710a74bc (patch) | |
tree | 132bcf00fa387c12c260099c81fba7bda9dbbeb8 /src/ui/ui_main.c | |
parent | 6d4cacd5ad49d654e99c458f5002c70732c9e0a6 (diff) |
multi-protocol: implement messagemode[2] in the ui module, for use in non-1.1 clients
Diffstat (limited to 'src/ui/ui_main.c')
-rw-r--r-- | src/ui/ui_main.c | 22 |
1 files changed, 21 insertions, 1 deletions
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 |