summaryrefslogtreecommitdiff
path: root/src/ui/ui_atoms.c
diff options
context:
space:
mode:
authorJeff Kent <jeff@jkent.net>2017-04-13 11:30:00 +0000
committer/dev/humancontroller <devhc@example.com>2017-04-15 17:24:15 +0200
commit9edb8f8a9eb94ca6150a13900716750a710a74bc (patch)
tree132bcf00fa387c12c260099c81fba7bda9dbbeb8 /src/ui/ui_atoms.c
parent6d4cacd5ad49d654e99c458f5002c70732c9e0a6 (diff)
multi-protocol: implement messagemode[2] in the ui module, for use in non-1.1 clients
Diffstat (limited to 'src/ui/ui_atoms.c')
-rw-r--r--src/ui/ui_atoms.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ui/ui_atoms.c b/src/ui/ui_atoms.c
index 64efa91..a3033c4 100644
--- a/src/ui/ui_atoms.c
+++ b/src/ui/ui_atoms.c
@@ -294,6 +294,36 @@ static void UI_CalcPostGameStats( void ) {
}
+static void UI_MessageMode_f( void )
+{
+ char *arg = UI_Argv( 0 );
+
+ trap_Cvar_Set( "ui_sayBuffer", "" );
+
+ switch( arg[ 11 ] )
+ {
+ default:
+ case '\0':
+ // Global
+ uiInfo.chatTeam = qfalse;
+ break;
+
+ case '2':
+ // Team
+ uiInfo.chatTeam = qtrue;
+ break;
+ }
+
+ trap_Key_SetCatcher( KEYCATCH_UI );
+ Menus_CloseByName( "say" );
+ Menus_CloseByName( "say_team" );
+
+ if( uiInfo.chatTeam )
+ Menus_ActivateByName( "say_team" );
+ else
+ Menus_ActivateByName( "say" );
+}
+
/*
=================
@@ -377,6 +407,13 @@ qboolean UI_ConsoleCommand( int realTime )
}
}
+ if( Q_stricmp ( cmd, "messagemode" ) == 0 ||
+ Q_stricmp ( cmd, "messagemode2" ) == 0 )
+ {
+ UI_MessageMode_f();
+ return qtrue;
+ }
+
return qfalse;
}