mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2025-02-16 16:51:16 +00:00
Some changes to scoreboard (single player support). No more Sbar_SoloScoreboard()
This commit is contained in:
parent
a32eb9e1b8
commit
2e596668ba
3 changed files with 31 additions and 24 deletions
|
@ -793,6 +793,12 @@ void CL_FullServerinfo_f (void)
|
|||
else
|
||||
Con_Printf("Invalid standards version: %s", p);
|
||||
}
|
||||
|
||||
// check game type (also done in CL_ServerInfo_f)
|
||||
if ((p = Info_ValueForKey(cl.serverinfo, "deathmatch")) && *p)
|
||||
cl.gametype = Q_atoi (p) ? GAME_DEATHMATCH : GAME_COOP;
|
||||
else
|
||||
cl.gametype = GAME_DEATHMATCH;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -647,23 +647,26 @@ int Sbar_ColorForMap (int m)
|
|||
|
||||
/*
|
||||
===============
|
||||
Sbar_SoloScoreboard
|
||||
Sbar_DrawScoreboard
|
||||
===============
|
||||
*/
|
||||
void Sbar_SoloScoreboard (void)
|
||||
void Sbar_DrawScoreboard (void)
|
||||
{
|
||||
char str[80];
|
||||
int minutes, seconds, tens, units;
|
||||
|
||||
#ifdef QUAKEWORLD
|
||||
Sbar_DrawPic (0, 0, sb_scorebar);
|
||||
#else
|
||||
snprintf(str, sizeof(str),"Monsters:%3i /%3i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]);
|
||||
Sbar_DrawString (8, 4, str);
|
||||
#endif
|
||||
|
||||
snprintf(str, sizeof(str),"Secrets :%3i /%3i", cl.stats[STAT_SECRETS], cl.stats[STAT_TOTALSECRETS]);
|
||||
Sbar_DrawString (8, 12, str);
|
||||
#endif // QUAKEWORLD
|
||||
if (cl.gametype != GAME_DEATHMATCH)
|
||||
{
|
||||
snprintf(str, sizeof(str),"Monsters:%3i /%3i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]);
|
||||
Sbar_DrawString (8, 4, str);
|
||||
|
||||
snprintf(str, sizeof(str),"Secrets :%3i /%3i", cl.stats[STAT_SECRETS], cl.stats[STAT_TOTALSECRETS]);
|
||||
Sbar_DrawString (8, 12, str);
|
||||
}
|
||||
|
||||
// time
|
||||
minutes = cl.time / 60;
|
||||
|
@ -673,29 +676,20 @@ void Sbar_SoloScoreboard (void)
|
|||
snprintf(str, sizeof(str),"Time :%3i:%i%i", minutes, tens, units);
|
||||
Sbar_DrawString (184, 4, str);
|
||||
|
||||
#ifdef UQUAKE
|
||||
//#ifdef UQUAKE
|
||||
{
|
||||
// draw level name
|
||||
int l = strlen (cl.levelname);
|
||||
Sbar_DrawString (232 - l*4, 12, cl.levelname);
|
||||
if (l < 22 && !strstr(cl.levelname, "\n"))
|
||||
Sbar_DrawString (232 - l*4, 12, cl.levelname);
|
||||
}
|
||||
#endif // UQUAKE
|
||||
}
|
||||
//#endif // UQUAKE
|
||||
|
||||
/*
|
||||
===============
|
||||
Sbar_DrawScoreboard
|
||||
===============
|
||||
*/
|
||||
void Sbar_DrawScoreboard (void)
|
||||
{
|
||||
#ifdef UQUAKE
|
||||
Sbar_SoloScoreboard ();
|
||||
if (cl.gametype == GAME_DEATHMATCH)
|
||||
Sbar_DeathmatchOverlay (0);
|
||||
#endif // UQUAKE
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
/*
|
||||
|
@ -1235,7 +1229,7 @@ void Sbar_Draw (void)
|
|||
Sbar_DrawString(160-14*8+4, 12, "Press [ATTACK] for AutoCamera");
|
||||
} else {
|
||||
if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
|
||||
Sbar_SoloScoreboard ();
|
||||
Sbar_DrawScoreboard ();
|
||||
else
|
||||
Sbar_DrawNormal ();
|
||||
|
||||
|
@ -1245,7 +1239,7 @@ void Sbar_Draw (void)
|
|||
Sbar_DrawString(0, -8, st);
|
||||
}
|
||||
} else if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
|
||||
Sbar_SoloScoreboard ();
|
||||
Sbar_DrawScoreboard ();
|
||||
else
|
||||
Sbar_DrawNormal ();
|
||||
#else
|
||||
|
|
|
@ -976,6 +976,7 @@ void CL_ServerInfo (void)
|
|||
{
|
||||
char key[MAX_MSGLEN];
|
||||
char value[MAX_MSGLEN];
|
||||
char *p;
|
||||
|
||||
strncpy (key, MSG_ReadString(), sizeof(key) - 1);
|
||||
key[sizeof(key) - 1] = 0;
|
||||
|
@ -985,6 +986,12 @@ void CL_ServerInfo (void)
|
|||
Con_DPrintf("SERVERINFO: %s=%s\n", key, value);
|
||||
|
||||
Info_SetValueForKey (cl.serverinfo, key, value, MAX_SERVERINFO_STRING);
|
||||
|
||||
// check game type (also done in CL_FullServerinfo_f)
|
||||
if ((p = Info_ValueForKey(cl.serverinfo, "deathmatch")) && *p)
|
||||
cl.gametype = Q_atoi (p) ? GAME_DEATHMATCH : GAME_COOP;
|
||||
else
|
||||
cl.gametype = GAME_DEATHMATCH;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue