Menus/Gameplay Options: hide Encore mode if not unlocked

This commit is contained in:
James R 2023-12-31 10:43:01 -08:00
parent 91bb575d60
commit 06d5c1ce50

View file

@ -2,6 +2,7 @@
/// \brief Gameplay Options -- see gopt_e /// \brief Gameplay Options -- see gopt_e
#include "../k_menu.h" #include "../k_menu.h"
#include "../m_cond.h"
menuitem_t OPTIONS_Gameplay[] = menuitem_t OPTIONS_Gameplay[] =
{ {
@ -46,6 +47,11 @@ menuitem_t OPTIONS_Gameplay[] =
}; };
static void init_routine(void)
{
OPTIONS_Gameplay[gopt_encore].status = M_SecretUnlocked(SECRET_ENCORE, true) ? IT_STRING | IT_CVAR : IT_DISABLED;
}
menu_t OPTIONS_GameplayDef = { menu_t OPTIONS_GameplayDef = {
sizeof (OPTIONS_Gameplay) / sizeof (menuitem_t), sizeof (OPTIONS_Gameplay) / sizeof (menuitem_t),
&OPTIONS_MainDef, &OPTIONS_MainDef,
@ -59,7 +65,7 @@ menu_t OPTIONS_GameplayDef = {
M_DrawGenericOptions, M_DrawGenericOptions,
M_DrawOptionsCogs, M_DrawOptionsCogs,
M_OptionsTick, M_OptionsTick,
NULL, init_routine,
NULL, NULL,
NULL, NULL,
}; };