mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-02-18 10:02:50 +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$
|
// $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
|
// Revision 1.27 2002/02/09 00:10:12 jbravo
|
||||||
// Fixed spectator follow and free and updated zcam to 1.04 and added the
|
// Fixed spectator follow and free and updated zcam to 1.04 and added the
|
||||||
// missing zcam files.
|
// missing zcam files.
|
||||||
|
@ -222,7 +225,13 @@ static void CG_ScoresDown_f( void ) {
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
CG_BuildSpectatorString();
|
CG_BuildSpectatorString();
|
||||||
#endif
|
#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 ) {
|
if ( cg.scoresRequestTime + 2000 < cg.time ) {
|
||||||
// the scores are more than two seconds out of data,
|
// the scores are more than two seconds out of data,
|
||||||
// so request new ones
|
// so request new ones
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $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
|
// Revision 1.47 2002/02/10 02:49:13 niceass
|
||||||
// re-added zcam #define
|
// re-added zcam #define
|
||||||
//
|
//
|
||||||
|
@ -365,6 +368,7 @@ typedef struct localEntity_s {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int client;
|
int client;
|
||||||
int score;
|
int score;
|
||||||
|
int deaths; // NiceAss: Added deaths
|
||||||
int ping;
|
int ping;
|
||||||
int time;
|
int time;
|
||||||
int scoreFlags;
|
int scoreFlags;
|
||||||
|
@ -654,6 +658,7 @@ typedef struct {
|
||||||
qboolean showScores;
|
qboolean showScores;
|
||||||
qboolean scoreBoardShowing;
|
qboolean scoreBoardShowing;
|
||||||
int scoreFadeTime;
|
int scoreFadeTime;
|
||||||
|
int scoreTPMode;
|
||||||
char killerName[MAX_NAME_LENGTH];
|
char killerName[MAX_NAME_LENGTH];
|
||||||
char spectatorList[MAX_STRING_CHARS]; // list of names
|
char spectatorList[MAX_STRING_CHARS]; // list of names
|
||||||
int spectatorLen; // length of list
|
int spectatorLen; // length of list
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $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
|
// Revision 1.5 2002/02/04 00:23:05 niceass
|
||||||
// New TP scoreboard
|
// New TP scoreboard
|
||||||
//
|
//
|
||||||
|
@ -71,7 +74,7 @@
|
||||||
static qboolean localClient; // true if local client has been displayed
|
static qboolean localClient; // true if local client has been displayed
|
||||||
|
|
||||||
// NiceAss:
|
// NiceAss:
|
||||||
#define SB_WIDTH 260 // 285
|
#define SB_WIDTH 280 // 285
|
||||||
#define SB_START_HEIGHT 70
|
#define SB_START_HEIGHT 70
|
||||||
#define SB_MIDDLE (SCREEN_WIDTH/2)
|
#define SB_MIDDLE (SCREEN_WIDTH/2)
|
||||||
#define SB_LINE_WIDTH 1
|
#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;
|
clientInfo_t *ci;
|
||||||
int iconx, headx;
|
int iconx, headx;
|
||||||
float hcolor[4];
|
float hcolor[4];
|
||||||
|
int size;
|
||||||
|
|
||||||
if ( score->client < 0 || score->client >= cgs.maxclients ) {
|
if ( score->client < 0 || score->client >= cgs.maxclients ) {
|
||||||
Com_Printf( "Bad score->client: %i\n", score->client );
|
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];
|
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);
|
CG_DrawStringExt( x, y, ci->name, color, qtrue, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, 17);
|
||||||
|
|
||||||
if ( score->client == cg.snap->ps.clientNum ) {
|
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 );
|
CG_FillRect( x, y, SB_WIDTH-SB_PADDING*2, SMALLCHAR_HEIGHT, hcolor );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (score->ping == -1)
|
if (cg.scoreTPMode) {
|
||||||
Com_sprintf(string, sizeof(string),
|
if (score->ping == -1)
|
||||||
"CONNECTING");
|
Com_sprintf(string, sizeof(string),
|
||||||
else
|
"Connecting");
|
||||||
Com_sprintf(string, sizeof(string),
|
else
|
||||||
"%4i %5i", score->ping, score->score);
|
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)
|
static int CG_TeamplayScoreboard(int maxClients)
|
||||||
{
|
{
|
||||||
int i, red, blue, spec;
|
int i, red, blue, spec;
|
||||||
float color[4], Alpha;
|
float color[4], Alpha, Alpha2;
|
||||||
score_t *score;
|
score_t *score;
|
||||||
clientInfo_t *ci;
|
clientInfo_t *ci;
|
||||||
int y;
|
int y;
|
||||||
|
@ -279,6 +295,7 @@ static int CG_TeamplayScoreboard(int maxClients)
|
||||||
|
|
||||||
if (cg.time > cg.scoreStartTime+300) {
|
if (cg.time > cg.scoreStartTime+300) {
|
||||||
Alpha = (cos((cg.time-cg.scoreStartTime) / 400.0f) + 1.0f) * 0.25f + 0.5f;
|
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 {
|
else {
|
||||||
Alpha = (float)(cg.time-cg.scoreStartTime)/(float)300;
|
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);
|
MAKERGBA(color, 1.0f, 0.5f, 0.5f, 0.7f * Alpha);
|
||||||
CG_FillRect(SB_MIDDLE - SB_WIDTH - 6, SB_START_HEIGHT,
|
CG_FillRect(SB_MIDDLE - SB_WIDTH - 6, SB_START_HEIGHT,
|
||||||
SB_WIDTH, SMALLCHAR_HEIGHT+(SB_PADDING*2), color);
|
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),
|
CG_FillRect(SB_MIDDLE - SB_WIDTH - 6, SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*2),
|
||||||
SB_WIDTH, SMALLCHAR_HEIGHT+(SB_PADDING*2), color);
|
SB_WIDTH, SMALLCHAR_HEIGHT+(SB_PADDING*2), color);
|
||||||
MAKERGBA(color, 0.6f, 0.5f, 0.5f, 0.5f * Alpha);
|
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 );
|
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,
|
CG_DrawSmallStringColor(SB_MIDDLE-SB_WIDTH+SB_PADDING-6, SB_START_HEIGHT+SB_PADDING,
|
||||||
"Team 1", color);
|
"Team 1", color);
|
||||||
|
|
||||||
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 0.8f);
|
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),
|
CG_DrawSmallStringColor(SB_MIDDLE-SB_WIDTH+SB_PADDING-6, SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||||
"Name", color);
|
"Name", color);
|
||||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*13), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
if (cg.scoreTPMode) {
|
||||||
"Ping", color);
|
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*11), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*6), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
"Ping Time", color);
|
||||||
"Frags", color);
|
}
|
||||||
|
else {
|
||||||
|
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*14), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||||
|
"Frags Deaths", color);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Blue:
|
// Blue:
|
||||||
MAKERGBA(color, 0.5f, 0.5f, 1.0f, 0.7f * Alpha);
|
MAKERGBA(color, 0.5f, 0.5f, 1.0f, 0.7f * Alpha);
|
||||||
CG_FillRect(SB_MIDDLE + 6, SB_START_HEIGHT,
|
CG_FillRect(SB_MIDDLE + 6, SB_START_HEIGHT,
|
||||||
SB_WIDTH, SMALLCHAR_HEIGHT+(SB_PADDING*2), color);
|
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),
|
CG_FillRect(SB_MIDDLE + 6, SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*2),
|
||||||
SB_WIDTH, SMALLCHAR_HEIGHT+(SB_PADDING*2), color);
|
SB_WIDTH, SMALLCHAR_HEIGHT+(SB_PADDING*2), color);
|
||||||
MAKERGBA(color, 0.5f, 0.5f, 0.6f, 0.5f * Alpha);
|
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),
|
CG_DrawCleanRect( SB_MIDDLE + 6, SB_START_HEIGHT + SMALLCHAR_HEIGHT+(SB_PADDING*2),
|
||||||
SB_WIDTH, (SMALLCHAR_HEIGHT+SB_PADDING*2), SB_LINE_WIDTH, color );
|
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,
|
CG_DrawSmallStringColor(SB_MIDDLE+SB_PADDING+6, SB_START_HEIGHT+SB_PADDING,
|
||||||
"Team 2", color);
|
"Team 2", color);
|
||||||
|
|
||||||
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 0.8f);
|
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),
|
CG_DrawSmallStringColor(SB_MIDDLE+SB_PADDING+6, SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||||
"Name", color);
|
"Name", color);
|
||||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING+6+SB_WIDTH-(SMALLCHAR_WIDTH*13), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
if (cg.scoreTPMode) {
|
||||||
"Ping", color);
|
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING+6+SB_WIDTH-(SMALLCHAR_WIDTH*11), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
||||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING+6+SB_WIDTH-(SMALLCHAR_WIDTH*6), SB_START_HEIGHT+SMALLCHAR_HEIGHT+(SB_PADDING*3),
|
"Ping Time", color);
|
||||||
"Frags", 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
String = va("Wins: %d ", cg.teamScores[0]);
|
||||||
// Scores:
|
|
||||||
String = va("%d Won", cg.teamScores[0]);
|
|
||||||
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*strlen(String)),
|
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING-6-(SMALLCHAR_WIDTH*strlen(String)),
|
||||||
SB_START_HEIGHT+SB_PADDING, String, color);
|
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)),
|
CG_DrawSmallStringColor(SB_MIDDLE-SB_PADDING+6+SB_WIDTH-(SMALLCHAR_WIDTH*strlen(String)),
|
||||||
SB_START_HEIGHT+SB_PADDING, String, color);
|
SB_START_HEIGHT+SB_PADDING, String, color);
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $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
|
// Revision 1.15 2002/01/12 20:00:49 hal9000
|
||||||
// Fixed a few more instances of strcmp(blah,NULL)
|
// 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 ) );
|
cg.scores[i].scoreFlags = atoi( CG_Argv( i * 14 + 8 ) );
|
||||||
powerups = atoi( CG_Argv( i * 14 + 9 ) );
|
powerups = atoi( CG_Argv( i * 14 + 9 ) );
|
||||||
cg.scores[i].accuracy = atoi(CG_Argv(i * 14 + 10));
|
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
|
//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].excellentCount = atoi(CG_Argv(i * 14 + 12));
|
||||||
cg.scores[i].guantletCount = atoi(CG_Argv(i * 14 + 13));
|
cg.scores[i].guantletCount = atoi(CG_Argv(i * 14 + 13));
|
||||||
cg.scores[i].defendCount = atoi(CG_Argv(i * 14 + 14));
|
cg.scores[i].defendCount = atoi(CG_Argv(i * 14 + 14));
|
||||||
|
|
Loading…
Reference in a new issue