From 02fa6d4eec670f4668f3834875aa7d0c1e0339b1 Mon Sep 17 00:00:00 2001 From: Scott Brooks Date: Thu, 28 Feb 2002 06:09:23 +0000 Subject: [PATCH] weapons stats on server side - spelling fixed, and forgot ssg3000 and kicks --- reaction/cgame/cg_scoreboard.c | 61 +++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 5 deletions(-) diff --git a/reaction/cgame/cg_scoreboard.c b/reaction/cgame/cg_scoreboard.c index e5b416ef..68688b10 100644 --- a/reaction/cgame/cg_scoreboard.c +++ b/reaction/cgame/cg_scoreboard.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.8 2002/02/28 06:09:23 blaze +// weapons stats on server side - spelling fixed, and forgot ssg3000 and kicks +// // Revision 1.7 2002/02/28 05:41:54 blaze // weapons stats on client side // @@ -727,7 +730,7 @@ CG_DrawWeaponStats ============================== */ #define WS_LEFTSIDE 20 -#define WS_TOP 250 +#define WS_TOP 230 #define WS_WIDTH 640 - WS_LEFTSIDE * 10 #define WS_LINE_WIDTH 1 #define WS_PADDING (WS_LINE_WIDTH+2) @@ -752,7 +755,7 @@ void CG_DrawWeaponStats(void) if (Alpha > 1.0f) Alpha = 1.0f; } //make room for 8 weapon stats - size = (8*20)+SB_PADDING; + size = (10*20)+SB_PADDING; score = cg.snap->ps.persistant[PERS_SCORE]; deaths = cg.snap->ps.persistant[PERS_KILLED]; // Score bar - Red: @@ -816,8 +819,8 @@ void CG_DrawWeaponStats(void) MAKERGBA(color, 0.0f, 0.0f, 0.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 6, WS_TOP + SB_PADDING, - "Effency", color); - + "Efficiency", color); + Com_sprintf(String, sizeof(String), "%4i",score); @@ -859,6 +862,10 @@ void CG_DrawWeaponStats(void) CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, "HC", color); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + "SSG3000", color); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, "Akimbo", color); @@ -867,6 +874,10 @@ void CG_DrawWeaponStats(void) CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, "Grenade", color); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + "Kicks", color); + //Accuracy @@ -911,6 +922,11 @@ void CG_DrawWeaponStats(void) CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); + Com_sprintf(String, sizeof(String), "%.1f%%",100 * (float)cg.records[REC_SSG3000HITS]/(cg.records[REC_SSG3000SHOTS] ? cg.records[REC_SSG3000SHOTS] : 1)); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + String, color); + Com_sprintf(String, sizeof(String), "%.1f%%",100 * (float)cg.records[REC_AKIMBOHITS]/(cg.records[REC_AKIMBOSHOTS] ? cg.records[REC_AKIMBOSHOTS] : 1)); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, @@ -922,12 +938,13 @@ void CG_DrawWeaponStats(void) String, color); + //Hits i=2; offset=24; MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, - "Hitts", color); + "Hits", color); Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFESLASHHITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); @@ -964,6 +981,11 @@ void CG_DrawWeaponStats(void) CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000HITS]); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOHITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, @@ -974,6 +996,11 @@ void CG_DrawWeaponStats(void) CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KICKHITS]); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + String, color); + //Shots i=2; offset = 30; @@ -1016,6 +1043,11 @@ void CG_DrawWeaponStats(void) CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000SHOTS]); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOSHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, @@ -1068,6 +1100,11 @@ void CG_DrawWeaponStats(void) CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000KILLS]); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOKILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, @@ -1078,6 +1115,11 @@ void CG_DrawWeaponStats(void) CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KICKKILLS]); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + String, color); + //Deaths i=2; offset = 45; @@ -1120,6 +1162,11 @@ void CG_DrawWeaponStats(void) CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000DEATHS]); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBODEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, @@ -1130,6 +1177,10 @@ void CG_DrawWeaponStats(void) CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); + Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KICKDEATHS]); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + String, color); if ( cg.wstatsRequestTime + 3000 < cg.time ) { // the scores are more than two seconds out of data,