Fixed the dynamic teamnames system up a bit to reduce traffic

This commit is contained in:
Richard Allen 2002-03-17 21:32:23 +00:00
parent abe676091a
commit a4f2fce79b
4 changed files with 24 additions and 10 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.28 2002/03/17 21:32:23 jbravo
// Fixed the dynamic teamnames system up a bit to reduce traffic
//
// Revision 1.27 2002/03/17 13:18:14 jbravo
// Replace the fraglimit on the HUD with the clients score
//
@ -2501,7 +2504,7 @@ static qboolean CG_DrawFollow( void ) {
vec4_t color;
const char *name;
int team;
char combinedName[512], teamname[128];
char combinedName[512];
if ( !(cg.snap->ps.pm_flags & PMF_FOLLOW) ) {
return qfalse;
@ -2517,13 +2520,11 @@ static qboolean CG_DrawFollow( void ) {
if ( cgs.gametype >= GT_TEAM ) {
team = cgs.clientinfo[ cg.snap->ps.clientNum ].team;
if (team == TEAM_RED) {
trap_Cvar_VariableStringBuffer("g_RQ3_team1name", teamname, sizeof(teamname));
Com_sprintf (combinedName, sizeof(combinedName), "%s/%s",
cgs.clientinfo[cg.snap->ps.clientNum].name, teamname);
cgs.clientinfo[cg.snap->ps.clientNum].name, cg_RQ3_team1name.string);
} else {
trap_Cvar_VariableStringBuffer("g_RQ3_team2name", teamname, sizeof(teamname));
Com_sprintf (combinedName, sizeof(combinedName), "%s/%s",
cgs.clientinfo[cg.snap->ps.clientNum].name, teamname);
cgs.clientinfo[cg.snap->ps.clientNum].name, cg_RQ3_team2name.string);
}
x = 0.5 * ( 640 - GIANT_WIDTH -16 * CG_DrawStrlen( combinedName ) );
CG_DrawStringExt( x, 40, combinedName, color, qtrue, qtrue, GIANT_WIDTH - 16, GIANT_HEIGHT - 16, 0 );

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.54 2002/03/17 21:32:23 jbravo
// Fixed the dynamic teamnames system up a bit to reduce traffic
//
// Revision 1.53 2002/03/16 21:50:09 niceass
// All new shell ejection code
//
@ -1546,6 +1549,8 @@ extern vmCvar_t cg_enableBreath;
extern cheat_cvar cheats[30];
// JBravo: To signal cgame that lca is in progress
extern vmCvar_t RQ3_lca;
extern vmCvar_t cg_RQ3_team1name;
extern vmCvar_t cg_RQ3_team2name;
//Slicer: matchmode team status cvars
extern vmCvar_t RQ3_team1;
extern vmCvar_t RQ3_team2;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.46 2002/03/17 21:32:23 jbravo
// Fixed the dynamic teamnames system up a bit to reduce traffic
//
// Revision 1.45 2002/03/16 21:49:08 niceass
// All new shell ejection code
//
@ -260,6 +263,8 @@ vmCvar_t cg_enableDust;
cheat_cvar cheats[30];
// JBravo: lca in progress cvar
vmCvar_t RQ3_lca;
vmCvar_t cg_RQ3_team1name;
vmCvar_t cg_RQ3_team2name;
//Slicer: matchmode team status cvars
vmCvar_t MM_team1;
vmCvar_t MM_team2;
@ -366,6 +371,9 @@ static cvarTable_t cvarTable[] = { // bk001129
{ &cg_hudFiles, "cg_hudFiles", "ui/hud.txt", CVAR_ARCHIVE},
{ &cg_enableDust, "g_enableDust", "0", CVAR_SERVERINFO},
#endif
// JBravo: dynamic teamnames.
{ &cg_RQ3_team1name, "g_RQ3_team1name", "Swat", CVAR_ARCHIVE | CVAR_SERVERINFO | CVAR_USERINFO },
{ &cg_RQ3_team2name, "g_RQ3_team2name", "Robbers", CVAR_ARCHIVE | CVAR_SERVERINFO | CVAR_USERINFO },
// NiceAss: Taken out of the missionpack
{ &cg_enableBreath, "g_enableBreath", "0", CVAR_SERVERINFO},

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.14 2002/03/17 21:32:23 jbravo
// Fixed the dynamic teamnames system up a bit to reduce traffic
//
// Revision 1.13 2002/03/17 00:40:23 jbravo
// Adding variable team names. g_RQ3_team1name and g_RQ3_team2name. Fixed
// Slicers fraglimit check.
@ -314,7 +317,6 @@ static int CG_TeamplayScoreboard(int maxClients)
int y;
int size, players;
char *String;
char teamname[128];
if (cg.time > cg.scoreStartTime+300) {
Alpha = (cos((cg.time-cg.scoreStartTime) / 400.0f) + 1.0f) * 0.25f + 0.5f;
@ -355,9 +357,8 @@ static int CG_TeamplayScoreboard(int maxClients)
MAKERGBA(color, 0.0f, 0.0f, 0.0f, 1.0f);
trap_Cvar_VariableStringBuffer("g_RQ3_team1name", teamname, sizeof(teamname));
CG_DrawSmallStringColor(SB_MIDDLE-SB_WIDTH+SB_PADDING-6, SB_START_HEIGHT+SB_PADDING,
teamname, color);
cg_RQ3_team1name.string, color);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 0.8f);
CG_DrawSmallStringColor(SB_MIDDLE-SB_WIDTH+SB_PADDING-6, SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
@ -390,9 +391,8 @@ static int CG_TeamplayScoreboard(int maxClients)
SB_WIDTH, (SMALLCHAR_HEIGHT+SB_PADDING*2), SB_LINE_WIDTH, color );
MAKERGBA(color, 0.0f, 0.0f, 0.0f, 1.0f);
trap_Cvar_VariableStringBuffer("g_RQ3_team2name", teamname, sizeof(teamname));
CG_DrawSmallStringColor(SB_MIDDLE+SB_PADDING+6, SB_START_HEIGHT+SB_PADDING,
teamname, color);
cg_RQ3_team2name.string, color);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 0.8f);
CG_DrawSmallStringColor(SB_MIDDLE+SB_PADDING+6, SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),