diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 36 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 3 | ||||
-rw-r--r-- | src/cgame/cg_servercmds.c | 21 |
3 files changed, 46 insertions, 14 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 2cb4e305..f77e44a3 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -3156,6 +3156,41 @@ static qboolean CG_DrawQueue( void ) return qtrue; } + +/* +================= +CG_DrawWarmup +================= +*/ +static void CG_DrawWarmup( void ) +{ + int sec = 0; + int w; + int h; + float size = 0.5f; + char text[ MAX_STRING_CHARS ] = S_COLOR_RED "Warmup Time:"; + + if( !cg.warmupTime ) + return; + + sec = ( cg.warmupTime - cg.time ) / 1000; + + if( sec < 0 ) + return; + + + w = UI_Text_Width( text, size, 0 ); + h = UI_Text_Height( text, size, 0 ); + UI_Text_Paint( 320 - w / 2, 200, size, colorWhite, text, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); + + Com_sprintf( text, sizeof( text ), + "----- %s" S_COLOR_WHITE " -----", + ( sec ) ? va( "^%d%d", sec % 7, sec ) : S_COLOR_GREEN "FIGHT!" ); + + w = UI_Text_Width( text, size, 0 ); + UI_Text_Paint( 320 - w / 2, 200 + 1.5f * h, size, colorWhite, text, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); +} + //================================================================================== /* @@ -3206,6 +3241,7 @@ static void CG_Draw2D( void ) CG_DrawVote( TEAM_NONE ); CG_DrawVote( cg.predictedPlayerState.stats[ STAT_TEAM ] ); + CG_DrawWarmup( ); CG_DrawQueue( ); // don't draw center string if scoreboard is up diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 22d312d9..90e88648 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1059,8 +1059,7 @@ typedef struct int voiceChatBufferOut; // warmup countdown - int warmup; - int warmupCount; + int warmupTime; //========================== diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index cfb3ad59..920858fc 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -137,13 +137,7 @@ static void CG_ParseWarmup( void ) info = CG_ConfigString( CS_WARMUP ); warmup = atoi( info ); - cg.warmupCount = -1; - - if( warmup == 0 && cg.warmup ) - { - } - - cg.warmup = warmup; + cg.warmupTime = warmup; } /* @@ -176,7 +170,7 @@ void CG_SetConfigValues( void ) cgs.humanStage = cgs.humanCredits = cgs.humanNextStageThreshold = 0; cgs.levelStartTime = atoi( CG_ConfigString( CS_LEVEL_START_TIME ) ); - cg.warmup = atoi( CG_ConfigString( CS_WARMUP ) ); + cg.warmupTime = atoi( CG_ConfigString( CS_WARMUP ) ); } @@ -414,10 +408,6 @@ static void CG_MapRestart( void ) // we really should clear more parts of cg here and stop sounds - // play the "fight" sound if this is a restart without warmup - if( cg.warmup == 0 ) - CG_CenterPrint( "FIGHT!", 120, GIANTCHAR_WIDTH * 2 ); - trap_Cvar_Set( "cg_thirdPerson", "0" ); } @@ -519,6 +509,13 @@ void CG_Menu( int menu, int arg ) type = DT_COMMAND; break; + case MN_WARMUP: + longMsg = "You must wait until the warmup time is finished " + "before joining a team. "; + shortMsg = "You cannot join a team during warmup."; + type = DT_COMMAND; + break; + case MN_A_TEAMCHANGEBUILDTIMER: longMsg = "You cannot leave the Alien team until your build timer " "has expired."; |