static int WM_TeamScoreboard( int x, int y, team_t team, float fade, int maxrows ) { vec4_t hcolor; float tempx, tempy; int height, width; int i; int count = 0; vec4_t tclr = { 0.6f, 0.6f, 0.6f, 1.0f }; height = SMALLCHAR_HEIGHT * maxrows; width = INFO_PLAYER_WIDTH + INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH; CG_FillRect( x-5, y-2, width+5, 21, clrUiBack ); CG_FillRect( x-5, y-2, width+5, 21, clrUiBar ); Vector4Set( hcolor, 0, 0, 0, fade ); CG_DrawRect_FixedBorder( x-5, y-2, width+5, 21, 1, colorBlack ); // draw header if( cg_gameType.integer == GT_WOLF_LMS ) { char *s; if ( team == TEAM_AXIS ) { s = va( "%s [%d] (%d %s)", CG_TranslateString( "AXIS" ), cg.teamScores[0], cg.teamPlayers[team], CG_TranslateString("PLAYERS") ); s = va( "%s ^3%s", s, cg.teamFirstBlood == TEAM_AXIS ? CG_TranslateString("FIRST BLOOD") : "" ); CG_Text_Paint_Ext( x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1 ); } else if ( team == TEAM_ALLIES ) { s = va( "%s [%d] (%d %s)", CG_TranslateString( "ALLIES" ), cg.teamScores[1], cg.teamPlayers[team], CG_TranslateString("PLAYERS") ); s = va( "%s ^3%s", s, cg.teamFirstBlood == TEAM_ALLIES ? CG_TranslateString("FIRST BLOOD") : "" ); CG_Text_Paint_Ext( x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1 ); } } else { if ( team == TEAM_AXIS ) { CG_Text_Paint_Ext( x, y + 13, 0.25f, 0.25f, tclr, va( "%s [%d] (%d %s)", CG_TranslateString( "AXIS" ), cg.teamScores[0], cg.teamPlayers[team], CG_TranslateString("PLAYERS") ), 0, 0, 0, &cgs.media.limboFont1 ); } else if ( team == TEAM_ALLIES ) { CG_Text_Paint_Ext( x, y + 13, 0.25f, 0.25f, tclr, va( "%s [%d] (%d %s)", CG_TranslateString( "ALLIES" ), cg.teamScores[1], cg.teamPlayers[team], CG_TranslateString("PLAYERS") ), 0, 0, 0, &cgs.media.limboFont1 ); } } y += SMALLCHAR_HEIGHT + 3; // save off y val tempy = y; // draw color bands for ( i = 0; i <= maxrows; i++ ) { if ( i % 2 == 0 ) VectorSet( hcolor, (80.f/255.f), (80.f/255.f), (80.f/255.f) ); // LIGHT BLUE else VectorSet( hcolor, (0.f/255.f), (0.f/255.f), (0.f/255.f) ); // DARK BLUE hcolor[3] = fade * 0.3; CG_FillRect( x-5, y, width+5, SMALLCHAR_HEIGHT+1, hcolor ); trap_R_SetColor( colorBlack ); CG_DrawTopBottom( x-5, y, width+5, SMALLCHAR_HEIGHT+1, 1 ); trap_R_SetColor( NULL ); y += SMALLCHAR_HEIGHT; } hcolor[3] = 1; y = tempy; tempx = x; CG_FillRect( x-5, y-1, width+5, 18, clrUiBack ); //CG_FillRect( x-5, y-1, width+5, 18, clrUiBar ); trap_R_SetColor( colorBlack ); CG_DrawTopBottom( x-5, y-1, width+5, 18, 1 ); trap_R_SetColor( NULL ); // draw player info headings CG_DrawSmallString( tempx, y, CG_TranslateString( "Name" ), fade ); tempx += INFO_PLAYER_WIDTH; CG_DrawSmallString( tempx, y, CG_TranslateString( "Class" ), fade ); tempx += INFO_CLASS_WIDTH; if( cgs.gametype == GT_WOLF_LMS ) { CG_DrawSmallString( tempx, y, CG_TranslateString( "Score" ), fade ); tempx += INFO_SCORE_WIDTH; } else { CG_DrawSmallString( tempx + 1 * SMALLCHAR_WIDTH, y, CG_TranslateString( "XP" ), fade ); tempx += INFO_XP_WIDTH; } CG_DrawSmallString( tempx, y, CG_TranslateString( "Ping" ), fade ); tempx += INFO_LATENCY_WIDTH; if( cgs.gametype != GT_WOLF_LMS ) { CG_DrawPicST( tempx + 2, y, INFO_LIVES_WIDTH - 4, 16, 0.f, 0.f, 0.5f, 1.f, team == TEAM_ALLIES ? cgs.media.hudAlliedHelmet : cgs.media.hudAxisHelmet ); tempx += INFO_LIVES_WIDTH; } y += SMALLCHAR_HEIGHT; // draw player info VectorSet( hcolor, 1, 1, 1 ); hcolor[3] = fade; cg.teamPlayers[team] = 0; // JPW NERVE for ( i = 0; i < cg.numScores; i++ ) { if ( team != cgs.clientinfo[ cg.scores[i].client ].team ) continue; cg.teamPlayers[team]++; } count = 0; for( i = 0; i < cg.numScores && count < maxrows; i++ ) { if( team != cgs.clientinfo[ cg.scores[i].client ].team ) { continue; } if( cg.teamPlayers[team] > maxrows ) { WM_DrawClientScore_Small( x, y, &cg.scores[i], hcolor, fade ); y += MINICHAR_HEIGHT; } else { WM_DrawClientScore( x, y, &cg.scores[i], hcolor, fade ); y += SMALLCHAR_HEIGHT; } count++; } // draw spectators y += SMALLCHAR_HEIGHT; for ( i = 0; i < cg.numScores; i++ ) { if ( cgs.clientinfo[ cg.scores[i].client ].team != TEAM_SPECTATOR ) continue; if ( team == TEAM_AXIS && ( i % 2 ) ) continue; if ( team == TEAM_ALLIES && ( ( i + 1 ) % 2 ) ) continue; WM_DrawClientScore( x, y, &cg.scores[i], hcolor, fade ); y += SMALLCHAR_HEIGHT; } return y; }
/* ======================================================================================================================================= WM_TeamScoreboard ======================================================================================================================================= */ static int WM_TeamScoreboard(int x, int y, team_t team, float fade) { vec4_t hcolor; float tempx; int i; hcolor[3] = fade; if (team == TEAM_RED) { VectorSet(hcolor, 0.4452, 0.1172, 0.0782); // LIGHT - RED } else if (team == TEAM_BLUE) { VectorSet(hcolor, 0.1836, 0.2422, 0.1680); // LIGHT - GREEN } else { VectorSet(hcolor, 0.2, 0.2, 0.2); // DARK - GREY } // dont draw spectator if there are none for (i = 0; i < cg.numScores; i++) { if (team == cgs.clientinfo[cg.scores[i].client].team) { break; } } if (team == TEAM_SPECTATOR && i == cg.numScores) { return y; } // draw team header if (y + SMALLCHAR_HEIGHT >= 440) { return y; } tempx = x; CG_FillRect(tempx, y, INFO_PLAYER_WIDTH - INFO_BORDER, INFO_TEAM_HEIGHT, hcolor); if (team == TEAM_RED) { CG_DrawSmallString(tempx, y, "Axis", fade); } else if (team == TEAM_BLUE) { CG_DrawSmallString(tempx, y, "Allies", fade); } else { CG_DrawSmallString(tempx, y, "Spectators", fade); } tempx += INFO_PLAYER_WIDTH; CG_FillRect(tempx, y, INFO_SCORE_WIDTH - INFO_BORDER, INFO_TEAM_HEIGHT, hcolor); tempx += INFO_SCORE_WIDTH; CG_FillRect(tempx, y, INFO_LATENCY_WIDTH - INFO_BORDER, INFO_TEAM_HEIGHT, hcolor); // draw player info VectorSet(hcolor, 1, 1, 1); hcolor[3] = fade; y += INFO_TEAM_HEIGHT + INFO_BORDER; for (i = 0; i < cg.numScores; i++) { if (team != cgs.clientinfo[cg.scores[i].client].team) { continue; } WM_DrawClientScore(x, y, &cg.scores[i], hcolor, fade); y += SMALLCHAR_HEIGHT; } y += 4; return y; }
static int WM_TeamScoreboard(int x, int y, team_t team, float fade, int maxrows, int absmaxrows) { vec4_t hcolor; float tempx, tempy; int i; int count = 0; int width = INFO_TOTAL_WIDTH; qboolean use_mini_chars = qfalse, livesleft = qfalse; const char *buffer = CG_ConfigString(CS_SERVERINFO); const char *str = Info_ValueForKey(buffer, "g_maxlives"); if (str && *str && atoi(str)) { livesleft = qtrue; } if (!livesleft) { str = Info_ValueForKey(buffer, "g_alliedmaxlives"); if (str && *str && atoi(str)) { livesleft = qtrue; } } if (!livesleft) { str = Info_ValueForKey(buffer, "g_axismaxlives"); if (str && *str && atoi(str)) { livesleft = qtrue; } } CG_FillRect(x - 5, y - 2, width + 5, 21, clrUiBack); CG_FillRect(x - 5, y - 2, width + 5, 21, clrUiBar); Vector4Set(hcolor, 0, 0, 0, fade); CG_DrawRect_FixedBorder(x - 5, y - 2, width + 5, 21, 1, colorBlack); // draw header if (cg_gameType.integer == GT_WOLF_LMS) { char *s; if (team == TEAM_AXIS) { s = va("%s [%d] (%d %s)", CG_TranslateString("AXIS"), cg.teamScores[0], cg.teamPlayers[team], CG_TranslateString("PLAYERS")); s = va("%s ^3%s", s, cg.teamFirstBlood == TEAM_AXIS ? CG_TranslateString("FIRST BLOOD") : ""); CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1); } else if (team == TEAM_ALLIES) { s = va("%s [%d] (%d %s)", CG_TranslateString("ALLIES"), cg.teamScores[1], cg.teamPlayers[team], CG_TranslateString("PLAYERS")); s = va("%s ^3%s", s, cg.teamFirstBlood == TEAM_ALLIES ? CG_TranslateString("FIRST BLOOD") : ""); CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1); } } else { if (team == TEAM_AXIS) { CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr, va("%s [%d] (%d %s)", CG_TranslateString("AXIS"), cg.teamScores[0], cg.teamPlayers[team], CG_TranslateString("PLAYERS")), 0, 0, 0, &cgs.media.limboFont1); } else if (team == TEAM_ALLIES) { CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr, va("%s [%d] (%d %s)", CG_TranslateString("ALLIES"), cg.teamScores[1], cg.teamPlayers[team], CG_TranslateString("PLAYERS")), 0, 0, 0, &cgs.media.limboFont1); } } y += 19; tempx = x; CG_FillRect(x - 5, y, width + 5, 18, clrUiBack); trap_R_SetColor(colorBlack); CG_DrawBottom_NoScale(x - 5, y, width + 5, 18, 1); trap_R_SetColor(NULL); // draw player info headings CG_Text_Paint_Ext(tempx, y + 13, 0.24, 0.28, colorWhite, CG_TranslateString("Name"), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2_lo); tempx += INFO_PLAYER_WIDTH; // add some extra space when not showing lives in non-LMS if (cg_gameType.integer != GT_WOLF_LMS && !livesleft) { tempx += INFO_LIVES_WIDTH; } CG_Text_Paint_Ext(tempx, y + 13, 0.24, 0.28, colorWhite, CG_TranslateString("C R"), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2_lo); tempx += INFO_CLASS_WIDTH; if (cgs.gametype == GT_WOLF_LMS) { CG_Text_Paint_Ext(tempx, y + 13, 0.24, 0.28, colorWhite, CG_TranslateString("Score"), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2_lo); tempx += INFO_SCORE_WIDTH; } else { CG_Text_Paint_Ext(tempx + 8, y + 13, 0.24, 0.28, colorWhite, CG_TranslateString("XP"), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2_lo); tempx += INFO_XP_WIDTH; } CG_Text_Paint_Ext(tempx, y + 13, 0.24, 0.28, colorWhite, CG_TranslateString("Ping"), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2_lo); tempx += INFO_LATENCY_WIDTH; if (cgs.gametype != GT_WOLF_LMS && livesleft) { CG_DrawPicST(tempx + 2, y, INFO_LIVES_WIDTH - 4, 16, 0.f, 0.f, 0.5f, 1.f, team == TEAM_ALLIES ? cgs.media.hudAlliedHelmet : cgs.media.hudAxisHelmet); tempx += INFO_LIVES_WIDTH; } y += 18; cg.teamPlayers[team] = 0; for (i = 0; i < cg.numScores; i++) { if (team != cgs.clientinfo[cg.scores[i].client].team) { continue; } cg.teamPlayers[team]++; } if (cg.teamPlayers[team] > maxrows) { maxrows = absmaxrows; use_mini_chars = qtrue; } // save off y val tempy = y; // draw color bands for (i = 0; i < maxrows; i++) { if (i % 2 == 0) { VectorSet(hcolor, (80.f / 255.f), (80.f / 255.f), (80.f / 255.f)); // LIGHT BLUE } else { VectorSet(hcolor, (0.f / 255.f), (0.f / 255.f), (0.f / 255.f)); // DARK BLUE } hcolor[3] = fade * 0.3; if (use_mini_chars) { CG_FillRect(x - 5, y, width + 5, 12, hcolor); trap_R_SetColor(colorBlack); CG_DrawBottom_NoScale(x - 5, y, width + 5, 12, 1); trap_R_SetColor(NULL); y += 12; } else { CG_FillRect(x - 5, y, width + 5, 16, hcolor); trap_R_SetColor(colorBlack); CG_DrawBottom_NoScale(x - 5, y, width + 5, 16, 1); trap_R_SetColor(NULL); y += 16; } } hcolor[3] = 1; y = tempy; // draw player info VectorSet(hcolor, 1, 1, 1); hcolor[3] = fade; for (i = 0; i < cg.numScores && count < maxrows; i++) { if (team != cgs.clientinfo[cg.scores[i].client].team) { continue; } if (use_mini_chars) { WM_DrawClientScore_Small(x, y, &cg.scores[i], hcolor, fade, livesleft); y += 12; } else { WM_DrawClientScore(x, y, &cg.scores[i], hcolor, fade, livesleft); y += 16; } count++; } // draw spectators if (use_mini_chars) { y += 12; } else { y += 16; } for (i = 0; i < cg.numScores; i++) { if (cgs.clientinfo[cg.scores[i].client].team != TEAM_SPECTATOR) { continue; } if (team == TEAM_AXIS && (i % 2)) { continue; } if (team == TEAM_ALLIES && ((i + 1) % 2)) { continue; } if (use_mini_chars) { WM_DrawClientScore_Small(x, y, &cg.scores[i], hcolor, fade, livesleft); y += 12; } else { WM_DrawClientScore(x, y, &cg.scores[i], hcolor, fade, livesleft); y += 16; } } return y; }
// CHRUKER: b035 - Added absolute maximum rows static int WM_TeamScoreboard(int x, int y, team_t team, float fade, int maxrows, int absmaxrows) { vec4_t hcolor; float tempx, tempy; int height, width; int i; int count = 0; qboolean use_mini_chars = qfalse; // CHRUKER: b035 - Needed to check if using mini chars vec4_t tclr = { 0.6f, 0.6f, 0.6f, 1.0f }; height = SMALLCHAR_HEIGHT * maxrows; width = INFO_PLAYER_WIDTH + INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH; CG_FillRect(x - 5, y - 2, width + 5, 21, clrUiBack); CG_FillRect(x - 5, y - 2, width + 5, 21, clrUiBar); Vector4Set(hcolor, 0, 0, 0, fade); CG_DrawRect_FixedBorder(x - 5, y - 2, width + 5, 21, 1, colorBlack); // draw header if(cg_gameType.integer == GT_WOLF_LMS) { char *s; if(team == TEAM_AXIS) { s = va("%s [%d] (%d %s)", CG_TranslateString("AXIS"), cg.teamScores[0], cg.teamPlayers[team], CG_TranslateString("PLAYERS")); s = va("%s ^3%s", s, cg.teamFirstBlood == TEAM_AXIS ? CG_TranslateString("FIRST BLOOD") : ""); CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1); } else if(team == TEAM_ALLIES) { s = va("%s [%d] (%d %s)", CG_TranslateString("ALLIES"), cg.teamScores[1], cg.teamPlayers[team], CG_TranslateString("PLAYERS")); s = va("%s ^3%s", s, cg.teamFirstBlood == TEAM_ALLIES ? CG_TranslateString("FIRST BLOOD") : ""); CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1); } } else { if(team == TEAM_AXIS) { CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr, va("%s [%d] (%d %s)", CG_TranslateString("AXIS"), cg.teamScores[0], cg.teamPlayers[team], CG_TranslateString("PLAYERS")), 0, 0, 0, &cgs.media.limboFont1); } else if(team == TEAM_ALLIES) { CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr, va("%s [%d] (%d %s)", CG_TranslateString("ALLIES"), cg.teamScores[1], cg.teamPlayers[team], CG_TranslateString("PLAYERS")), 0, 0, 0, &cgs.media.limboFont1); } } y += SMALLCHAR_HEIGHT + 3; tempx = x; // CHRUKER: b076 - Adjusted y coordinate, and changed to use DrawBottom instead of DrawTopBottom CG_FillRect(x - 5, y, width + 5, 18, clrUiBack); trap_R_SetColor(colorBlack); CG_DrawBottom_NoScale(x - 5, y, width + 5, 18, 1); trap_R_SetColor(NULL); // draw player info headings CG_DrawSmallString(tempx, y, CG_TranslateString("Name"), fade); tempx += INFO_PLAYER_WIDTH; CG_DrawSmallString(tempx, y, CG_TranslateString("Class"), fade); tempx += INFO_CLASS_WIDTH; if(cgs.gametype == GT_WOLF_LMS) { CG_DrawSmallString(tempx, y, CG_TranslateString("Score"), fade); tempx += INFO_SCORE_WIDTH; } else { CG_DrawSmallString(tempx + 1 * SMALLCHAR_WIDTH, y, CG_TranslateString("XP"), fade); tempx += INFO_XP_WIDTH; } CG_DrawSmallString(tempx, y, CG_TranslateString("Ping"), fade); tempx += INFO_LATENCY_WIDTH; if(cgs.gametype != GT_WOLF_LMS) { CG_DrawPicST(tempx + 2, y, INFO_LIVES_WIDTH - 4, 16, 0.f, 0.f, 0.5f, 1.f, team == TEAM_ALLIES ? cgs.media.hudAlliedHelmet : cgs.media.hudAxisHelmet); tempx += INFO_LIVES_WIDTH; } // CHRUKER: b076 - The math says char height + 2 * border width (1 pixel) y += SMALLCHAR_HEIGHT + 2; cg.teamPlayers[team] = 0; // JPW NERVE for(i = 0; i < cg.numScores; i++) { if(team != cgs.clientinfo[cg.scores[i].client].team) { continue; } cg.teamPlayers[team]++; } // CHRUKER: b035 - Adjust maxrows if ( cg.teamPlayers[team] > maxrows ) { maxrows = absmaxrows; use_mini_chars = qtrue; } // save off y val tempy = y; // draw color bands for ( i = 0; i < maxrows; i++ ) { if ( i % 2 == 0 ) { VectorSet( hcolor, (80.f/255.f), (80.f/255.f), (80.f/255.f) ); // LIGHT BLUE } else { VectorSet( hcolor, (0.f/255.f), (0.f/255.f), (0.f/255.f) ); // DARK BLUE } hcolor[3] = fade * 0.3; if (use_mini_chars) { // CHRUKER: b076 - Adjusted y height, and changed to DrawBottom instead of DrawTopBottom CG_FillRect( x-5, y, width+5, MINICHAR_HEIGHT, hcolor ); trap_R_SetColor( colorBlack ); CG_DrawBottom_NoScale( x-5, y, width+5, MINICHAR_HEIGHT, 1 ); trap_R_SetColor( NULL ); y += MINICHAR_HEIGHT; } else { // CHRUKER: b076 - Adjusted y height, and changed to DrawBottom instead of DrawTopBottom CG_FillRect( x-5, y, width+5, SMALLCHAR_HEIGHT, hcolor ); trap_R_SetColor( colorBlack ); CG_DrawBottom_NoScale( x-5, y, width+5, SMALLCHAR_HEIGHT, 1 ); trap_R_SetColor( NULL ); y += SMALLCHAR_HEIGHT; } } hcolor[3] = 1; y = tempy; // draw player info VectorSet( hcolor, 1, 1, 1 ); hcolor[3] = fade; count = 0; for(i = 0; i < cg.numScores && count < maxrows; i++) { if(team != cgs.clientinfo[cg.scores[i].client].team) { continue; } // CHRUKER: b035 - Using the flag instead if(use_mini_chars) { WM_DrawClientScore_Small(x, y, &cg.scores[i], hcolor, fade); y += MINICHAR_HEIGHT; } else { WM_DrawClientScore(x, y, &cg.scores[i], hcolor, fade); y += SMALLCHAR_HEIGHT; } count++; } // draw spectators // CHRUKER: b035 - Missing support for mini char height scoreboard background if (use_mini_chars) { y += MINICHAR_HEIGHT; } else { y += SMALLCHAR_HEIGHT; } for(i = 0; i < cg.numScores; i++) { if(cgs.clientinfo[cg.scores[i].client].team != TEAM_SPECTATOR) { continue; } if(team == TEAM_AXIS && (i % 2)) { continue; } if(team == TEAM_ALLIES && ((i + 1) % 2)) { continue; } // CHRUKER: b034 - Missing support for minichars; b035 - Using the flag instead if(use_mini_chars) { WM_DrawClientScore_Small( x, y, &cg.scores[i], hcolor, fade ); y += MINICHAR_HEIGHT; } else { WM_DrawClientScore( x, y, &cg.scores[i], hcolor, fade ); y += SMALLCHAR_HEIGHT; } } return y; }
static int WM_TeamScoreboard( int x, int y, team_t team, float fade, int maxrows ) { vec4_t hcolor; float tempx, tempy; int height, width; int i, rows; height = SMALLCHAR_HEIGHT * maxrows; width = INFO_PLAYER_WIDTH + INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH; rows = height / SMALLCHAR_HEIGHT - 2; hcolor[0] = hcolor[1] = hcolor[2] = 1; hcolor[3] = 1.f; trap_R_SetColor( hcolor ); CG_DrawPic( x - 15, y - 4, width + 30, height + 1, trap_R_RegisterShaderNoMip( "ui_mp/assets/mp_score_team.tga" ) ); trap_R_SetColor( NULL ); if ( team == TEAM_RED ) { VectorSet( hcolor, ( 68.f / 255.f ), ( 0.f / 255.f ), ( 0.f / 255.f ) ); } else if ( team == TEAM_BLUE ) { VectorSet( hcolor, ( 0.f / 255.f ), ( 45.f / 255.f ), ( 68.f / 255.f ) ); } hcolor[3] = 1 * fade; // draw header if ( team == TEAM_RED ) { CG_DrawSmallString( x, y, va( "%s [%d] (%d %s)", CG_TranslateString( "Axis" ), cg.teamScores[0], cg.teamPlayers[team], CG_TranslateString( "players" ) ), fade ); } else if ( team == TEAM_BLUE ) { CG_DrawSmallString( x, y, va( "%s [%d] (%d %s)", CG_TranslateString( "Allies" ), cg.teamScores[1], cg.teamPlayers[team], CG_TranslateString( "players" ) ), fade ); } y += SMALLCHAR_HEIGHT + 4; // save off y val tempy = y; // draw color bands for ( i = 0; i < rows; i++ ) { hcolor[3] = fade * 0.3; if ( i % 2 == 0 ) { VectorSet( hcolor, ( 0.f / 255.f ), ( 163.f / 255.f ), ( 113.f / 255.f ) ); // LIGHT BLUE } else { VectorSet( hcolor, ( 0.f / 255.f ), ( 133.f / 255.f ), ( 92.f / 255.f ) ); // DARK BLUE } hcolor[3] = 0; CG_FillRect( x, y, width, SMALLCHAR_HEIGHT, hcolor ); y += SMALLCHAR_HEIGHT; } hcolor[3] = 1; y = tempy; tempx = x; // draw player info headings CG_DrawSmallString( tempx, y, CG_TranslateString( "Name" ), fade ); tempx += INFO_PLAYER_WIDTH; CG_DrawSmallString( tempx, y, CG_TranslateString( "Class" ), fade ); tempx += INFO_CLASS_WIDTH; CG_DrawSmallString( tempx, y, CG_TranslateString( "Score" ), fade ); tempx += INFO_SCORE_WIDTH; CG_DrawSmallString( tempx, y, CG_TranslateString( "Ping" ), fade ); tempx += INFO_LATENCY_WIDTH; y += SMALLCHAR_HEIGHT; // draw player info VectorSet( hcolor, 1, 1, 1 ); hcolor[3] = fade; cg.teamPlayers[team] = 0; // JPW NERVE for ( i = 0; i < cg.numScores; i++ ) { if ( team != cgs.clientinfo[ cg.scores[i].client ].team ) { continue; } cg.teamPlayers[team]++; // JPW NERVE // one frame latency, but who cares? WM_DrawClientScore( x, y, &cg.scores[i], hcolor, fade ); y += SMALLCHAR_HEIGHT; } // draw spectators y += SMALLCHAR_HEIGHT; for ( i = 0; i < cg.numScores; i++ ) { if ( cgs.clientinfo[ cg.scores[i].client ].team != TEAM_SPECTATOR ) { continue; } if ( team == TEAM_RED && ( i % 2 ) ) { continue; } if ( team == TEAM_BLUE && ( ( i + 1 ) % 2 ) ) { continue; } WM_DrawClientScore( x, y, &cg.scores[i], hcolor, fade ); y += SMALLCHAR_HEIGHT; } return y; }