diff options
author | Tim Angus <tim@ngus.net> | 2004-05-29 21:50:23 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2004-05-29 21:50:23 +0000 |
commit | b26e835db568d6d8bbf524ac2eaa415385911717 (patch) | |
tree | e9297301f9ba2fb0a8c4d0e841c9cd6ca247005c /src | |
parent | 2991a700937b44831092e8db2f01442d217876e5 (diff) |
* Added code to report number of spawns remaining when spawning
* Tweaked some font values
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_draw.c | 20 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 3 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 4 | ||||
-rw-r--r-- | src/cgame/cg_servercmds.c | 3 | ||||
-rw-r--r-- | src/game/bg_public.h | 1 | ||||
-rw-r--r-- | src/game/g_main.c | 4 |
6 files changed, 33 insertions, 2 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 6ca952e0..266d03e9 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -2911,6 +2911,26 @@ static qboolean CG_DrawQueue( void ) cg.snap->ps.persistant[ PERS_QUEUEPOS ] + 1 ); w = CG_Text_Width( buffer, 0.7f, 0 ); + CG_Text_Paint( 320 - w / 2, 360, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); + + if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + { + if( cgs.numAlienSpawns == 1 ) + Com_sprintf( buffer, MAX_STRING_CHARS, "There is 1 spawn remaining." ); + else + Com_sprintf( buffer, MAX_STRING_CHARS, "There are %d spawns remaining.", + cgs.numAlienSpawns ); + } + else if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + { + if( cgs.numHumanSpawns == 1 ) + Com_sprintf( buffer, MAX_STRING_CHARS, "There is 1 spawn remaining." ); + else + Com_sprintf( buffer, MAX_STRING_CHARS, "There are %d spawns remaining.", + cgs.numHumanSpawns ); + } + + w = CG_Text_Width( buffer, 0.7f, 0 ); CG_Text_Paint( 320 - w / 2, 400, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); return qtrue; diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index e637742e..36d859fb 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1276,6 +1276,9 @@ typedef struct int alienStage; int humanStage; + + int numAlienSpawns; + int numHumanSpawns; // // locally derived information from gamestate diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 8dea2aed..4995cde0 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -338,8 +338,8 @@ static cvarTable_t cvarTable[ ] = { &pmove_msec, "pmove_msec", "8", 0}, { &cg_noTaunt, "cg_noTaunt", "0", CVAR_ARCHIVE}, { &cg_noProjectileTrail, "cg_noProjectileTrail", "0", CVAR_ARCHIVE}, - { &cg_smallFont, "ui_smallFont", "0.25", CVAR_ARCHIVE}, - { &cg_bigFont, "ui_bigFont", "0.4", CVAR_ARCHIVE}, + { &cg_smallFont, "ui_smallFont", "0.2", CVAR_ARCHIVE}, + { &cg_bigFont, "ui_bigFont", "0.5", CVAR_ARCHIVE}, { &cg_oldRail, "cg_oldRail", "1", CVAR_ARCHIVE}, { &cg_oldRocket, "cg_oldRocket", "1", CVAR_ARCHIVE}, { &cg_oldPlasma, "cg_oldPlasma", "1", CVAR_ARCHIVE}, diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index 3083e37b..a8844206 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -154,6 +154,7 @@ void CG_SetConfigValues( void ) &cgs.humanBuildPointsPowered ); sscanf( CG_ConfigString( CS_STAGES ), "%d %d", &cgs.alienStage, &cgs.humanStage ); + sscanf( CG_ConfigString( CS_SPAWNS ), "%d %d", &cgs.numAlienSpawns, &cgs.numHumanSpawns ); cgs.levelStartTime = atoi( CG_ConfigString( CS_LEVEL_START_TIME ) ); cg.warmup = atoi( CG_ConfigString( CS_WARMUP ) ); @@ -288,6 +289,8 @@ static void CG_ConfigStringModified( void ) if( cgs.humanStage != oldHumanStage ) CG_AnnounceHumanStageTransistion( oldHumanStage, cgs.humanStage ); } + else if( num == CS_SPAWNS ) + sscanf( str, "%d %d", &cgs.numAlienSpawns, &cgs.numHumanSpawns ); else if( num == CS_LEVEL_START_TIME ) cgs.levelStartTime = atoi( str ); else if( num == CS_VOTE_TIME ) diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 1021cdf6..17333648 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -67,6 +67,7 @@ //TA: extra stuff: #define CS_BUILDPOINTS 28 #define CS_STAGES 29 +#define CS_SPAWNS 30 #define CS_MODELS 33 #define CS_SOUNDS (CS_MODELS+MAX_MODELS) diff --git a/src/game/g_main.c b/src/game/g_main.c index 4b2aa39d..2a54b521 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -916,6 +916,10 @@ void G_CountSpawns( void ) if( ent->s.modelindex == BA_H_SPAWN && ent->health > 0 ) level.numHumanSpawns++; } + + //let the client know how many spawns there are + trap_SetConfigstring( CS_SPAWNS, va( "%d %d", + level.numAlienSpawns, level.numHumanSpawns ) ); } |