mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add spectator HUD for A, X, R buttons
Old spectator HUD is preserved for empty game, "flying around" mode.
This commit is contained in:
parent
898cac9515
commit
5f1e64d6d9
2 changed files with 35 additions and 1 deletions
32
src/k_hud.c
32
src/k_hud.c
|
|
@ -4639,6 +4639,33 @@ K_drawMiniPing (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void K_DrawDirectorButton(INT32 idx, const char *label, patch_t *kp[2])
|
||||||
|
{
|
||||||
|
const INT32 flags = V_SNAPTORIGHT | V_SLIDEIN;
|
||||||
|
const INT32 textflags = flags | V_6WIDTHSPACE | V_ALLOWLOWERCASE;
|
||||||
|
|
||||||
|
const UINT8 anim_duration = 16;
|
||||||
|
const UINT8 anim = (leveltime % (anim_duration * 2)) < anim_duration;
|
||||||
|
|
||||||
|
const INT32 x = BASEVIDWIDTH - 60;
|
||||||
|
const INT32 y = BASEVIDHEIGHT - 70 + (idx * 16);
|
||||||
|
|
||||||
|
V_DrawScaledPatch(x, y - 4, flags, kp[anim]);
|
||||||
|
V_DrawRightAlignedThinString(x - 2, y, textflags, label);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void K_drawDirectorHUD(void)
|
||||||
|
{
|
||||||
|
if (!LUA_HudEnabled(hud_textspectator))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
K_DrawDirectorButton(0, "Next Player", kp_button_a[0]);
|
||||||
|
K_DrawDirectorButton(1, "Prev Player", kp_button_x[0]);
|
||||||
|
K_DrawDirectorButton(2, "Director", kp_button_r);
|
||||||
|
}
|
||||||
|
|
||||||
static void K_drawDistributionDebugger(void)
|
static void K_drawDistributionDebugger(void)
|
||||||
{
|
{
|
||||||
itemroulette_t rouletteData = {0};
|
itemroulette_t rouletteData = {0};
|
||||||
|
|
@ -4957,6 +4984,11 @@ void K_drawKartHUD(void)
|
||||||
K_drawMiniPing();
|
K_drawMiniPing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (displayplayers[viewnum] != g_localplayers[viewnum])
|
||||||
|
{
|
||||||
|
K_drawDirectorHUD();
|
||||||
|
}
|
||||||
|
|
||||||
if (cv_kartdebugdistribution.value)
|
if (cv_kartdebugdistribution.value)
|
||||||
K_drawDistributionDebugger();
|
K_drawDistributionDebugger();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1095,6 +1095,8 @@ void ST_preLevelTitleCardDrawer(void)
|
||||||
//
|
//
|
||||||
static void ST_overlayDrawer(void)
|
static void ST_overlayDrawer(void)
|
||||||
{
|
{
|
||||||
|
const UINT8 viewnum = R_GetViewNumber();
|
||||||
|
|
||||||
// hu_showscores = auto hide score/time/rings when tab rankings are shown
|
// hu_showscores = auto hide score/time/rings when tab rankings are shown
|
||||||
if (!(hu_showscores && (netgame || multiplayer)))
|
if (!(hu_showscores && (netgame || multiplayer)))
|
||||||
{
|
{
|
||||||
|
|
@ -1135,7 +1137,7 @@ static void ST_overlayDrawer(void)
|
||||||
|
|
||||||
if (!hu_showscores && netgame && !mapreset)
|
if (!hu_showscores && netgame && !mapreset)
|
||||||
{
|
{
|
||||||
if (stplyr->spectator && LUA_HudEnabled(hud_textspectator))
|
if (stplyr->spectator && displayplayers[viewnum] == g_localplayers[viewnum] && LUA_HudEnabled(hud_textspectator))
|
||||||
{
|
{
|
||||||
const char *itemtxt = M_GetText("Item - Join Game");
|
const char *itemtxt = M_GetText("Item - Join Game");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue