summaryrefslogtreecommitdiff
path: root/src/ui/ui_main.c
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-11-02 20:00:38 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:17 +0000
commitc49ee670d39f11f5eea3bd621c7e918e41c20876 (patch)
tree2d7cd3af524520e01296f5f089eee09b95b2848d /src/ui/ui_main.c
parent93f6321471501aba564eff619ff71fa605fced4a (diff)
* When ui_chatCommands is enabled, change the "Say:" or "Say to Team:" text in the prompt to "Command:" when appropriate, so the user can tell that their text will not be sent as chat but executed instead. (tjw)
Diffstat (limited to 'src/ui/ui_main.c')
-rw-r--r--src/ui/ui_main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c
index a1423e86..46961723 100644
--- a/src/ui/ui_main.c
+++ b/src/ui/ui_main.c
@@ -3058,6 +3058,26 @@ static void UI_RunMenuScript( char **args )
else
trap_Cmd_ExecuteText( EXEC_APPEND, va( "say \"%s\"\n", buffer ) );
}
+ else if( Q_stricmp( name, "SayKeydown" ) == 0 )
+ {
+ if( ui_chatCommands.integer )
+ {
+ char buffer[ MAX_CVAR_VALUE_STRING ];
+ trap_Cvar_VariableStringBuffer( "ui_sayBuffer", buffer, sizeof( buffer ) );
+
+ if( buffer[ 0 ] == '/' || buffer[ 0 ] == '\\' )
+ {
+ Menus_ReplaceActiveByName( "say_command" );
+ }
+ else
+ {
+ if( !uiInfo.chatTeam )
+ Menus_ReplaceActiveByName( "say" );
+ else
+ Menus_ReplaceActiveByName( "say_team" );
+ }
+ }
+ }
else if( Q_stricmp( name, "playMovie" ) == 0 )
{
if( uiInfo.previewMovie >= 0 )