colourise pingnumber when gentlemens is active

This commit is contained in:
Alug committed 2025-01-23 18:06:06 +01:00
1 parent 86a172800d
commit ad4be98c8a
5 files changed
+17 -32

No files matched your search

+12 -12
View File
@@ -2373,6 +2373,14 @@ void HU_drawPing(INT32 x, INT32 y, UINT32 lag, INT32 flags)
SINT8 yoffset = 6;
//INT32 dx;
UINT32 lag = playerpingtable[pnum];
if (P_IsLocalPlayer(&players[pnum]) && lag < (tic_t)cv_mindelay.value)
{
lag = cv_mindelay.value;
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PASTEL, GTC_CACHE);
}
gfxnum = Ping_gfx_num(lag);
if (!cv_pingstyle.value)
@@ -2392,7 +2400,7 @@ void HU_drawPing(INT32 x, INT32 y, UINT32 lag, INT32 flags)
x = V_DrawPingNum(x + (measureid == 1 ? 11 - pingmeasure[measureid]->width : 10), y+9, flags, lag, colormap);
if (measureid == 0)
V_DrawScaledPatch(x+1 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]);
V_DrawScaledPatch(x+1 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]);
}
else if (cv_pingstyle.value) // old style ping
{
@@ -2440,8 +2448,8 @@ void HU_drawPing(INT32 x, INT32 y, UINT32 lag, INT32 flags)
}
if (cv_pingicon.value)
{
for (i=0; (i<3); i++) // Draw the ping bar
{
for (i = 0; (i < 3); i++) // Draw the ping bar
{
V_DrawFill(x+2 *(i-1)+7, y+8+yoffset-4, 2, 8-yoffset, 31|flags);
if (i < numbars)
@@ -2462,7 +2470,6 @@ static inline void HU_DrawSpectatorTicker(void)
INT32 length = 0, height = 174;
INT32 totallength = 0, templength = -8;
INT32 dupadjust = (vid.width/vid.dupx), duptweak = (dupadjust - BASEVIDWIDTH)/2;
UINT32 ping = 0;
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && players[i].spectator)
@@ -2538,14 +2545,7 @@ static inline void HU_DrawSpectatorTicker(void)
if ((netgame && i != serverplayer) || (cv_mindelay.value && P_IsLocalPlayer(&players[i])))
{
ping = playerpingtable[i];
if (P_IsLocalPlayer(&players[i]) && ping <= (tic_t)cv_mindelay.value)
{
ping = cv_mindelay.value;
}
HU_drawPing((templength - duptweak)+8, height-20, ping, V_TRANSLUCENT);
HU_drawPlayerPing((templength - duptweak)+8, height-20, i, V_TRANSLUCENT);
}
}
+1 -1
View File
@@ -119,7 +119,7 @@ void HU_Drawer(void);
char HU_dequeueChatChar(void);
void HU_Erase(void);
void HU_clearChatChars(void);
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags); // Lat': Ping drawer for scoreboard.
void HU_drawPlayerPing(INT32 x, INT32 y, INT32 pnum, 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 hilicol);
+1 -9
View File
@@ -9176,7 +9176,6 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
INT32 i, rightoffset = 240;
const UINT8 *colormap;
INT32 dupadjust = (vid.width/vid.dupx), duptweak = (dupadjust - BASEVIDWIDTH)/2;
UINT32 ping = 0;
boolean (*_isHighlightedPlayer)(const player_t *) = (demo.playback ? P_IsDisplayPlayer : P_IsLocalPlayer);
@@ -9204,14 +9203,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
if ((netgame && pnum != serverplayer) || (cv_mindelay.value && P_IsLocalPlayer(&players[pnum])))
{
ping = playerpingtable[pnum];
if (P_IsLocalPlayer(&players[pnum]) && ping <= (tic_t)cv_mindelay.value)
{
ping = cv_mindelay.value;
}
HU_drawPing(x + ((i < 8) ? -17 : rightoffset + 11), y-4, ping, 0);
HU_drawPlayerPing(x + ((i < 8) ? -17 : rightoffset + 11), y-4, pnum, 0);
}
STRBUFCPY(strtime, tab[i].name);
+2 -7
View File
@@ -515,18 +515,13 @@ void SCR_DisplayTicRate(void)
void SCR_DisplayLocalPing(void)
{
UINT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P
UINT32 ping = playerpingtable[consoleplayer];
INT32 pingflags = V_LocalTransFlag()|V_SNAPTOBOTTOM|V_SNAPTORIGHT;
if (cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level
{
INT32 dispy = (cv_ticrate.value == 1) ? 165 : ((cv_ticrate.value == 2 || cv_ticrate.value == 4) ? 172 : ((cv_ticrate.value == 3) ? 163 : 181)); // absolute buttpain
if (ping <= (tic_t)cv_mindelay.value)
{
ping = cv_mindelay.value;
}
HU_drawPing(308, dispy, ping, pingflags);
HU_drawPlayerPing(308, dispy, consoleplayer, pingflags); // consoleplayer's ping is everyone's ping in a splitnetgame :P
}
}
+1 -3
View File
@@ -1480,9 +1480,7 @@ void I_FinishUpdate(void)
if (cv_ticrate.value)
SCR_DisplayTicRate();
if (cv_showping.value && netgame && consoleplayer != serverplayer)
SCR_DisplayLocalPing();
if (cv_showping.value && cv_mindelay.value && consoleplayer == serverplayer && Playing())
if (cv_showping.value && ((netgame && consoleplayer != serverplayer) || (cv_mindelay.value && consoleplayer == serverplayer && Playing())))
SCR_DisplayLocalPing();
}