mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'director-bugs' into 'master'
Director spectator bugfixes See merge request KartKrew/Kart!993
This commit is contained in:
commit
2e55d35ead
3 changed files with 69 additions and 16 deletions
|
|
@ -1179,10 +1179,19 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||||
K_ToggleDirector(false);
|
K_ToggleDirector(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player->spectator == true)
|
||||||
|
{
|
||||||
|
// duplication of fire
|
||||||
|
if (G_PlayerInputDown(forplayer, gc_item, 0))
|
||||||
|
{
|
||||||
|
cmd->buttons |= BT_ATTACK;
|
||||||
|
}
|
||||||
|
|
||||||
if (M_MenuButtonPressed(forplayer, MBT_R))
|
if (M_MenuButtonPressed(forplayer, MBT_R))
|
||||||
{
|
{
|
||||||
K_ToggleDirector(true);
|
K_ToggleDirector(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
goto aftercmdinput;
|
goto aftercmdinput;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,16 +110,16 @@ static boolean K_CanSwitchDirector(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!directorinfo.active)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void K_DirectorSwitch(INT32 player, boolean force)
|
static void K_DirectorSwitch(INT32 player, boolean force)
|
||||||
{
|
{
|
||||||
|
if (!directorinfo.active)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (P_IsDisplayPlayer(&players[player]))
|
if (P_IsDisplayPlayer(&players[player]))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
62
src/k_hud.c
62
src/k_hud.c
|
|
@ -4639,16 +4639,26 @@ K_drawMiniPing (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void K_DrawDirectorButton(INT32 idx, const char *label, patch_t *kp[2])
|
static void K_DrawDirectorButton(INT32 idx, const char *label, patch_t *kp[2], INT32 textflags)
|
||||||
{
|
{
|
||||||
const INT32 flags = V_SNAPTORIGHT | V_SLIDEIN;
|
INT32 flags = V_SNAPTORIGHT | V_SLIDEIN | V_SPLITSCREEN;
|
||||||
const INT32 textflags = flags | V_6WIDTHSPACE | V_ALLOWLOWERCASE;
|
|
||||||
|
|
||||||
const UINT8 anim_duration = 16;
|
const UINT8 anim_duration = 16;
|
||||||
const UINT8 anim = (leveltime % (anim_duration * 2)) < anim_duration;
|
const UINT8 anim = (leveltime % (anim_duration * 2)) < anim_duration;
|
||||||
|
|
||||||
const INT32 x = BASEVIDWIDTH - 60;
|
INT32 x = (BASEVIDWIDTH/2) - 10;
|
||||||
const INT32 y = BASEVIDHEIGHT - 70 + (idx * 16);
|
INT32 y = (idx * 16);
|
||||||
|
|
||||||
|
if (r_splitscreen <= 1)
|
||||||
|
{
|
||||||
|
x = BASEVIDWIDTH - 60;
|
||||||
|
if (r_splitscreen == 0)
|
||||||
|
{
|
||||||
|
y += BASEVIDHEIGHT - 78;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
textflags |= (flags | V_6WIDTHSPACE | V_ALLOWLOWERCASE);
|
||||||
|
|
||||||
V_DrawScaledPatch(x, y - 4, flags, kp[anim]);
|
V_DrawScaledPatch(x, y - 4, flags, kp[anim]);
|
||||||
V_DrawRightAlignedThinString(x - 2, y, textflags, label);
|
V_DrawRightAlignedThinString(x - 2, y, textflags, label);
|
||||||
|
|
@ -4656,14 +4666,48 @@ static void K_DrawDirectorButton(INT32 idx, const char *label, patch_t *kp[2])
|
||||||
|
|
||||||
static void K_drawDirectorHUD(void)
|
static void K_drawDirectorHUD(void)
|
||||||
{
|
{
|
||||||
|
const INT32 p = (splitscreen_partied[consoleplayer] ? splitscreen_party[consoleplayer] : g_localplayers)[R_GetViewNumber()];
|
||||||
|
const char *itemtxt = "Join";
|
||||||
|
UINT8 offs = 0;
|
||||||
|
|
||||||
|
UINT8 numingame = 0;
|
||||||
|
UINT8 i;
|
||||||
|
|
||||||
if (!LUA_HudEnabled(hud_textspectator))
|
if (!LUA_HudEnabled(hud_textspectator))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
K_DrawDirectorButton(0, "Next Player", kp_button_a[0]);
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
K_DrawDirectorButton(1, "Prev Player", kp_button_x[0]);
|
if (playeringame[i] && !players[i].spectator)
|
||||||
K_DrawDirectorButton(2, "Director", kp_button_r);
|
numingame++;
|
||||||
|
|
||||||
|
if (numingame > 1 && r_splitscreen == 0) // simplifies things a lot
|
||||||
|
{
|
||||||
|
K_DrawDirectorButton(1, "Next Player", kp_button_a[0], 0);
|
||||||
|
K_DrawDirectorButton(2, "Prev Player", kp_button_x[0], 0);
|
||||||
|
offs = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p == -1 || !playeringame[p] || players[p].spectator == false)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
K_DrawDirectorButton(offs + 1, "Director", kp_button_r,
|
||||||
|
(directorinfo.active ? V_YELLOWMAP : 0));
|
||||||
|
|
||||||
|
if (players[p].flashing)
|
||||||
|
itemtxt = ". . .";
|
||||||
|
else if (players[p].pflags & PF_WANTSTOJOIN)
|
||||||
|
itemtxt = "Cancel Join";
|
||||||
|
|
||||||
|
if (cv_maxplayers.value)
|
||||||
|
{
|
||||||
|
itemtxt = va("%s [%d/%d]", itemtxt, numingame, cv_maxplayers.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
K_DrawDirectorButton(0, itemtxt, kp_button_l, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void K_drawDistributionDebugger(void)
|
static void K_drawDistributionDebugger(void)
|
||||||
|
|
@ -4984,7 +5028,7 @@ void K_drawKartHUD(void)
|
||||||
K_drawMiniPing();
|
K_drawMiniPing();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayplayers[viewnum] != g_localplayers[viewnum])
|
if (displayplayers[viewnum] != g_localplayers[viewnum] && !demo.playback)
|
||||||
{
|
{
|
||||||
K_drawDirectorHUD();
|
K_drawDirectorHUD();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue