Disable Demo title entry inputs in GS_LEVEL freecam

Also disables <x> input when Director is enabled
This commit is contained in:
toaster 2025-08-28 14:03:39 +01:00
parent 57c5fa3cd7
commit ae21a8266d
2 changed files with 38 additions and 7 deletions

View file

@ -49,6 +49,7 @@
#include "md5.h" // demo checksums
#include "p_saveg.h" // savebuffer_t
#include "g_party.h"
#include "k_director.h" // K_DirectorIsEnabled
#include "core/json.hpp"
// SRB2Kart
@ -4315,9 +4316,23 @@ boolean G_CheckDemoTitleEntry(void)
if (menuactive || chat_on)
return false;
if (!G_PlayerInputDown(0, gc_b, 0) && !G_PlayerInputDown(0, gc_x, 0))
// Input conflict for both <b> and <x>
if (gamestate == GS_LEVEL && camera[0].freecam)
return false;
if (!G_PlayerInputDown(0, gc_b, 0))
{
// Input conflict for <x>
if (gamestate == GS_LEVEL
&& playeringame[consoleplayer]
&& players[consoleplayer].spectator
&& K_DirectorIsEnabled(0))
return false;
if (!G_PlayerInputDown(0, gc_x, 0))
return false;
}
demo.willsave = true;
M_OpenVirtualKeyboard(
sizeof demo.titlename,

View file

@ -34,7 +34,7 @@
#include "p_setup.h" // NiGHTS grading
#include "r_fps.h"
#include "m_random.h" // random index
#include "m_cond.h" // item finder
#include "k_director.h" // K_DirectorIsEnabled
#ifdef HWRENDER
#include "hardware/hw_main.h"
@ -1498,11 +1498,27 @@ void ST_DrawServerSplash(boolean timelimited)
void ST_DrawSaveReplayHint(INT32 flags)
{
K_DrawGameControl(
BASEVIDWIDTH - 2, 2, 0,
(demo.willsave && demo.titlename[0]) ? "Replay will be saved. <b> Change title" : "<b> or <x> Save replay",
2, TINY_FONT, flags|V_YELLOWMAP
);
const char *text;
if (gamestate == GS_LEVEL && camera[0].freecam)
{
text = va(
"<c> Disable Freecam to <b_pressed> %s replay",
(demo.willsave && demo.titlename[0])
? "rename"
: "save"
);
}
else if (demo.willsave && demo.titlename[0])
text = "Replay will be saved. <b> Change title";
else if (gamestate == GS_LEVEL
&& playeringame[consoleplayer]
&& players[consoleplayer].spectator
&& K_DirectorIsEnabled(0))
text = "<b> Save replay";
else
text = "<b> or <x> Save replay";
K_DrawGameControl(BASEVIDWIDTH - 2, 2, 0, text, 2, TINY_FONT, flags|V_YELLOWMAP);
}
static fixed_t ST_CalculateFadeIn(player_t *player)