mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Changes to tab rankings
* No longer has gametype-specific highlight
* Shows Grand Prix and Capsules instead of gametype name if relevant
* Operates on a heirarchy for important information
* Shows grand prix round on left if in GP (resolves #360)
* Shows capsules remaining on right if in BTC
* Attempts to draw timelimit and pointlimit on both left and right
* Number of laps remaining/gamespeed is least priority for left and right sides
This commit is contained in:
parent
1ac0c44f77
commit
f8999bea36
1 changed files with 84 additions and 29 deletions
|
|
@ -55,6 +55,8 @@
|
||||||
// SRB2Kart
|
// SRB2Kart
|
||||||
#include "s_sound.h" // song credits
|
#include "s_sound.h" // song credits
|
||||||
#include "k_kart.h"
|
#include "k_kart.h"
|
||||||
|
#include "k_battle.h"
|
||||||
|
#include "k_grandprix.h"
|
||||||
#include "k_color.h"
|
#include "k_color.h"
|
||||||
#include "k_hud.h"
|
#include "k_hud.h"
|
||||||
#include "r_fps.h"
|
#include "r_fps.h"
|
||||||
|
|
@ -2391,26 +2393,41 @@ static inline void HU_DrawSpectatorTicker(void)
|
||||||
static void HU_DrawRankings(void)
|
static void HU_DrawRankings(void)
|
||||||
{
|
{
|
||||||
playersort_t tab[MAXPLAYERS];
|
playersort_t tab[MAXPLAYERS];
|
||||||
INT32 i, j, scorelines, hilicol, numplayersingame = 0;
|
INT32 i, j, scorelines, numplayersingame = 0, hilicol = highlightflags;
|
||||||
boolean completed[MAXPLAYERS];
|
boolean completed[MAXPLAYERS];
|
||||||
UINT32 whiteplayer = MAXPLAYERS;
|
UINT32 whiteplayer = MAXPLAYERS;
|
||||||
|
boolean timedone = false, pointsdone = false;
|
||||||
|
|
||||||
V_DrawFadeScreen(0xFF00, 16); // A little more readable, and prevents cheating the fades under other circumstances.
|
V_DrawFadeScreen(0xFF00, 16); // A little more readable, and prevents cheating the fades under other circumstances.
|
||||||
|
|
||||||
if (modeattacking)
|
|
||||||
hilicol = V_ORANGEMAP;
|
|
||||||
else
|
|
||||||
hilicol = ((gametype == GT_RACE) ? V_SKYMAP : V_REDMAP);
|
|
||||||
|
|
||||||
// draw the current gametype in the lower right
|
// draw the current gametype in the lower right
|
||||||
if (modeattacking)
|
if (grandprixinfo.gp == true)
|
||||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, "Record Attack");
|
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, "Grand Prix");
|
||||||
|
else if (battlecapsules)
|
||||||
|
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, "Capsules");
|
||||||
else if (gametype >= 0 && gametype < numgametypes)
|
else if (gametype >= 0 && gametype < numgametypes)
|
||||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, gametypes[gametype]->name);
|
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, gametypes[gametype]->name);
|
||||||
|
|
||||||
if ((gametyperules & (GTR_TIMELIMIT|GTR_POINTLIMIT)))
|
// Left hand side
|
||||||
|
if (grandprixinfo.gp == true)
|
||||||
{
|
{
|
||||||
if ((gametyperules & GTR_TIMELIMIT) && timelimitintics > 0)
|
const char *roundstr = NULL;
|
||||||
|
V_DrawCenteredString(64, 8, 0, "ROUND");
|
||||||
|
switch (grandprixinfo.eventmode)
|
||||||
|
{
|
||||||
|
case GPEVENT_BONUS:
|
||||||
|
roundstr = "BONUS";
|
||||||
|
break;
|
||||||
|
case GPEVENT_SPECIAL:
|
||||||
|
roundstr = "SPECIAL";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
roundstr = va("%d", grandprixinfo.roundnum);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
V_DrawCenteredString(64, 16, hilicol, roundstr);
|
||||||
|
}
|
||||||
|
else if ((gametyperules & GTR_TIMELIMIT) && timelimitintics > 0)
|
||||||
{
|
{
|
||||||
UINT32 timeval = (timelimitintics + starttime + 1 - leveltime);
|
UINT32 timeval = (timelimitintics + starttime + 1 - leveltime);
|
||||||
if (timeval > timelimitintics+1)
|
if (timeval > timelimitintics+1)
|
||||||
|
|
@ -2429,13 +2446,14 @@ static void HU_DrawRankings(void)
|
||||||
V_DrawCenteredString(64, 8, 0, "TIME LEFT");
|
V_DrawCenteredString(64, 8, 0, "TIME LEFT");
|
||||||
V_DrawCenteredString(64, 16, hilicol, "OVERTIME");
|
V_DrawCenteredString(64, 16, hilicol, "OVERTIME");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ((gametyperules & GTR_POINTLIMIT) && cv_pointlimit.value > 0)
|
timedone = true;
|
||||||
{
|
|
||||||
V_DrawCenteredString(256, 8, 0, "POINT LIMIT");
|
|
||||||
V_DrawCenteredString(256, 16, hilicol, va("%d", cv_pointlimit.value));
|
|
||||||
}
|
}
|
||||||
|
else if ((gametyperules & GTR_POINTLIMIT) && cv_pointlimit.value > 0)
|
||||||
|
{
|
||||||
|
V_DrawCenteredString(64, 8, 0, "POINT LIMIT");
|
||||||
|
V_DrawCenteredString(64, 16, hilicol, va("%d", cv_pointlimit.value));
|
||||||
|
pointsdone = true;
|
||||||
}
|
}
|
||||||
else if (gametyperules & GTR_CIRCUIT)
|
else if (gametyperules & GTR_CIRCUIT)
|
||||||
{
|
{
|
||||||
|
|
@ -2444,7 +2462,44 @@ static void HU_DrawRankings(void)
|
||||||
V_DrawCenteredString(64, 8, 0, "LAP COUNT");
|
V_DrawCenteredString(64, 8, 0, "LAP COUNT");
|
||||||
V_DrawCenteredString(64, 16, hilicol, va("%d", numlaps));
|
V_DrawCenteredString(64, 16, hilicol, va("%d", numlaps));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Right hand side
|
||||||
|
if (battlecapsules == true)
|
||||||
|
{
|
||||||
|
if (numtargets < maptargets)
|
||||||
|
{
|
||||||
|
V_DrawCenteredString(256, 8, 0, "CAPSULES");
|
||||||
|
V_DrawCenteredString(256, 16, hilicol, va("%d", maptargets - numtargets));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!timedone && (gametyperules & GTR_TIMELIMIT) && timelimitintics > 0)
|
||||||
|
{
|
||||||
|
UINT32 timeval = (timelimitintics + starttime + 1 - leveltime);
|
||||||
|
if (timeval > timelimitintics+1)
|
||||||
|
timeval = timelimitintics+1;
|
||||||
|
timeval /= TICRATE;
|
||||||
|
|
||||||
|
if (leveltime <= (timelimitintics + starttime))
|
||||||
|
{
|
||||||
|
V_DrawCenteredString(256, 8, 0, "TIME LEFT");
|
||||||
|
V_DrawCenteredString(256, 16, hilicol, va("%u", timeval));
|
||||||
|
}
|
||||||
|
|
||||||
|
// overtime
|
||||||
|
if (!players[consoleplayer].exiting && (leveltime > (timelimitintics + starttime + TICRATE/2)) && cv_overtime.value)
|
||||||
|
{
|
||||||
|
V_DrawCenteredString(256, 8, 0, "TIME LEFT");
|
||||||
|
V_DrawCenteredString(256, 16, hilicol, "OVERTIME");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!pointsdone && (gametyperules & GTR_POINTLIMIT) && cv_pointlimit.value > 0)
|
||||||
|
{
|
||||||
|
V_DrawCenteredString(256, 8, 0, "POINT LIMIT");
|
||||||
|
V_DrawCenteredString(256, 16, hilicol, va("%d", cv_pointlimit.value));
|
||||||
|
}
|
||||||
|
else if (gametyperules & GTR_CIRCUIT)
|
||||||
|
{
|
||||||
V_DrawCenteredString(256, 8, 0, "GAME SPEED");
|
V_DrawCenteredString(256, 8, 0, "GAME SPEED");
|
||||||
V_DrawCenteredString(256, 16, hilicol, kartspeed_cons_t[1+gamespeed].strvalue);
|
V_DrawCenteredString(256, 16, hilicol, kartspeed_cons_t[1+gamespeed].strvalue);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue