/* ======================================================================================================================================= CG_DrawScoreboard Draw the normal in-game scoreboard. ======================================================================================================================================= */ qboolean CG_DrawScoreboard(void) { int x = 0, y = 0, w; // TTimo init float fade; float *fadeColor; char *s; if (cg_fixedAspect.integer) { CG_SetScreenPlacement(PLACE_CENTER, PLACE_CENTER); } // don't draw anything if the menu or console is up if (cg_paused.integer) { cg.deferredPlayerLoading = 0; return qfalse; } // still need to see 'mission failed' message in SP if (cgs.gametype == GT_SINGLE_PLAYER && cg.predictedPlayerState.pm_type == PM_DEAD) { return qfalse; } if (cgs.gametype == GT_SINGLE_PLAYER && cg.predictedPlayerState.pm_type == PM_INTERMISSION) { cg.deferredPlayerLoading = 0; return qfalse; } // don't draw scoreboard during death while warmup up if (cg.warmup && !cg.showScores) { return qfalse; } if (cg.showScores || cg.predictedPlayerState.pm_type == PM_DEAD || cg.predictedPlayerState.pm_type == PM_INTERMISSION) { fade = 1.0; } else { fadeColor = CG_FadeColor(cg.scoreFadeTime, FADE_TIME); if (!fadeColor) { // next time scoreboard comes up, don't print killer cg.deferredPlayerLoading = 0; cg.killerName[0] = 0; return qfalse; } fade = *fadeColor; } // fragged by ... line if (cg.killerName[0]) { s = va("Killed by %s", cg.killerName); w = CG_DrawStrlen(s) * BIGCHAR_WIDTH; x = (SCREEN_WIDTH - w) / 2; y = 40; CG_DrawBigString(x, y, s, fade); } // current rank // ---- (SA) enclosed this so it doesn't draw for SP if (cgs.gametype != GT_SINGLE_PLAYER && cgs.gametype != GT_WOLF) { // added wolf multiplayer check if (cg.snap->ps.persistant[PERS_TEAM] != TEAM_SPECTATOR) { if (cgs.gametype < GT_TEAM) { s = va("%s place with %i", CG_PlaceString(cg.snap->ps.persistant[PERS_RANK] + 1), cg.snap->ps.persistant[PERS_SCORE]); w = CG_DrawStrlen(s) * BIGCHAR_WIDTH; x = (SCREEN_WIDTH - w) / 2; y = 60; CG_DrawBigString(x, y, s, fade); } else { if (cg.teamScores[0] == cg.teamScores[1]) { s = va("Teams are tied at %i", cg.teamScores[0]); } else if (cg.teamScores[0] >= cg.teamScores[1]) { s = va("Red leads %i to %i", cg.teamScores[0], cg.teamScores[1]); } else { s = va("Blue leads %i to %i", cg.teamScores[1], cg.teamScores[0]); } w = CG_DrawStrlen(s) * BIGCHAR_WIDTH; x = (SCREEN_WIDTH - w) / 2; y = 60; CG_DrawBigString(x, y, s, fade); } } // scoreboard x = 320 - SCOREBOARD_WIDTH / 2; y = 86; #if 0 CG_DrawBigStringColor(x, y, "SCORE PING TIME NAME", fadeColor); CG_DrawBigStringColor(x, y + 12, "---- - ---- ---- -------------- - ", fadeColor); #endif CG_DrawPic(x + 1 * 16, y, 64, 32, cgs.media.scoreboardScore); CG_DrawPic(x + 6 * 16 + 8, y, 64, 32, cgs.media.scoreboardPing); CG_DrawPic(x + 11 * 16 + 8, y, 64, 32, cgs.media.scoreboardTime); CG_DrawPic(x + 16 * 16, y, 64, 32, cgs.media.scoreboardName); y += 32; } // NERVE - SMF if (cgs.gametype == GT_WOLF) { // teamplay scoreboard x = 320 - SCOREBOARD_WIDTH / 2 + 20 + 20; y = 40; y = WM_ScoreboardOverlay(x, y, fade); if (cg.teamScores[0] >= cg.teamScores[1]) { y = WM_TeamScoreboard(x, y, TEAM_RED, fade); y = WM_TeamScoreboard(x, y, TEAM_BLUE, fade); } else { y = WM_TeamScoreboard(x, y, TEAM_BLUE, fade); y = WM_TeamScoreboard(x, y, TEAM_RED, fade); } WM_TeamScoreboard(x, y, TEAM_SPECTATOR, fade); } // - NERVE - SMF } else if (cgs.gametype >= GT_TEAM) {
/* ======================================================================================================================================= CG_DrawClientScore ======================================================================================================================================= */ static void CG_DrawClientScore(int y, score_t *score, float *color, float fade, qboolean largeFormat) { char string[1024]; vec3_t headAngles; clientInfo_t *ci; int iconx, headx; if (score->client < 0 || score->client >= cgs.maxclients) { Com_Printf("Bad score->client: %i\n", score->client); return; } ci = &cgs.clientinfo[score->client]; iconx = SB_BOTICON_X + (SB_RATING_WIDTH / 2); headx = SB_HEAD_X + (SB_RATING_WIDTH / 2); // draw the handicap or bot skill marker (unless player has flag) if (ci->powerups & (1 << PW_NEUTRALFLAG)) { if (largeFormat) { CG_DrawFlagModel(iconx, y - (32 - BIGCHAR_HEIGHT) / 2, 32, 32, TEAM_FREE, qfalse); } else { CG_DrawFlagModel(iconx, y, 16, 16, TEAM_FREE, qfalse); } } else if (ci->powerups & (1 << PW_REDFLAG)) { if (largeFormat) { CG_DrawFlagModel(iconx, y - (32 - BIGCHAR_HEIGHT) / 2, 32, 32, TEAM_RED, qfalse); } else { CG_DrawFlagModel(iconx, y, 16, 16, TEAM_RED, qfalse); } } else if (ci->powerups & (1 << PW_BLUEFLAG)) { if (largeFormat) { CG_DrawFlagModel(iconx, y - (32 - BIGCHAR_HEIGHT) / 2, 32, 32, TEAM_BLUE, qfalse); } else { CG_DrawFlagModel(iconx, y, 16, 16, TEAM_BLUE, qfalse); } } else { if (ci->botSkill > 0 && ci->botSkill <= 5) { if (cg_drawIcons.integer) { if (largeFormat) { CG_DrawPic(iconx, y - (32 - BIGCHAR_HEIGHT) / 2, 32, 32, cgs.media.botSkillShaders[ci->botSkill - 1]); } else { CG_DrawPic(iconx, y, 16, 16, cgs.media.botSkillShaders[ci->botSkill - 1]); } } } else if (ci->handicap < 100) { Com_sprintf(string, sizeof(string), "%i", ci->handicap); if (cgs.gametype == GT_TOURNAMENT) { CG_DrawSmallStringColor(iconx, y - SMALLCHAR_HEIGHT / 2, string, color); } else { CG_DrawSmallStringColor(iconx, y, string, color); } } // draw the wins / losses if (cgs.gametype == GT_TOURNAMENT) { Com_sprintf(string, sizeof(string), "%i/%i", ci->wins, ci->losses); if (ci->handicap < 100 && !ci->botSkill) { CG_DrawSmallStringColor(iconx, y + SMALLCHAR_HEIGHT / 2, string, color); } else { CG_DrawSmallStringColor(iconx, y, string, color); } } } // draw the face VectorClear(headAngles); headAngles[YAW] = 180; if (largeFormat) { CG_DrawHead(headx, y - (ICON_SIZE - BIGCHAR_HEIGHT) / 2, ICON_SIZE, ICON_SIZE, score->client, headAngles); } else { CG_DrawHead(headx, y, 16, 16, score->client, headAngles); } #ifdef MISSIONPACK // draw the team task if (ci->teamTask != TEAMTASK_NONE) { if (ci->teamTask == TEAMTASK_OFFENSE) { CG_DrawPic(headx + 48, y, 16, 16, cgs.media.assaultShader); } else if (ci->teamTask == TEAMTASK_DEFENSE) { CG_DrawPic(headx + 48, y, 16, 16, cgs.media.defendShader); } } #endif // draw the score line if (score->ping == -1) { Com_sprintf(string, sizeof(string), " connecting %s", ci->name); } else if (ci->team == TEAM_SPECTATOR) { Com_sprintf(string, sizeof(string), " SPECT %3i %4i %s", score->ping, score->time, ci->name); } else { Com_sprintf(string, sizeof(string), "%5i %4i %4i %s", score->score, score->ping, score->time, ci->name); } // highlight your position if (score->client == cg.snap->ps.clientNum) { float hcolor[4]; int rank; localClient = qtrue; if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR || cgs.gametype >= GT_TEAM) { rank = -1; } else { rank = cg.snap->ps.persistant[PERS_RANK] & ~RANK_TIED_FLAG; } if (rank == 0) { hcolor[0] = 0; hcolor[1] = 0; hcolor[2] = 0.7f; } else if (rank == 1) { hcolor[0] = 0.7f; hcolor[1] = 0; hcolor[2] = 0; } else if (rank == 2) { hcolor[0] = 0.7f; hcolor[1] = 0.7f; hcolor[2] = 0; } else { hcolor[0] = 0.7f; hcolor[1] = 0.7f; hcolor[2] = 0.7f; } hcolor[3] = fade * 0.7; CG_FillRect(SB_SCORELINE_X + BIGCHAR_WIDTH + (SB_RATING_WIDTH / 2), y, 640 - SB_SCORELINE_X - BIGCHAR_WIDTH, BIGCHAR_HEIGHT + 1, hcolor); } CG_DrawBigString(SB_SCORELINE_X + (SB_RATING_WIDTH / 2), y, string, fade); // add the "ready" marker for intermission exiting if (cg.snap->ps.stats[STAT_CLIENTS_READY] & (1 << score->client)) { CG_DrawBigStringColor(iconx, y, "READY", color); } }
/* ======================================================================================================================================= CG_DrawScoreboard ======================================================================================================================================= */ static void CG_DrawClientScore(int x, int y, score_t *score, float *color, float fade) { char string[1024]; vec3_t headAngles; clientInfo_t *ci; if (score->client < 0 || score->client >= cgs.maxclients) { Com_Printf("Bad score->client: %i\n", score->client); return; } ci = &cgs.clientinfo[score->client]; // draw the handicap or bot skill marker if (ci->botSkill > 0 && ci->botSkill <= 5) { CG_DrawPic(0, y - 8, 32, 32, cgs.media.botSkillShaders[ci->botSkill - 1]); } else if (ci->handicap < 100) { Com_sprintf(string, sizeof(string), "%i", ci->handicap); CG_DrawSmallStringColor(8, y, string, color); } // draw the wins / losses if (cgs.gametype == GT_TOURNAMENT) { Com_sprintf(string, sizeof(string), "%i/%i", ci->wins, ci->losses); CG_DrawSmallStringColor(x + SCOREBOARD_WIDTH + 2, y, string, color); } // draw the face VectorClear(headAngles); headAngles[YAW] = 180; CG_DrawHead(x - ICON_SIZE, y - (ICON_SIZE - BIGCHAR_HEIGHT) / 2, ICON_SIZE, ICON_SIZE, score->client, headAngles); if (ci->powerups & (1 << PW_REDFLAG)) { CG_DrawFlagModel(x - ICON_SIZE - ICON_SIZE / 2, y - (ICON_SIZE - BIGCHAR_HEIGHT) / 2, ICON_SIZE, ICON_SIZE, TEAM_RED); } else if (ci->powerups & (1 << PW_BLUEFLAG)) { CG_DrawFlagModel(x - ICON_SIZE - ICON_SIZE / 2, y - (ICON_SIZE - BIGCHAR_HEIGHT) / 2, ICON_SIZE, ICON_SIZE, TEAM_BLUE); } // draw the score line if (score->ping == -1) { Com_sprintf(string, sizeof(string), "connecting %s", ci->name); } else if (ci->team == TEAM_SPECTATOR) { Com_sprintf(string, sizeof(string), "SPECT %4i %4i %s", score->ping, score->time, ci->name); } else { Com_sprintf(string, sizeof(string), "%5i %4i %4i %s", score->score, score->ping, score->time, ci->name); } // highlight your position if (score->client == cg.snap->ps.clientNum) { float hcolor[4]; int rank; if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR || cgs.gametype >= GT_TEAM) { rank = -1; } else { rank = cg.snap->ps.persistant[PERS_RANK] & ~RANK_TIED_FLAG; } if (rank == 0) { hcolor[0] = 0; hcolor[1] = 0; hcolor[2] = 0.7; } else if (rank == 1) { hcolor[0] = 0.7; hcolor[1] = 0; hcolor[2] = 0; } else if (rank == 2) { hcolor[0] = 0.7; hcolor[1] = 0.7; hcolor[2] = 0; } else { hcolor[0] = 0.7; hcolor[1] = 0.7; hcolor[2] = 0.7; } hcolor[3] = fade * 0.7; CG_FillRect(x - 2, y, SCOREBOARD_WIDTH, BIGCHAR_HEIGHT + 1, hcolor); } CG_DrawBigString(x, y, string, fade); // add the "ready" marker for intermission exiting if (cg.snap->ps.stats[STAT_CLIENTS_READY] & (1 << score->client)) { CG_DrawBigStringColor(0, y, "READY", color); } }
static void CG_DrawClientScore( int y, const score_t *score, const float *color, float fade, qboolean largeFormat ) { char string[1024]; vec3_t headAngles; const clientInfo_t *ci; int iconx, headx; #if 0 Com_Printf("---- CG_DrawClientScore() ------\n"); Com_Printf(" client: %d\n", score->client); Com_Printf(" score: %d\n", score->score); Com_Printf(" ping: %d\n", score->ping); Com_Printf(" time: %d\n", score->time); Com_Printf(" scoreFlags: %d\n", score->scoreFlags); Com_Printf(" powerUps: %d\n", score->powerUps); Com_Printf(" accuracy: %d\n", score->accuracy); // Com_Printf(" ...\n"); Com_Printf(" impressiveCount: %d\n", score->impressiveCount); Com_Printf(" excellentCount: %d\n", score->excellentCount); Com_Printf(" gauntletCount: %d\n", score->gauntletCount); Com_Printf(" defendCount: %d\n", score->defendCount); Com_Printf(" assistCount: %d\n", score->assistCount); Com_Printf(" perfect: %d\n", score->perfect); Com_Printf(" team: %d\n", score->team); #endif if ( score->client < 0 || score->client >= cgs.maxclients ) { Com_Printf( "Bad score->client: %i\n", score->client ); return; } ci = &cgs.clientinfo[score->client]; iconx = SB_BOTICON_X + (SB_RATING_WIDTH / 2); headx = SB_HEAD_X + (SB_RATING_WIDTH / 2); // draw the handicap or bot skill marker (unless player has flag) if ( ci->powerups & ( 1 << PW_NEUTRALFLAG ) ) { if( largeFormat ) { CG_DrawFlagModel( iconx, y - ( 32 - BIGCHAR_HEIGHT ) / 2, 32, 32, TEAM_FREE, qfalse ); } else { CG_DrawFlagModel( iconx, y, 16, 16, TEAM_FREE, qfalse ); } } else if ( ci->powerups & ( 1 << PW_REDFLAG ) ) { if( largeFormat ) { CG_DrawFlagModel( iconx, y - ( 32 - BIGCHAR_HEIGHT ) / 2, 32, 32, TEAM_RED, qfalse ); } else { CG_DrawFlagModel( iconx, y, 16, 16, TEAM_RED, qfalse ); } } else if ( ci->powerups & ( 1 << PW_BLUEFLAG ) ) { if( largeFormat ) { CG_DrawFlagModel( iconx, y - ( 32 - BIGCHAR_HEIGHT ) / 2, 32, 32, TEAM_BLUE, qfalse ); } else { CG_DrawFlagModel( iconx, y, 16, 16, TEAM_BLUE, qfalse ); } } else { if ( ci->botSkill > 0 && ci->botSkill <= 5 ) { if ( cg_drawIcons.integer ) { if( largeFormat ) { CG_DrawPic( iconx, y - ( 32 - BIGCHAR_HEIGHT ) / 2, 32, 32, cgs.media.botSkillShaders[ ci->botSkill - 1 ] ); } else { CG_DrawPic( iconx, y, 16, 16, cgs.media.botSkillShaders[ ci->botSkill - 1 ] ); } } } else if ( ci->handicap < 100 ) { Com_sprintf( string, sizeof( string ), "%i", ci->handicap ); if ( CG_IsDuelGame(cgs.gametype) ) CG_DrawSmallStringColor( iconx, y - SMALLCHAR_HEIGHT/2, string, color ); else CG_DrawSmallStringColor( iconx, y, string, color ); } // draw the wins / losses if ( CG_IsDuelGame(cgs.gametype) ) { Com_sprintf( string, sizeof( string ), "%i/%i", ci->wins, ci->losses ); if( ci->handicap < 100 && !ci->botSkill ) { CG_DrawSmallStringColor( iconx, y + SMALLCHAR_HEIGHT/2, string, color ); } else { CG_DrawSmallStringColor( iconx, y, string, color ); } } } // draw the face VectorClear( headAngles ); headAngles[YAW] = 180; if( largeFormat ) { CG_DrawHead( headx, y - ( ICON_SIZE - BIGCHAR_HEIGHT ) / 2, ICON_SIZE, ICON_SIZE, score->client, headAngles, qtrue ); } else { CG_DrawHead( headx, y, 16, 16, score->client, headAngles, qtrue ); } #ifdef MISSIONPACK // draw the team task if ( ci->teamTask != TEAMTASK_NONE ) { if ( ci->teamTask == TEAMTASK_OFFENSE ) { CG_DrawPic( headx + 48, y, 16, 16, cgs.media.assaultShader ); } else if ( ci->teamTask == TEAMTASK_DEFENSE ) { CG_DrawPic( headx + 48, y, 16, 16, cgs.media.defendShader ); } } #endif // draw the score line if ( score->ping == -1 ) { Com_sprintf(string, sizeof(string), " connecting %s", ci->name); //} else if ( ci->team == TEAM_SPECTATOR && cg.numScores > 0) { } else if ( score->team == TEAM_SPECTATOR && cg.numScores > 0) { Com_sprintf(string, sizeof(string), "^3%5i %4i %4i ^7%s", score->score, score->ping, score->time, ci->name); } else if (cg.numScores > 0) { #if 1 Com_sprintf(string, sizeof(string), "%5i %4i %4i %s", score->score, score->ping, score->time, ci->name); #endif #if 0 Com_sprintf(string, sizeof(string), "%5i %4i %4i %i %i %i %i %s %s", score->score, score->ping, score->time, score->alive, score->frags, score->deaths, score->accuracy, weapNames[score->bestWeapon], ci->name); #endif #if 0 Com_sprintf(string, sizeof(string), "%5i %4i %4i %d %s %s", score->score, score->ping, score->time, score->accuracy, weapNames[score->bestWeapon], ci->name); #endif } else if (cg.demoPlayback) { Com_sprintf(string, sizeof(string), " %s", ci->name); } //FIXME wolfcam // highlight your position if ( score->client == cg.snap->ps.clientNum ) { float hcolor[4]; int rank; localClient = qtrue; if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR || cgs.gametype >= GT_TEAM ) { rank = -1; } else { rank = cg.snap->ps.persistant[PERS_RANK] & ~RANK_TIED_FLAG; } if ( rank == 0 ) { hcolor[0] = 0; hcolor[1] = 0; hcolor[2] = 0.7f; } else if ( rank == 1 ) { hcolor[0] = 0.7f; hcolor[1] = 0; hcolor[2] = 0; } else if ( rank == 2 ) { hcolor[0] = 0.7f; hcolor[1] = 0.7f; hcolor[2] = 0; } else { hcolor[0] = 0.7f; hcolor[1] = 0.7f; hcolor[2] = 0.7f; } hcolor[3] = fade * 0.7; CG_FillRect( SB_SCORELINE_X + BIGCHAR_WIDTH + (SB_RATING_WIDTH / 2), y, 640 - SB_SCORELINE_X - BIGCHAR_WIDTH, BIGCHAR_HEIGHT+1, hcolor ); } CG_DrawBigString( SB_SCORELINE_X + (SB_RATING_WIDTH / 2), y, string, fade ); // add the "ready" marker for intermission exiting if ( cg.snap->ps.stats[ STAT_CLIENTS_READY ] & ( 1 << score->client ) ) { CG_DrawBigStringColor( iconx, y, "READY", color ); } }
/* ================ CG_DrawStatusBar_MFQ3 ================ */ void CG_DrawStatusBar_MFQ3( void ) { int color; centity_t *cent; playerState_t *ps; int value; int vehicle = cgs.clientinfo[cg.predictedPlayerState.clientNum].vehicle; int w; static vec4_t colors[] = { // { 0.2, 1.0, 0.2, 1.0 } , { 1.0, 0.2, 0.2, 1.0 }, {0.5, 0.5, 0.5, 1} }; { 1.0f, 0.89f, 0.0f, 1.0f } , // normal, yellow { 1.0f, 0.0f, 0.0f, 1.0f }, // low health, red {0.5f, 0.5f, 0.5f, 1.0f}, // weapon firing, grey { 1.0f, 1.0f, 1.0f, 1.0f }, // health > 100, white { 0.3f, 1.0f, 0.3f, 1.0f } // green }; if ( cg_drawStatus.integer == 0 ) { return; } cent = &cg_entities[cg.snap->ps.clientNum]; ps = &cg.snap->ps; // aiming/targetting reticles CG_Draw_Reticles(); // main background CG_DrawPic( 0, 430, 640, 50, cgs.media.HUDmain ); // // flag // if( cg.predictedPlayerState.objectives & OB_REDFLAG ) { CG_DrawStatusBarFlag( 640 - ICON_SIZE, ClientBase::TEAM_RED ); } else if( cg.predictedPlayerState.objectives & OB_BLUEFLAG ) { CG_DrawStatusBarFlag( 640 - ICON_SIZE, ClientBase::TEAM_BLUE ); } // // RADAR // if( cent->currentState.ONOFF & OO_RADAR_AIR ) { CG_DrawRadarSymbols_AIR(vehicle); } else if( cent->currentState.ONOFF & OO_RADAR_GROUND ) { CG_DrawRadarSymbols_GROUND(vehicle); } else if( availableVehicles[vehicle].radarRange || availableVehicles[vehicle].radarRange2 ) { CG_DrawPic( 440, 280, 200, 200, cgs.media.HUDradar ); CG_DrawSmallString( 595, 320, "OFF", 1.0f); } // // GPS // if( cg.GPS ) { trace_t tr; vec3_t start, end; // main CG_DrawPic( -14, 380, 512, 102, cgs.media.HUDgps ); // heading value = 360 - (int)ps->vehicleAngles[1]; CG_DrawSmallString( 234, 420, va("%i",value), 1.0f ); // altitude VectorCopy( ps->origin, start ); start[2] += availableVehicles[vehicle].mins[2]; VectorCopy( start, end ); end[2] -= 2000; CG_Trace( &tr, start, vec3_origin, vec3_origin, end, cg.snap->ps.clientNum, MASK_SOLID|MASK_WATER ); value = (int)(tr.fraction * 2000); if( value > 100 ) color = 3; else if( value > 50 ) color = 4; else if( value > 25 ) color = 0; else color = 1; if( value < 2000 ) { CG_DrawSmallStringColor( 374, 420, va("%i",value), colors[color] ); } else { CG_DrawSmallStringColor( 374, 420, "XXXX", colors[color] ); } // x coord value = (int)ps->origin[0]; CG_DrawSmallString( 264, 423, va("%i",value), 0.7f ); // y coord value = (int)ps->origin[1]; CG_DrawSmallString( 320, 423, va("%i",value), 0.7f ); } // // INFO // if( !cg.INFO ) { // bit dirty to have NOT but oh well... // main CG_DrawPic( 0, 330, 150, 150, cgs.media.HUDext ); if( availableVehicles[vehicle].caps & HC_GEAR ) { if( cent->currentState.ONOFF & OO_GEAR ) { CG_DrawSmallStringColor( 2, 390, "Gear", colors[4] ); } else { CG_DrawSmallString( 2, 390, "Gear", 1.0f ); } } if( availableVehicles[vehicle].caps & HC_SPEEDBRAKE ) { if( cent->currentState.ONOFF & OO_SPEEDBRAKE ) { CG_DrawSmallStringColor( 2, 410, "Speedbrakes", colors[4] ); } else { CG_DrawSmallString( 2, 410, "Speedbrakes", 1.0f ); } } else { if( cent->currentState.ONOFF & OO_SPEEDBRAKE ) { CG_DrawSmallStringColor( 2, 410, "Brakes", colors[4] ); } else { CG_DrawSmallString( 2, 410, "Brakes", 1.0f ); } } value = ps->stats[STAT_FUEL]; if ( value > 10 ) { color = 3; // white } else if (value > 5) { color = 0; // yellow } else { color = 1; // red } if( (availableVehicles[vehicle].cat & CAT_PLANE) || (availableVehicles[vehicle].cat & CAT_HELO) || (availableVehicles[vehicle].cat & CAT_BOAT) ) { value *= 100; } CG_DrawSmallStringColor( 2, 430, va("Fuel %i", value), colors[color]); } // // FLARES // if( ps->ammo[WP_FLARE+8] > 0 ) { CG_DrawBigString( 600, 462, va("%i", ps->ammo[WP_FLARE]), 1.0f ); } // // speed and throttle // value = ps->speed/10; if ( value > availableVehicles[vehicle].stallspeed * SPEED_GREEN_ARC ) { color = 3; // white } else if (value > availableVehicles[vehicle].stallspeed * SPEED_YELLOW_ARC ) { color = 4; // green } else if (value >= availableVehicles[vehicle].stallspeed) { color = 0; // yellow } else { color = 1; // red } w = CG_DrawStrlen(va("%i",value)) * BIGCHAR_WIDTH; CG_DrawBigStringColor(285-w, 460, va("%i",value), colors[color]); if( ps->throttle > availableVehicles[vehicle].maxthrottle ) { value = ps->throttle - availableVehicles[vehicle].maxthrottle; } else { value = ps->throttle; } CG_DrawPic(295, 443, 50, 37, cgs.media.throttle[value]); // // health // value = (100*ps->stats[STAT_HEALTH]/ps->stats[STAT_MAX_HEALTH]); if( value > 100 ) value = 100; if ( value < 10 ) { color = 1; } else if (value < 25) { color = 0; } else { color = 3; } w = CG_DrawStrlen(va("%i",value)) * BIGCHAR_WIDTH; CG_DrawBigStringColor( 398-w, 460, va("%i",value), colors[color]); // // ammo // if( cent->currentState.weaponNum >= 0 ) { value = ps->ammo[cent->currentState.weaponNum]; w = CG_DrawStrlen(va("%i",value)) * BIGCHAR_WIDTH; CG_DrawBigString (500-w, 460, va("%i",value),1.0f); CG_DrawPic( 416, 440, 24, 45, availableWeapons[availableVehicles[vehicle].weapons[cent->currentState.weaponNum]].iconHandle ); } // // ammo mg // if( ps->ammo[WP_MACHINEGUN+8] > 0 ) { if( cent->currentState.weaponNum >= 0 ) { value = ps->ammo[0]; w = CG_DrawStrlen(va("%i",value)) * BIGCHAR_WIDTH; CG_DrawBigString (180-w, 460, va("%i",value),1.0f); CG_DrawPic( 200, 440, 24, 45, availableWeapons[availableVehicles[vehicle].weapons[0]].iconHandle ); } } }
/* ================= CG_DrawScoreboard Draw the normal in-game scoreboard ================= */ qboolean CG_DrawScoreboard( void ) { int x = 0, y = 0, w; float fade; float *fadeColor; const char *s; // don't draw amuthing if the menu or console is up if ( cg_paused.integer ) { cg.deferredPlayerLoading = 0; return qfalse; } if ( cgs.gametype == GT_SINGLE_PLAYER && cg.predictedPlayerState.pm_type == PM_INTERMISSION ) { cg.deferredPlayerLoading = 0; return qfalse; } // don't draw scoreboard during death while warmup up if ( cg.warmup && !cg.showScores ) { return qfalse; } // NERVE - SMF - added mp wolf check if ( cg.showScores || ( cg.predictedPlayerState.pm_type == PM_DEAD && cgs.gametype < GT_WOLF ) || cg.predictedPlayerState.pm_type == PM_INTERMISSION ) { fade = 1.0; fadeColor = colorWhite; } else { fadeColor = CG_FadeColor( cg.scoreFadeTime, FADE_TIME ); if ( !fadeColor ) { // next time scoreboard comes up, don't print killer cg.deferredPlayerLoading = 0; cg.killerName[0] = 0; return qfalse; } fade = *fadeColor; } // fragged by ... line if ( cg.killerName[0] ) { s = va( "Killed by %s", cg.killerName ); w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH; x = ( SCREEN_WIDTH - w ) / 2; y = 40; CG_DrawBigString( x, y, s, fade ); } // current rank //----(SA) enclosed this so it doesn't draw for SP if ( cgs.gametype != GT_SINGLE_PLAYER && cgs.gametype < GT_WOLF ) { // NERVE - SMF - added wolf multiplayer check if ( cg.snap->ps.persistant[PERS_TEAM] != TEAM_SPECTATOR ) { if ( cgs.gametype < GT_TEAM ) { s = va( "%s place with %i", CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ), cg.snap->ps.persistant[PERS_SCORE] ); w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH; x = ( SCREEN_WIDTH - w ) / 2; y = 60; CG_DrawBigString( x, y, s, fade ); } else { if ( cg.teamScores[0] == cg.teamScores[1] ) { s = va( "Teams are tied at %i", cg.teamScores[0] ); } else if ( cg.teamScores[0] >= cg.teamScores[1] ) { s = va( "Red leads %i to %i",cg.teamScores[0], cg.teamScores[1] ); } else { s = va( "Blue leads %i to %i",cg.teamScores[1], cg.teamScores[0] ); } w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH; x = ( SCREEN_WIDTH - w ) / 2; y = 60; CG_DrawBigString( x, y, s, fade ); } } // scoreboard x = 320 - SCOREBOARD_WIDTH / 2; y = 86; #if 0 CG_DrawBigStringColor( x, y, "SCORE PING TIME NAME", fadeColor ); CG_DrawBigStringColor( x, y + 12, "----- ---- ---- ---------------", fadeColor ); #endif CG_DrawPic( x + 1 * 16, y, 64, 32, cgs.media.scoreboardScore ); CG_DrawPic( x + 6 * 16 + 8, y, 64, 32, cgs.media.scoreboardPing ); CG_DrawPic( x + 11 * 16 + 8, y, 64, 32, cgs.media.scoreboardTime ); CG_DrawPic( x + 16 * 16, y, 64, 32, cgs.media.scoreboardName ); y += 32; } //----(SA) added // Secrets if ( cgs.gametype == GT_SINGLE_PLAYER ) { s = "Secrets: 0/12"; w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH; x = ( SCREEN_WIDTH - w ) / 2; y = 60; // CG_DrawBigStringColor( x, y, s, fadeColor ); } //----(SA) end // NERVE - SMF if ( cgs.gametype >= GT_WOLF ) { INFO_PLAYER_WIDTH = 140; INFO_SCORE_WIDTH = 50; INFO_CLASS_WIDTH = 50; INFO_LATENCY_WIDTH = 40; INFO_TEAM_HEIGHT = 24; INFO_BORDER = 2; INFO_TOTAL_WIDTH = INFO_PLAYER_WIDTH + INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH; x = 20; y = 10; WM_DrawObjectives( x, y, 595, fade ); if ( cgs.gametype == GT_WOLF_STOPWATCH && ( cg.snap->ps.pm_type == PM_INTERMISSION ) ) { y = WM_DrawInfoLine( x, 155, fade ); WM_TeamScoreboard( x, y, TEAM_RED, fade, 18 ); x = 335; WM_TeamScoreboard( x, y, TEAM_BLUE, fade, 18 ); } else { y = 155; WM_TeamScoreboard( x, y, TEAM_RED, fade, 20 ); x = 335; WM_TeamScoreboard( x, y, TEAM_BLUE, fade, 20 ); } } // -NERVE - SMF else if ( cgs.gametype >= GT_TEAM ) { // // teamplay scoreboard // if ( cg.teamScores[0] >= cg.teamScores[1] ) { y = CG_TeamScoreboard( x, y, TEAM_RED, fade ); y = CG_TeamScoreboard( x, y, TEAM_BLUE, fade ); } else { y = CG_TeamScoreboard( x, y, TEAM_BLUE, fade ); y = CG_TeamScoreboard( x, y, TEAM_RED, fade ); } y = CG_TeamScoreboard( x, y, TEAM_SPECTATOR, fade ); } else if ( cgs.gametype != GT_SINGLE_PLAYER ) { //----(SA) modified // // free for all scoreboard // y = CG_TeamScoreboard( x, y, TEAM_FREE, fade ); y = CG_TeamScoreboard( x, y, TEAM_SPECTATOR, fade ); } // load any models that have been deferred if ( ++cg.deferredPlayerLoading > 1 ) { CG_LoadDeferredPlayers(); } return qtrue; }
/* ================= CG_DrawScoreboard ================= */ static void CG_DrawClientScore( int y, score_t *score, float *color, float fade, qboolean largeFormat ) { char string[1024]; vec3_t headAngles; clientInfo_t *ci; int iconx, headx; float scale = 0.35; int h = CG_Text_Height( "Tj", scale, 0 ); //int ty; if ( score->client < 0 || score->client >= cgs.maxclients ) { Com_Printf( "Bad score->client: %i\n", score->client ); return; } color[3] = fade; ci = &cgs.clientinfo[score->client]; iconx = SB_BOTICON_X + (SB_RATING_WIDTH / 2); headx = SB_HEAD_X + (SB_RATING_WIDTH / 2); // draw the handicap or bot skill marker (unless player has flag) if ( ci->powerups & ( 1 << PW_NEUTRALFLAG ) ) { if( largeFormat ) { CG_DrawFlagModel( iconx, y - SB_LARGE_SPACER, SB_LARGE_ICON, SB_LARGE_ICON, TEAM_FREE, qfalse, SCR_CENTER ); } else { CG_DrawFlagModel( iconx, y - SB_SMALL_SPACER, SB_SMALL_ICON, SB_SMALL_ICON, TEAM_FREE, qfalse, SCR_CENTER ); } } else if ( ci->powerups & ( 1 << PW_REDFLAG ) ) { if( largeFormat ) { CG_DrawFlagModel( iconx, y - SB_LARGE_SPACER, SB_LARGE_ICON, SB_LARGE_ICON, TEAM_RED, qfalse, SCR_CENTER ); } else { CG_DrawFlagModel( iconx, y - SB_SMALL_SPACER, SB_SMALL_ICON, SB_SMALL_ICON, TEAM_RED, qfalse, SCR_CENTER ); } } else if ( ci->powerups & ( 1 << PW_BLUEFLAG ) ) { if( largeFormat ) { CG_DrawFlagModel( iconx, y - SB_LARGE_SPACER, SB_LARGE_ICON, SB_LARGE_ICON, TEAM_BLUE, qfalse, SCR_CENTER ); } else { CG_DrawFlagModel( iconx, y - SB_SMALL_SPACER, SB_SMALL_ICON, SB_SMALL_ICON, TEAM_BLUE, qfalse, SCR_CENTER ); } } else { if ( ci->botSkill > 0 && ci->botSkill <= 5 ) { if ( cg_drawIcons.integer ) { if( largeFormat ) { CG_DrawColorPic( iconx, y - SB_LARGE_SPACER, SB_LARGE_ICON, SB_LARGE_ICON, cgs.media.botSkillShaders[ci->botSkill - 1], SCR_CENTER, color ); } else { CG_DrawColorPic( iconx, y - SB_SMALL_SPACER, SB_SMALL_ICON, SB_SMALL_ICON, cgs.media.botSkillShaders[ci->botSkill - 1], SCR_CENTER, color ); } } } else if ( ci->handicap < 100 ) { Com_sprintf( string, sizeof( string ), "%i", ci->handicap ); if ( gt[cgs.gametype].duel ) { if ( cg_highResFonts.integer ) { CG_Text_Paint( iconx, y + h + ((float)h/2), scale, color, string, 0, 0, ITEM_TEXTSTYLE_SHADOWED, SCR_CENTER ); } else { CG_DrawSmallStringColor( iconx, y - SMALLCHAR_HEIGHT/2, string, color, SCR_CENTER ); } } else { if ( cg_highResFonts.integer ) { //w = CG_Text_Width(s, scale, 0); h = CG_Text_Height(string, scale, 0); CG_Text_Paint( iconx, y + h, scale, color, string, 0, 0, ITEM_TEXTSTYLE_SHADOWED, SCR_CENTER ); } else { CG_DrawSmallStringColor( iconx, y, string, color, SCR_CENTER ); } } } // draw the wins / losses if ( gt[cgs.gametype].duel ) { Com_sprintf( string, sizeof( string ), "%i/%i", ci->wins, ci->losses ); if ( ci->handicap < 100 && !ci->botSkill ) { if ( cg_highResFonts.integer ) { CG_Text_Paint( iconx, y + h + ((float)h/2), scale, color, string, 0, 0, ITEM_TEXTSTYLE_SHADOWED, SCR_CENTER ); } else { CG_DrawSmallStringColor( iconx, y + SMALLCHAR_HEIGHT/2, string, color, SCR_CENTER ); } } else { if ( cg_highResFonts.integer ) { CG_Text_Paint( iconx, y + h, scale, color, string, 0, 0, ITEM_TEXTSTYLE_SHADOWED, SCR_CENTER ); } else { CG_DrawSmallStringColor( iconx, y, string, color, SCR_CENTER ); } } } } // draw the face VectorClear( headAngles ); headAngles[YAW] = 180; if ( largeFormat ) { CG_DrawHead( headx, y - SB_LARGE_SPACER*2, ICON_SIZE, ICON_SIZE, score->client, headAngles, SCR_CENTER, color ); } else { CG_DrawHead( headx, y + SB_SMALL_SPACER, SB_SMALL_ICON, SB_SMALL_ICON, score->client, headAngles, SCR_CENTER, color ); } // draw the score line // highlight your position if ( score->client == cg.snap->ps.clientNum ) { float hcolor[4]; int rank; localClient = qtrue; if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR ) { rank = -1; } else { rank = cg.snap->ps.persistant[PERS_RANK] & ~RANK_TIED_FLAG; } if ( rank == 0 ) { hcolor[0] = 0; hcolor[1] = 0; hcolor[2] = 0.7f; } else if ( rank == 1 ) { hcolor[0] = 0.7f; hcolor[1] = 0; hcolor[2] = 0; } else if ( rank == 2 ) { hcolor[0] = 0.7f; hcolor[1] = 0.7f; hcolor[2] = 0; } else { hcolor[0] = 0.4f; hcolor[1] = 0.4f; hcolor[2] = 0.4f; } hcolor[3] = fade * 0.7; /* CG_DrawTeamBackground( SB_SCORELINE_X + BIGCHAR_WIDTH + (SB_RATING_WIDTH / 2), y, SCREEN_WIDTH - SB_SCORELINE_X - BIGCHAR_WIDTH, BIGCHAR_HEIGHT+1, 1, gt[cgs.gametype].teams ? cg.snap->ps.persistant[PERS_TEAM] : hcolor, SCR_CENTER ); */ CG_FillRect( SB_SCORELINE_X + BIGCHAR_WIDTH + (SB_RATING_WIDTH / 2), y, SCREEN_WIDTH - SB_SCORELINE_X - BIGCHAR_WIDTH, BIGCHAR_HEIGHT+2, gt[cgs.gametype].teams ? CG_TeamColorDark(cg.snap->ps.persistant[PERS_TEAM], fade) : hcolor, SCR_CENTER ); } // draw client score strings if ( cg_highResFonts.integer ) { qboolean spec = ci->team == TEAM_SPECTATOR; int w; char *s; // score s = (score->ping == -1) ? "CONN" : spec ? "SPEC" : cg.warmup ? "-" : va("%i", score->score); w = CG_Text_Width( s, scale, 0 ); CG_Text_Paint( SB_SCORE_X + (SB_RATING_WIDTH / 2) + 64-w, y + h, scale, color, s, 0, 0, ITEM_TEXTSTYLE_SHADOWED, SCR_CENTER ); // ping s = va( "%i", score->ping ); w = CG_Text_Width( s, scale, 0 ); CG_Text_Paint( SB_PING_X - (SB_RATING_WIDTH + BIGCHAR_WIDTH )/2 + 64-w, y + h, scale, color, s, 0, 0, ITEM_TEXTSTYLE_SHADOWED, SCR_CENTER ); // time s = va( "%i", score->time ); //CG_IntToTime( score->time*1000, qtrue, qfalse ); w = CG_Text_Width( s, scale, 0 ); CG_Text_Paint( SB_TIME_X - (SB_RATING_WIDTH + BIGCHAR_WIDTH )/2 + 64-w, y + h, scale, color, s, 0, 0, ITEM_TEXTSTYLE_SHADOWED, SCR_CENTER ); // name CG_Text_Paint( SB_NAME_X - (SB_RATING_WIDTH / 2), y + h, scale, color, ci->name, 0, 0, ITEM_TEXTSTYLE_SHADOWED, SCR_CENTER ); } else { if ( score->ping == -1 ) { Com_sprintf(string, sizeof(string), " connecting %s", ci->name); } else if ( ci->team == TEAM_SPECTATOR ) { Com_sprintf(string, sizeof(string), " SPECT %3i %4i %s", score->ping, score->time, ci->name); } else { Com_sprintf(string, sizeof(string), "%5i %4i %4i %s", score->score, score->ping, score->time, ci->name); } CG_DrawBigString( SB_SCORELINE_X + (SB_RATING_WIDTH / 2), y, string, fade, SCR_CENTER ); } // add the "ready" marker for intermission exiting if ( cg.snap->ps.stats[STAT_CLIENTS_READY] & ( 1 << score->client ) ) { if ( cg_highResFonts.integer ) { CG_Text_Paint( iconx, y + h, scale, color, "READY", 0, 0, ITEM_TEXTSTYLE_SHADOWED, SCR_CENTER ); } else { CG_DrawBigStringColor( iconx, y, "READY", color, SCR_CENTER ); } } }