feat: show modern-gameplay guard states in the debug menu (issue #36)
linux / build (push) Canceled after 4m42s
linux / build (push) Canceled after 4m42s
This commit is contained in:
@@ -915,6 +915,29 @@ DebugMenuPopulate(void)
|
||||
DebugMenuAddCmd("Cheats", "Strong grip", StrongGripCheat);
|
||||
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;
|
||||
e = DebugMenuAddVar("Spawn", "Spawn Car ID", &spawnCarId, nil, 1, MI_LANDSTAL, MI_GHOST, carnames);
|
||||
DebugMenuEntrySetWrap(e, true);
|
||||
|
||||
@@ -201,4 +201,12 @@ inline DebugMenuEntry *DebugMenuAddVarBool8(const char *path, const char *name,
|
||||
{
|
||||
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
|
||||
Reference in New Issue
Block a user