mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Show nametags in replays, fix in splitscreen
This commit is contained in:
parent
17b244969b
commit
3190edd666
1 changed files with 44 additions and 15 deletions
59
src/k_kart.c
59
src/k_kart.c
|
|
@ -9863,7 +9863,8 @@ static void K_ObjectTracking(fixed_t *hud_x, fixed_t *hud_y, vertex_t *campos, a
|
|||
{
|
||||
*hud_y /= 2;
|
||||
|
||||
if (camnum > 1)
|
||||
if ((r_splitscreen == 1 && camnum == 1)
|
||||
|| (r_splitscreen > 1 && camnum > 1))
|
||||
{
|
||||
*hud_y += shhalffixed;
|
||||
}
|
||||
|
|
@ -9977,6 +9978,30 @@ static void K_drawKartPlayerCheck(void)
|
|||
}
|
||||
}
|
||||
|
||||
static boolean K_ShowPlayerNametag(player_t *p)
|
||||
{
|
||||
if (demo.playback == true && demo.freecam == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (stplyr == p)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (G_RaceGametype())
|
||||
{
|
||||
if ((p->kartstuff[k_position] < stplyr->kartstuff[k_position]-2)
|
||||
|| (p->kartstuff[k_position] > stplyr->kartstuff[k_position]+2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void K_drawKartNameTags(void)
|
||||
{
|
||||
const fixed_t maxdistance = 8192*mapobjectscale;
|
||||
|
|
@ -10022,7 +10047,6 @@ static void K_drawKartNameTags(void)
|
|||
fixed_t y = -BASEVIDWIDTH * FRACUNIT;
|
||||
|
||||
vertex_t v;
|
||||
UINT8 j;
|
||||
|
||||
if (!playeringame[i] || ntplayer->spectator)
|
||||
{
|
||||
|
|
@ -10042,18 +10066,24 @@ static void K_drawKartNameTags(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; j <= r_splitscreen; j++)
|
||||
if (!(demo.playback == true && demo.freecam == true))
|
||||
{
|
||||
if (ntplayer == &players[displayplayers[j]])
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
UINT8 j;
|
||||
|
||||
if (j <= r_splitscreen)
|
||||
{
|
||||
// Is a player that's being shown on this computer
|
||||
continue;
|
||||
for (j = 0; j <= r_splitscreen; j++)
|
||||
{
|
||||
if (ntplayer == &players[displayplayers[j]])
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j <= r_splitscreen)
|
||||
{
|
||||
// This is a player that's being shown on this computer
|
||||
// (Remove whenever we get splitscreen ABCD indicators)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
v.x = ntplayer->mo->x;
|
||||
|
|
@ -10089,10 +10119,9 @@ static void K_drawKartNameTags(void)
|
|||
V_DrawFixedPatch(x, y, FRACUNIT, V_HUDTRANS, kp_rival[blink], NULL);
|
||||
}
|
||||
}
|
||||
else if (netgame)
|
||||
else if (netgame || demo.playback)
|
||||
{
|
||||
if ((ntplayer->kartstuff[k_position] >= stplyr->kartstuff[k_position]-2)
|
||||
&& (ntplayer->kartstuff[k_position] <= stplyr->kartstuff[k_position]+2))
|
||||
if (K_ShowPlayerNametag(ntplayer) == true)
|
||||
{
|
||||
INT32 namelen = V_ThinStringWidth(player_names[i], V_6WIDTHSPACE|V_ALLOWLOWERCASE);
|
||||
INT32 clr = K_SkincolorToTextColor(ntplayer->skincolor);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue