summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c3
-rw-r--r--src/cgame/cg_local.h13
-rw-r--r--src/cgame/cg_main.c49
-rw-r--r--src/cgame/cg_servercmds.c10
4 files changed, 61 insertions, 14 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 5df933af..a805f8ac 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -1663,7 +1663,8 @@ static void CG_DrawStageReport( rectDef_t *rect, float text_x, float text_y,
char s[ MAX_TOKEN_CHARS ];
int tx, w, kills;
- if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR )
+ if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ||
+ cg.intermissionStarted )
return;
if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 8db55818..143403e1 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -593,11 +593,13 @@ typedef struct localEntity_s
typedef struct
{
- int client;
- int score;
- int ping;
- int time;
- int team;
+ int client;
+ int score;
+ int ping;
+ int time;
+ int team;
+ weapon_t weapon;
+ upgrade_t upgrade;
} score_t;
// each client has an associated clientInfo_t
@@ -1248,6 +1250,7 @@ typedef struct
sfxHandle_t lCannonWarningSound;
qhandle_t buildWeaponTimerPie[ 8 ];
+ qhandle_t upgradeClassIconShader;
} cgMedia_t;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 0239c95d..839e6b17 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -797,6 +797,8 @@ static void CG_RegisterGraphics( void )
for( i = 0; i < 8; i++ )
cgs.media.buildWeaponTimerPie[ i ] = trap_R_RegisterShader( buildWeaponTimerPieShaders[ i ] );
+
+ cgs.media.upgradeClassIconShader = trap_R_RegisterShader( "icons/icona_upgrade.tga" );
cgs.media.machinegunBrassModel = trap_R_RegisterModel( "models/weapons2/shells/m_shell.md3" );
cgs.media.shotgunBrassModel = trap_R_RegisterModel( "models/weapons2/shells/s_shell.md3" );
@@ -1481,6 +1483,7 @@ static const char *CG_FeederItemText( float feederID, int index, int column, qha
clientInfo_t *info = NULL;
int team = -1;
score_t *sp = NULL;
+ qboolean showIcons = qfalse;
*handle = -1;
@@ -1489,6 +1492,13 @@ static const char *CG_FeederItemText( float feederID, int index, int column, qha
else if( feederID == FEEDER_HUMANTEAM_LIST )
team = PTE_HUMANS;
+ if( ( atoi( CG_ConfigString( CS_CLIENTS_READY ) ) & ( 1 << sp->client ) ) &&
+ cg.intermissionStarted )
+ showIcons = qfalse;
+ else if( cg.snap->ps.pm_type == PM_SPECTATOR || cg.snap->ps.pm_flags & PMF_FOLLOW ||
+ team == cg.snap->ps.stats[ STAT_PTEAM ] || cg.intermissionStarted )
+ showIcons = qtrue;
+
info = CG_InfoFromScoreIndex( index, team, &scoreIndex );
sp = &cg.scores[ scoreIndex ];
@@ -1497,24 +1507,55 @@ static const char *CG_FeederItemText( float feederID, int index, int column, qha
switch( column )
{
case 0:
+ if( showIcons )
+ {
+ if( sp->weapon != WP_NONE )
+ *handle = cg_weapons[ sp->weapon ].weaponIcon;
+ }
+ break;
+
+ case 1:
+ if( showIcons )
+ {
+ if( sp->team == PTE_HUMANS && sp->upgrade != UP_NONE )
+ *handle = cg_upgrades[ sp->upgrade ].upgradeIcon;
+ else if( sp->team == PTE_ALIENS )
+ {
+ switch( sp->weapon )
+ {
+ case WP_ABUILD2:
+ case WP_ALEVEL1_UPG:
+ case WP_ALEVEL2_UPG:
+ case WP_ALEVEL3_UPG:
+ *handle = cgs.media.upgradeClassIconShader;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ break;
+
+ case 2:
if( ( atoi( CG_ConfigString( CS_CLIENTS_READY ) ) & ( 1 << sp->client ) ) &&
cg.intermissionStarted )
return "Ready";
break;
- case 1:
+ case 3:
return info->name;
break;
- case 2:
+ case 4:
return va( "%d", info->score );
break;
- case 3:
+ case 5:
return va( "%4d", sp->time );
break;
- case 4:
+ case 6:
if( sp->ping == -1 )
return "connecting";
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c
index a045a6ec..e529d1ab 100644
--- a/src/cgame/cg_servercmds.c
+++ b/src/cgame/cg_servercmds.c
@@ -45,10 +45,12 @@ static void CG_ParseScores( void )
for( i = 0; i < cg.numScores; i++ )
{
//
- cg.scores[ i ].client = atoi( CG_Argv( i * 4 + 4 ) );
- cg.scores[ i ].score = atoi( CG_Argv( i * 4 + 5 ) );
- cg.scores[ i ].ping = atoi( CG_Argv( i * 4 + 6 ) );
- cg.scores[ i ].time = atoi( CG_Argv( i * 4 + 7 ) );
+ cg.scores[ i ].client = atoi( CG_Argv( i * 6 + 4 ) );
+ cg.scores[ i ].score = atoi( CG_Argv( i * 6 + 5 ) );
+ cg.scores[ i ].ping = atoi( CG_Argv( i * 6 + 6 ) );
+ cg.scores[ i ].time = atoi( CG_Argv( i * 6 + 7 ) );
+ cg.scores[ i ].weapon = atoi( CG_Argv( i * 6 + 8 ) );
+ cg.scores[ i ].upgrade = atoi( CG_Argv( i * 6 + 9 ) );
if( cg.scores[ i ].client < 0 || cg.scores[ i ].client >= MAX_CLIENTS )
cg.scores[ i ].client = 0;