mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-26 14:11:22 +00:00
many changes to scoreboard (deaths/second mode)
This commit is contained in:
parent
be55ca880e
commit
2ec2b9a5d2
4 changed files with 72 additions and 28 deletions
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.28 2002/02/10 08:17:08 niceass
|
||||
// many changes to scoreboard (deaths/second mode)
|
||||
//
|
||||
// Revision 1.27 2002/02/09 00:10:12 jbravo
|
||||
// Fixed spectator follow and free and updated zcam to 1.04 and added the
|
||||
// missing zcam files.
|
||||
|
@ -222,7 +225,13 @@ static void CG_ScoresDown_f( void ) {
|
|||
#ifdef MISSIONPACK
|
||||
CG_BuildSpectatorString();
|
||||
#endif
|
||||
if ( cg.showScores == qfalse ) cg.scoreStartTime = cg.time;
|
||||
if ( cg.time - cg.scoreFadeTime < 500 && !cg.showScores)
|
||||
cg.scoreTPMode = (cg.scoreTPMode == 0) ? 1 : 0; // Toggle
|
||||
|
||||
if ( cg.time - cg.scoreFadeTime >= 500 && !cg.showScores)
|
||||
cg.scoreTPMode = 0;
|
||||
|
||||
if ( !cg.showScores ) cg.scoreStartTime = cg.time;
|
||||
if ( cg.scoresRequestTime + 2000 < cg.time ) {
|
||||
// the scores are more than two seconds out of data,
|
||||
// so request new ones
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.48 2002/02/10 08:17:08 niceass
|
||||
// many changes to scoreboard (deaths/second mode)
|
||||
//
|
||||
// Revision 1.47 2002/02/10 02:49:13 niceass
|
||||
// re-added zcam #define
|
||||
//
|
||||
|
@ -365,6 +368,7 @@ typedef struct localEntity_s {
|
|||
typedef struct {
|
||||
int client;
|
||||
int score;
|
||||
int deaths; // NiceAss: Added deaths
|
||||
int ping;
|
||||
int time;
|
||||
int scoreFlags;
|
||||
|
@ -654,6 +658,7 @@ typedef struct {
|
|||
qboolean showScores;
|
||||
qboolean scoreBoardShowing;
|
||||
int scoreFadeTime;
|
||||
int scoreTPMode;
|
||||
char killerName[MAX_NAME_LENGTH];
|
||||
char spectatorList[MAX_STRING_CHARS]; // list of names
|
||||
int spectatorLen; // length of list
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.6 2002/02/10 08:17:08 niceass
|
||||
// many changes to scoreboard (deaths/second mode)
|
||||
//
|
||||
// Revision 1.5 2002/02/04 00:23:05 niceass
|
||||
// New TP scoreboard
|
||||
//
|
||||
|
@ -71,7 +74,7 @@
|
|||
static qboolean localClient; // true if local client has been displayed
|
||||
|
||||
// NiceAss:
|
||||
#define SB_WIDTH 260 // 285
|
||||
#define SB_WIDTH 280 // 285
|
||||
#define SB_START_HEIGHT 70
|
||||
#define SB_MIDDLE (SCREEN_WIDTH/2)
|
||||
#define SB_LINE_WIDTH 1
|
||||
|
@ -234,6 +237,7 @@ static void CG_DrawTeamplayClientScore( int y, int x, score_t *score, float fade
|
|||
clientInfo_t *ci;
|
||||
int iconx, headx;
|
||||
float hcolor[4];
|
||||
int size;
|
||||
|
||||
if ( score->client < 0 || score->client >= cgs.maxclients ) {
|
||||
Com_Printf( "Bad score->client: %i\n", score->client );
|
||||
|
@ -242,7 +246,7 @@ static void CG_DrawTeamplayClientScore( int y, int x, score_t *score, float fade
|
|||
|
||||
ci = &cgs.clientinfo[score->client];
|
||||
|
||||
//CG_DrawSmallString( x, y, ci->name, fade );
|
||||
// Name:
|
||||
CG_DrawStringExt( x, y, ci->name, color, qtrue, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, 17);
|
||||
|
||||
if ( score->client == cg.snap->ps.clientNum ) {
|
||||
|
@ -250,14 +254,26 @@ static void CG_DrawTeamplayClientScore( int y, int x, score_t *score, float fade
|
|||
CG_FillRect( x, y, SB_WIDTH-SB_PADDING*2, SMALLCHAR_HEIGHT, hcolor );
|
||||
}
|
||||
|
||||
if (score->ping == -1)
|
||||
Com_sprintf(string, sizeof(string),
|
||||
"CONNECTING");
|
||||
else
|
||||
Com_sprintf(string, sizeof(string),
|
||||
"%4i %5i", score->ping, score->score);
|
||||
if (cg.scoreTPMode) {
|
||||
if (score->ping == -1)
|
||||
Com_sprintf(string, sizeof(string),
|
||||
"Connecting");
|
||||
else
|
||||
Com_sprintf(string, sizeof(string),
|
||||
"%4i %4i", score->ping, score->time);
|
||||
size = 11;
|
||||
}
|
||||
else {
|
||||
if (score->ping == -1)
|
||||
Com_sprintf(string, sizeof(string),
|
||||
" Connecting");
|
||||
else
|
||||
Com_sprintf(string, sizeof(string),
|
||||
"%5i %6i", score->score, score->deaths);
|
||||
size = 14;
|
||||
}
|
||||
|
||||
CG_DrawSmallString( x+SB_WIDTH-(SMALLCHAR_WIDTH*13)-6, y, string, fade );
|
||||
CG_DrawSmallString( x+SB_WIDTH-(SMALLCHAR_WIDTH*size)-6, y, string, fade );
|
||||
}
|
||||
|
||||
|
||||
|
@ -270,7 +286,7 @@ CG_TeamScoreboard -- By NiceAss
|
|||
static int CG_TeamplayScoreboard(int maxClients)
|
||||
{
|
||||
int i, red, blue, spec;
|
||||
float color[4], Alpha;
|
||||
float color[4], Alpha, Alpha2;
|
||||
score_t *score;
|
||||
clientInfo_t *ci;
|
||||
int y;
|
||||
|
@ -279,6 +295,7 @@ static int CG_TeamplayScoreboard(int maxClients)
|
|||
|
||||
if (cg.time > cg.scoreStartTime+300) {
|
||||
Alpha = (cos((cg.time-cg.scoreStartTime) / 400.0f) + 1.0f) * 0.25f + 0.5f;
|
||||
Alpha2 = (cos((cg.time-cg.scoreStartTime) / 400.0f) + 1.0f) * 0.5f;
|
||||
}
|
||||
else {
|
||||
Alpha = (float)(cg.time-cg.scoreStartTime)/(float)300;
|
||||
|
@ -300,7 +317,7 @@ static int CG_TeamplayScoreboard(int maxClients)
|
|||
MAKERGBA(color, 1.0f, 0.5f, 0.5f, 0.7f * Alpha);
|
||||
CG_FillRect(SB_MIDDLE - SB_WIDTH - 6, SB_START_HEIGHT,
|
||||
SB_WIDTH, SMALLCHAR_HEIGHT+(SB_PADDING*2), color);
|
||||
MAKERGBA(color, 0.5f, 0.5f, 0.5f, 0.7f * Alpha);
|
||||
MAKERGBA(color, 0.55f, 0.55f, 0.55f, 0.7f * Alpha);
|
||||
CG_FillRect(SB_MIDDLE - SB_WIDTH - 6, SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*2),
|
||||
SB_WIDTH, SMALLCHAR_HEIGHT+(SB_PADDING*2), color);
|
||||
MAKERGBA(color, 0.6f, 0.5f, 0.5f, 0.5f * Alpha);
|
||||
|
@ -314,23 +331,28 @@ static int CG_TeamplayScoreboard(int maxClients)
|
|||
SB_WIDTH, (SMALLCHAR_HEIGHT+SB_PADDING*2), SB_LINE_WIDTH, color );
|
||||
|
||||
|
||||
MAKERGBA(color, 0.0f, 0.0f, 0.0f, 1.0f * Alpha);
|
||||
MAKERGBA(color, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_WIDTH+SB_PADDING-6, SB_START_HEIGHT+SB_PADDING,
|
||||
"Team 1", color);
|
||||
|
||||
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 0.8f);
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_WIDTH+SB_PADDING-6, SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||
"Name", color);
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*13), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||
"Ping", color);
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*6), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||
"Frags", color);
|
||||
if (cg.scoreTPMode) {
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*11), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||
"Ping Time", color);
|
||||
}
|
||||
else {
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*14), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||
"Frags Deaths", color);
|
||||
}
|
||||
|
||||
|
||||
// Blue:
|
||||
MAKERGBA(color, 0.5f, 0.5f, 1.0f, 0.7f * Alpha);
|
||||
CG_FillRect(SB_MIDDLE + 6, SB_START_HEIGHT,
|
||||
SB_WIDTH, SMALLCHAR_HEIGHT+(SB_PADDING*2), color);
|
||||
MAKERGBA(color, 0.5f, 0.5f, 0.5f, 0.7f * Alpha);
|
||||
MAKERGBA(color, 0.55f, 0.55f, 0.55f, 0.7f * Alpha);
|
||||
CG_FillRect(SB_MIDDLE + 6, SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*2),
|
||||
SB_WIDTH, SMALLCHAR_HEIGHT+(SB_PADDING*2), color);
|
||||
MAKERGBA(color, 0.5f, 0.5f, 0.6f, 0.5f * Alpha);
|
||||
|
@ -343,24 +365,27 @@ static int CG_TeamplayScoreboard(int maxClients)
|
|||
CG_DrawCleanRect( SB_MIDDLE + 6, SB_START_HEIGHT + SMALLCHAR_HEIGHT+(SB_PADDING*2),
|
||||
SB_WIDTH, (SMALLCHAR_HEIGHT+SB_PADDING*2), SB_LINE_WIDTH, color );
|
||||
|
||||
MAKERGBA(color, 0.0f, 0.0f, 0.0f, 1.0f * Alpha);
|
||||
MAKERGBA(color, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
CG_DrawSmallStringColor(SB_MIDDLE+SB_PADDING+6, SB_START_HEIGHT+SB_PADDING,
|
||||
"Team 2", color);
|
||||
|
||||
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 0.8f);
|
||||
CG_DrawSmallStringColor(SB_MIDDLE+SB_PADDING+6, SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||
"Name", color);
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING+6+SB_WIDTH-(SMALLCHAR_WIDTH*13), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||
"Ping", color);
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING+6+SB_WIDTH-(SMALLCHAR_WIDTH*6), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||
"Frags", color);
|
||||
if (cg.scoreTPMode) {
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING+6+SB_WIDTH-(SMALLCHAR_WIDTH*11), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||
"Ping Time", color);
|
||||
}
|
||||
else {
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING+6+SB_WIDTH-(SMALLCHAR_WIDTH*14), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||
"Frags Deaths", color);
|
||||
}
|
||||
|
||||
|
||||
// Scores:
|
||||
String = va("%d Won", cg.teamScores[0]);
|
||||
String = va("Wins: %d ", cg.teamScores[0]);
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*strlen(String)),
|
||||
SB_START_HEIGHT+SB_PADDING, String, color);
|
||||
String = va("%d Won", cg.teamScores[1]);
|
||||
|
||||
String = va("Wins: %d ", cg.teamScores[1]);
|
||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING+6+SB_WIDTH-(SMALLCHAR_WIDTH*strlen(String)),
|
||||
SB_START_HEIGHT+SB_PADDING, String, color);
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.16 2002/02/10 08:17:08 niceass
|
||||
// many changes to scoreboard (deaths/second mode)
|
||||
//
|
||||
// Revision 1.15 2002/01/12 20:00:49 hal9000
|
||||
// Fixed a few more instances of strcmp(blah,NULL)
|
||||
//
|
||||
|
@ -87,8 +90,10 @@ static void CG_ParseScores( void ) {
|
|||
cg.scores[i].scoreFlags = atoi( CG_Argv( i * 14 + 8 ) );
|
||||
powerups = atoi( CG_Argv( i * 14 + 9 ) );
|
||||
cg.scores[i].accuracy = atoi(CG_Argv(i * 14 + 10));
|
||||
// Added deaths, replaced the place of impressiveCount
|
||||
cg.scores[i].deaths = atoi(CG_Argv(i * 14 + 11));
|
||||
//Elder: these should be zero
|
||||
cg.scores[i].impressiveCount = atoi(CG_Argv(i * 14 + 11));
|
||||
//cg.scores[i].impressiveCount = atoi(CG_Argv(i * 14 + 11));
|
||||
cg.scores[i].excellentCount = atoi(CG_Argv(i * 14 + 12));
|
||||
cg.scores[i].guantletCount = atoi(CG_Argv(i * 14 + 13));
|
||||
cg.scores[i].defendCount = atoi(CG_Argv(i * 14 + 14));
|
||||
|
|
Loading…
Reference in a new issue