/* ================= CG_DrawTourneyScoreboard Draw the oversize scoreboard for tournements ================= */ void CG_DrawTourneyScoreboard( void ) { vec4_t color; int x,y; // request more scores regularly if ( cg.scoresRequestTime + 2000 < cg.time ) { cg.scoresRequestTime = cg.time; trap_SendClientCommand( "score" ); } // draw the dialog background color[0] = color[1] = color[2] = 0; color[3] = 1; CG_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color ); color[0] = 1; color[1] = 1; color[2] = 1; color[3] = 1; 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, 1.f ); if ( cgs.gametype == GT_WOLF_STOPWATCH && ( cg.snap->ps.pm_type == PM_INTERMISSION ) ) { y = WM_DrawInfoLine( x, 155, 1.f ); WM_TeamScoreboard( x, y, TEAM_RED, 1.f, 18 ); x = 335; WM_TeamScoreboard( x, y, TEAM_BLUE, 1.f, 18 ); } else { y = 155; WM_TeamScoreboard( x, y, TEAM_RED, 1.f, 20 ); x = 335; WM_TeamScoreboard( x, y, TEAM_BLUE, 1.f, 20 ); } } }
/* ================= CG_DrawScoreboard Draw the normal in-game scoreboard ================= */ qboolean CG_DrawScoreboard( void ) { int x = 0, y = 0, w, x_right; float fade; float *fadeColor; char *s; x = 20; y = 10; x_right = 640 - x - (INFO_TOTAL_WIDTH - 5); // don't draw anything if the menu or console is up if ( cg_paused.integer ) { return qfalse; } // don't draw scoreboard during death while warmup up // OSP - also for pesky scoreboards in demos if((cg.warmup || (cg.demoPlayback && cg.snap->ps.pm_type != PM_INTERMISSION)) && !cg.showScores) { return qfalse; } // don't draw if in cameramode if( cg.cameraMode ) { return qtrue; } if( cg.showScores || 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.killerName = 0; return qfalse; } fade = fadeColor[3]; } // fragged by ... line if( *cg.killerName ) { s = va("Killed by %s", cg.killerName ); w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH; CG_DrawBigString( ( SCREEN_WIDTH - w ) / 2, 40, s, fade ); } y = WM_DrawObjectives( x, y, 640 - 2*x + 5, 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_AXIS, fade, 8 ); x = x_right; WM_TeamScoreboard( x, y, TEAM_ALLIES, fade, 8 ); } else { if(cg.snap->ps.pm_type == PM_INTERMISSION) { WM_TeamScoreboard( x, y, TEAM_AXIS, fade, 9 ); x = x_right; WM_TeamScoreboard( x, y, TEAM_ALLIES, fade, 9 ); } else { WM_TeamScoreboard( x, y, TEAM_AXIS, fade, 25 ); x = x_right; WM_TeamScoreboard( x, y, TEAM_ALLIES, fade, 25 ); } } /* if(!CG_IsSinglePlayer()) { qtime_t ct; G_showWindowMessages(); trap_RealTime(&ct); s = va("^3%02d:%02d:%02d - %02d %s %d", ct.tm_hour, ct.tm_min, ct.tm_sec, ct.tm_mday, aMonths[ct.tm_mon], 1900 + ct.tm_year); CG_DrawStringExt(444, 12, s, colorWhite, qfalse, qtrue, 8, 8, 0); } */ return qtrue; }
/* ================= CG_DrawScoreboard Draw the normal in-game scoreboard ================= */ qboolean CG_DrawScoreboard(void) { int x = 0, y = 0, x_right; float fade; float *fadeColor; x = 20; y = 10; x_right = 640 - x - (INFO_TOTAL_WIDTH - 5); // don't draw anything if the menu or console is up if(cg_paused.integer) { return qfalse; } // don't draw scoreboard during death while warmup up // OSP - also for pesky scoreboards in demos if((cg.warmup || (cg.demoPlayback && cg.snap->ps.pm_type != PM_INTERMISSION)) && !cg.showScores) { return qfalse; } // don't draw if in cameramode if(cg.cameraMode) { return qtrue; } if(cg.showScores || 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.killerName = 0; return qfalse; } fade = fadeColor[3]; } y = WM_DrawObjectives(x, y, 640 - 2 * x + 5, fade); if(cgs.gametype == GT_WOLF_STOPWATCH && (cg.snap->ps.pm_type == PM_INTERMISSION)) { y = WM_DrawInfoLine(x, 155, fade); // CHRUKER: b035 - The maxrows has been split into one for when to use the mini chars and one for when to stop writing. WM_TeamScoreboard(x, y, TEAM_AXIS, fade, 8, 10); x = x_right; WM_TeamScoreboard(x, y, TEAM_ALLIES, fade, 8, 10); } else { if(cg.snap->ps.pm_type == PM_INTERMISSION) { WM_TeamScoreboard(x, y, TEAM_AXIS, fade, 9, 12); x = x_right; WM_TeamScoreboard(x, y, TEAM_ALLIES, fade, 9, 12); } else { WM_TeamScoreboard(x, y, TEAM_AXIS, fade, 25, 33); x = x_right; WM_TeamScoreboard(x, y, TEAM_ALLIES, fade, 25, 33); } // b035 } /* if(!CG_IsSinglePlayer()) { qtime_t ct; G_showWindowMessages(); trap_RealTime(&ct); s = va("^3%04i-%02i-%02i %02i:%02i:%02i", 1900 + qt.tm_year, qt.tm_mon + 1, qt.tm_mday, qt.tm_hour, qt.tm_min, qt.tm_sec); CG_DrawStringExt(444, 12, s, colorWhite, qfalse, qtrue, 8, 8, 0); } */ return qtrue; }
/* ================= Draw the normal in-game scoreboard ================= */ qboolean CG_DrawScoreboard(void) { int x = 20, y = 6, x_right = SCREEN_WIDTH - x - (INFO_TOTAL_WIDTH - 5); float fade; int width = SCREEN_WIDTH - 2 * x + 5; x += cgs.wideXoffset; x_right += cgs.wideXoffset; // don't draw anything if the menu or console is up if (cg_paused.integer) { return qfalse; } // don't draw scoreboard during death while warmup up // also for pesky scoreboards in demos if ((cg.warmup || (cg.demoPlayback && cg.snap->ps.pm_type != PM_INTERMISSION)) && !cg.showScores) { return qfalse; } // don't draw if in cameramode if (cg.cameraMode) { return qtrue; } if (cg.showScores || cg.predictedPlayerState.pm_type == PM_INTERMISSION) { fade = 1.0f; } else { float *fadeColor = CG_FadeColor(cg.scoreFadeTime, FADE_TIME); if (!fadeColor) { return qfalse; } fade = fadeColor[3]; } y = WM_DrawObjectives(x, y, width, 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_AXIS, fade, 8, 10); x = x_right; WM_TeamScoreboard(x, y, TEAM_ALLIES, fade, 8, 10); } else { if (cg.snap->ps.pm_type == PM_INTERMISSION) { WM_TeamScoreboard(x, y, TEAM_AXIS, fade, 9, 12); x = x_right; WM_TeamScoreboard(x, y, TEAM_ALLIES, fade, 9, 12); } else { WM_TeamScoreboard(x, y, TEAM_AXIS, fade, 24, 32); x = x_right; WM_TeamScoreboard(x, y, TEAM_ALLIES, fade, 24, 32); } } return qtrue; }
/* ================= CG_DrawScoreboard Draw the normal in-game scoreboard ================= */ qboolean CG_DrawScoreboard( void ) { int x = 0, y = 0; float fade; float *fadeColor; char *s; // don't draw amuthing if the menu or console is up if ( cg_paused.integer ) { 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] ) { int w; 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 // 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 { //----(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 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; }