make highlight color in scoreboard and tab ranking player coloured
also make it appear in splitscreen similar to hostmod things
This commit is contained in:
1 parent
6f5a0b9a3f
commit
43f9bd5239
6 files changed
+147
-14
No files matched your search
+1
-7
@@ -2615,7 +2615,6 @@ static void HU_DrawRankings(void)
|
||||
playersort_t tab[MAXPLAYERS];
|
||||
INT32 i, j, scorelines, hilicol, numplayersingame = 0;
|
||||
boolean completed[MAXPLAYERS];
|
||||
UINT32 whiteplayer = MAXPLAYERS;
|
||||
|
||||
if (!automapactive)
|
||||
V_DrawFadeScreen(0xFF00, 16); // A little more readable, and prevents cheating the fades under other circumstances.
|
||||
@@ -2703,11 +2702,6 @@ static void HU_DrawRankings(void)
|
||||
V_DrawCenteredString(256, 16, hilicol, cv_kartspeed.string);
|
||||
}
|
||||
|
||||
// When you play, you quickly see your score because your name is displayed in white.
|
||||
// When playing back a demo, you quickly see who's the view.
|
||||
if (!splitscreen)
|
||||
whiteplayer = demo.playback ? displayplayers[0] : consoleplayer;
|
||||
|
||||
scorelines = 0;
|
||||
memset(completed, 0, sizeof (completed));
|
||||
memset(tab, 0, sizeof (playersort_t)*MAXPLAYERS);
|
||||
@@ -2763,7 +2757,7 @@ static void HU_DrawRankings(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
HU_DrawTabRankings(((scorelines > 8) ? 32 : 40), 33, tab, scorelines, whiteplayer, hilicol);
|
||||
HU_DrawTabRankings(((scorelines > 8) ? 32 : 40), 33, tab, scorelines, hilicol);
|
||||
|
||||
// draw spectators in a ticker across the bottom
|
||||
if (netgame && G_GametypeHasSpectators())
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@ void HU_clearChatChars(void);
|
||||
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags); // Lat': Ping drawer for scoreboard.
|
||||
//void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
|
||||
//void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
|
||||
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol);
|
||||
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 hilicol);
|
||||
void HU_DrawEmeralds(INT32 x, INT32 y, INT32 pemeralds);
|
||||
const char *HU_SkinColorToConsoleColor(skincolors_t color);
|
||||
|
||||
|
||||
+10
-4
@@ -8562,12 +8562,14 @@ static boolean K_drawKartPositionFaces(void)
|
||||
//
|
||||
// HU_DrawTabRankings -- moved here to take advantage of kart stuff!
|
||||
//
|
||||
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol)
|
||||
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 hilicol)
|
||||
{
|
||||
INT32 i, rightoffset = 240;
|
||||
const UINT8 *colormap;
|
||||
INT32 dupadjust = (vid.width/vid.dupx), duptweak = (dupadjust - BASEVIDWIDTH)/2;
|
||||
|
||||
boolean (*_isHighlightedPlayer)(const player_t *) = (demo.playback ? P_IsDisplayPlayer : P_IsLocalPlayer);
|
||||
|
||||
//this function is designed for 9 or less score lines only
|
||||
//I_Assert(scorelines <= 9); -- not today bitch, kart fixed it up
|
||||
|
||||
@@ -8587,6 +8589,10 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||
if (players[pnum].spectator || !players[pnum].mo)
|
||||
continue; //ignore them.
|
||||
|
||||
const boolean whiteplayer = _isHighlightedPlayer(&players[pnum]);
|
||||
|
||||
const INT32 philicol = (whiteplayer ? V_SkinColorToHighlightcolor(players[pnum].skincolor) : 0);
|
||||
|
||||
if (netgame // don't draw it offline
|
||||
&& pnum != serverplayer)
|
||||
HU_drawPing(x + ((i < 8) ? -17 : rightoffset + 11), y-4, playerpingtable[pnum], 0);
|
||||
@@ -8594,9 +8600,9 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||
STRBUFCPY(strtime, tab[i].name);
|
||||
|
||||
if (scorelines > 8)
|
||||
V_DrawThinString(x + 20, y, ((tab[i].num == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE|V_6WIDTHSPACE, strtime);
|
||||
V_DrawThinString(x + 20, y, philicol|V_ALLOWLOWERCASE|V_6WIDTHSPACE, strtime);
|
||||
else
|
||||
V_DrawString(x + 20, y, ((tab[i].num == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE, strtime);
|
||||
V_DrawString(x + 20, y, philicol|V_ALLOWLOWERCASE, strtime);
|
||||
|
||||
if (players[pnum].mo->color)
|
||||
{
|
||||
@@ -8627,7 +8633,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||
}*/
|
||||
}
|
||||
|
||||
if (tab[i].num == whiteplayer)
|
||||
if (whiteplayer)
|
||||
V_DrawScaledPatch(x, y-4, 0, kp_facehighlight[(leveltime / 4) % 8]);
|
||||
|
||||
if (G_BattleGametype() && players[pnum].kartstuff[k_bumper] <= 0)
|
||||
|
||||
+126
@@ -3165,6 +3165,132 @@ char V_GetSkincolorChar(INT32 color)
|
||||
return cstart;
|
||||
}
|
||||
|
||||
INT32 V_SkinColorToHighlightcolor(skincolors_t color)
|
||||
{
|
||||
switch (color)
|
||||
{
|
||||
case SKINCOLOR_WHITE:
|
||||
case SKINCOLOR_SILVER:
|
||||
case SKINCOLOR_SLATE:
|
||||
return 0; // White
|
||||
case SKINCOLOR_GREY:
|
||||
case SKINCOLOR_NICKEL:
|
||||
case SKINCOLOR_BLACK:
|
||||
case SKINCOLOR_SKUNK:
|
||||
case SKINCOLOR_JET:
|
||||
return V_GRAYMAP;
|
||||
case SKINCOLOR_SEPIA:
|
||||
case SKINCOLOR_BEIGE:
|
||||
case SKINCOLOR_WALNUT:
|
||||
case SKINCOLOR_BROWN:
|
||||
case SKINCOLOR_LEATHER:
|
||||
case SKINCOLOR_RUST:
|
||||
case SKINCOLOR_WRISTWATCH:
|
||||
return V_BROWNMAP;
|
||||
case SKINCOLOR_FAIRY:
|
||||
case SKINCOLOR_SALMON:
|
||||
case SKINCOLOR_PINK:
|
||||
case SKINCOLOR_ROSE:
|
||||
case SKINCOLOR_BRICK:
|
||||
case SKINCOLOR_LEMONADE:
|
||||
case SKINCOLOR_BUBBLEGUM:
|
||||
case SKINCOLOR_LILAC:
|
||||
return V_PINKMAP;
|
||||
case SKINCOLOR_CINNAMON:
|
||||
case SKINCOLOR_RUBY:
|
||||
case SKINCOLOR_RASPBERRY:
|
||||
case SKINCOLOR_CHERRY:
|
||||
case SKINCOLOR_RED:
|
||||
case SKINCOLOR_CRIMSON:
|
||||
case SKINCOLOR_MAROON:
|
||||
case SKINCOLOR_FLAME:
|
||||
case SKINCOLOR_SCARLET:
|
||||
case SKINCOLOR_KETCHUP:
|
||||
return V_REDMAP;
|
||||
case SKINCOLOR_DAWN:
|
||||
case SKINCOLOR_SUNSET:
|
||||
case SKINCOLOR_CREAMSICLE:
|
||||
case SKINCOLOR_ORANGE:
|
||||
case SKINCOLOR_PUMPKIN:
|
||||
case SKINCOLOR_ROSEWOOD:
|
||||
case SKINCOLOR_BURGUNDY:
|
||||
case SKINCOLOR_TANGERINE:
|
||||
return V_ORANGEMAP;
|
||||
case SKINCOLOR_PEACH:
|
||||
case SKINCOLOR_CARAMEL:
|
||||
case SKINCOLOR_CREAM:
|
||||
return V_PEACHMAP;
|
||||
case SKINCOLOR_GOLD:
|
||||
case SKINCOLOR_ROYAL:
|
||||
case SKINCOLOR_BRONZE:
|
||||
case SKINCOLOR_COPPER:
|
||||
case SKINCOLOR_THUNDER:
|
||||
return V_GOLDMAP;
|
||||
case SKINCOLOR_POPCORN:
|
||||
case SKINCOLOR_QUARRY:
|
||||
case SKINCOLOR_YELLOW:
|
||||
case SKINCOLOR_MUSTARD:
|
||||
case SKINCOLOR_CROCODILE:
|
||||
case SKINCOLOR_OLIVE:
|
||||
return V_YELLOWMAP;
|
||||
case SKINCOLOR_ARTICHOKE:
|
||||
case SKINCOLOR_VOMIT:
|
||||
case SKINCOLOR_GARDEN:
|
||||
case SKINCOLOR_TEA:
|
||||
case SKINCOLOR_PISTACHIO:
|
||||
return V_TEAMAP;
|
||||
case SKINCOLOR_LIME:
|
||||
case SKINCOLOR_HANDHELD:
|
||||
case SKINCOLOR_MOSS:
|
||||
case SKINCOLOR_CAMOUFLAGE:
|
||||
case SKINCOLOR_ROBOHOOD:
|
||||
case SKINCOLOR_MINT:
|
||||
case SKINCOLOR_GREEN:
|
||||
case SKINCOLOR_PINETREE:
|
||||
case SKINCOLOR_EMERALD:
|
||||
case SKINCOLOR_SWAMP:
|
||||
case SKINCOLOR_DREAM:
|
||||
case SKINCOLOR_PLAGUE:
|
||||
case SKINCOLOR_ALGAE:
|
||||
return V_GREENMAP;
|
||||
case SKINCOLOR_CARIBBEAN:
|
||||
case SKINCOLOR_AZURE:
|
||||
case SKINCOLOR_AQUA:
|
||||
case SKINCOLOR_TEAL:
|
||||
case SKINCOLOR_CYAN:
|
||||
case SKINCOLOR_JAWZ:
|
||||
case SKINCOLOR_CERULEAN:
|
||||
case SKINCOLOR_NAVY:
|
||||
case SKINCOLOR_SAPPHIRE:
|
||||
return V_SKYMAP;
|
||||
case SKINCOLOR_PIGEON:
|
||||
case SKINCOLOR_PLATINUM:
|
||||
case SKINCOLOR_STEEL:
|
||||
return V_STEELMAP;
|
||||
case SKINCOLOR_PERIWINKLE:
|
||||
case SKINCOLOR_BLUE:
|
||||
case SKINCOLOR_BLUEBERRY:
|
||||
case SKINCOLOR_NOVA:
|
||||
return V_BLUEMAP;
|
||||
case SKINCOLOR_ULTRAVIOLET:
|
||||
case SKINCOLOR_PURPLE:
|
||||
case SKINCOLOR_FUCHSIA:
|
||||
return V_PURPLEMAP;
|
||||
case SKINCOLOR_PASTEL:
|
||||
case SKINCOLOR_MOONSLAM:
|
||||
case SKINCOLOR_DUSK:
|
||||
case SKINCOLOR_TOXIC:
|
||||
case SKINCOLOR_MAUVE:
|
||||
case SKINCOLOR_LAVENDER:
|
||||
case SKINCOLOR_BYZANTIUM:
|
||||
case SKINCOLOR_POMEGRANATE:
|
||||
return V_LAVENDERMAP;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
boolean *heatshifter = NULL;
|
||||
INT32 lastheight = 0;
|
||||
INT32 heatindex[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
|
||||
|
||||
@@ -254,6 +254,8 @@ INT32 V_SubStringLengthToFit(const char *string, INT32 width, INT32 option);
|
||||
|
||||
char V_GetSkincolorChar(INT32 color);
|
||||
|
||||
INT32 V_SkinColorToHighlightcolor(skincolors_t color);
|
||||
|
||||
typedef struct player_s player_t;
|
||||
|
||||
void V_DoPostProcessor(INT32 view, player_t *player, INT32 param);
|
||||
|
||||
+7
-2
@@ -383,6 +383,8 @@ static void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 x, INT32 hilicol)
|
||||
|
||||
V_DrawRightAlignedString(x+(BASEVIDWIDTH/2)+152, 24, hilicol, timeheader);
|
||||
|
||||
boolean (*_isHighlightedPlayer)(const player_t *) = (demo.playback ? P_IsDisplayPlayer : P_IsLocalPlayer);
|
||||
|
||||
for (i = 0; i < standings->numplayers; i++)
|
||||
{
|
||||
const UINT8 pnum = standings->num[i];
|
||||
@@ -395,6 +397,9 @@ static void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 x, INT32 hilicol)
|
||||
{
|
||||
char strtime[MAXPLAYERNAME+1];
|
||||
|
||||
const boolean whiteplayer = _isHighlightedPlayer(&players[pnum]);
|
||||
const INT32 philicol = (whiteplayer ? V_SkinColorToHighlightcolor(players[pnum].skincolor) : 0);
|
||||
|
||||
// Apply the jitter offset (later reversed)
|
||||
if (standings->jitter[pnum] > 0)
|
||||
y--;
|
||||
@@ -433,9 +438,9 @@ static void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 x, INT32 hilicol)
|
||||
STRBUFCPY(strtime, standings->name[i]);
|
||||
|
||||
if (standings->numplayers > NUMFORNEWCOLUMN)
|
||||
V_DrawThinString(x+36, y-1, ((pnum == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE|V_6WIDTHSPACE, strtime);
|
||||
V_DrawThinString(x+36, y-1, philicol|V_ALLOWLOWERCASE|V_6WIDTHSPACE, strtime);
|
||||
else
|
||||
V_DrawString(x+36, y, ((pnum == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE, strtime);
|
||||
V_DrawString(x+36, y, philicol|V_ALLOWLOWERCASE, strtime);
|
||||
|
||||
if (standings->rankingsmode)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user