From ae21a8266d2a15e859ca0f5ef50d3b98f0fe4bf6 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 28 Aug 2025 14:03:39 +0100 Subject: [PATCH] Disable Demo title entry inputs in GS_LEVEL freecam Also disables input when Director is enabled --- src/g_demo.cpp | 17 ++++++++++++++++- src/st_stuff.c | 28 ++++++++++++++++++++++------ 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/g_demo.cpp b/src/g_demo.cpp index 0098c58b2..4001d8906 100644 --- a/src/g_demo.cpp +++ b/src/g_demo.cpp @@ -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 and + if (gamestate == GS_LEVEL && camera[0].freecam) return false; + if (!G_PlayerInputDown(0, gc_b, 0)) + { + // Input conflict for + 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, diff --git a/src/st_stuff.c b/src/st_stuff.c index 5263c71d8..128ff58b9 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -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. Change title" : " or Save replay", - 2, TINY_FONT, flags|V_YELLOWMAP - ); + const char *text; + if (gamestate == GS_LEVEL && camera[0].freecam) + { + text = va( + " Disable Freecam to %s replay", + (demo.willsave && demo.titlename[0]) + ? "rename" + : "save" + ); + } + else if (demo.willsave && demo.titlename[0]) + text = "Replay will be saved. Change title"; + else if (gamestate == GS_LEVEL + && playeringame[consoleplayer] + && players[consoleplayer].spectator + && K_DirectorIsEnabled(0)) + text = " Save replay"; + else + text = " or Save replay"; + + K_DrawGameControl(BASEVIDWIDTH - 2, 2, 0, text, 2, TINY_FONT, flags|V_YELLOWMAP); } static fixed_t ST_CalculateFadeIn(player_t *player)