feat: show modern-gameplay guard states in the debug menu (issue #36)
linux / build (push) Canceled after 4m42s

This commit is contained in:
2026-11-30 16:55:05 +00:00
parent 37f152047f
commit a36d08a09c
2 changed files with 31 additions and 0 deletions
+23
View File
@@ -915,6 +915,29 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Cheats", "Strong grip", StrongGripCheat); DebugMenuAddCmd("Cheats", "Strong grip", StrongGripCheat);
DebugMenuAddCmd("Cheats", "Nasty limbs", NastyLimbsCheat); DebugMenuAddCmd("Cheats", "Nasty limbs", NastyLimbsCheat);
// Compile-time modern gameplay guards, shown for reference only
static bool bModernGameplay =
#ifdef MODERN_GAMEPLAY
true;
#else
false;
#endif
DebugMenuAddVarBool8ReadOnly("Gameplay", "Modern gameplay", &bModernGameplay);
static bool bSecuricarHeat =
#ifdef MODERN_GAMEPLAY_SECURICAR_HEAT
true;
#else
false;
#endif
DebugMenuAddVarBool8ReadOnly("Gameplay", "Securicar theft heat", &bSecuricarHeat);
static bool bThirdPersonRifle =
#ifdef MODERN_GAMEPLAY_THIRD_PERSON_RIFLE
true;
#else
false;
#endif
DebugMenuAddVarBool8ReadOnly("Gameplay", "Third-person rifle", &bThirdPersonRifle);
static int spawnCarId = MI_LANDSTAL; static int spawnCarId = MI_LANDSTAL;
e = DebugMenuAddVar("Spawn", "Spawn Car ID", &spawnCarId, nil, 1, MI_LANDSTAL, MI_GHOST, carnames); e = DebugMenuAddVar("Spawn", "Spawn Car ID", &spawnCarId, nil, 1, MI_LANDSTAL, MI_GHOST, carnames);
DebugMenuEntrySetWrap(e, true); DebugMenuEntrySetWrap(e, true);
+8
View File
@@ -201,4 +201,12 @@ inline DebugMenuEntry *DebugMenuAddVarBool8(const char *path, const char *name,
{ {
return DebugMenuAddVarBool8(path, name, (int8_t*)ptr, triggerFunc); return DebugMenuAddVarBool8(path, name, (int8_t*)ptr, triggerFunc);
} }
// For compile-time flags: shows the value but clamps it, so it can't be changed
inline DebugMenuEntry *DebugMenuAddVarBool8ReadOnly(const char *path, const char *name, bool *ptr)
{
static const char *onstr[] = { "On", "On" };
static const char *offstr[] = { "Off", "Off" };
int8_t val = *ptr ? 1 : 0;
return DebugMenuAddVar(path, name, (int8_t*)ptr, NULL, 1, val, val, val ? onstr : offstr);
}
#endif #endif