From 06d5c1ce5078b59623ded23bddc1e72bcece27dc Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 31 Dec 2023 10:43:01 -0800 Subject: [PATCH] Menus/Gameplay Options: hide Encore mode if not unlocked --- src/menus/options-gameplay-1.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/menus/options-gameplay-1.c b/src/menus/options-gameplay-1.c index 5dee8e2ff..e6fb71750 100644 --- a/src/menus/options-gameplay-1.c +++ b/src/menus/options-gameplay-1.c @@ -2,6 +2,7 @@ /// \brief Gameplay Options -- see gopt_e #include "../k_menu.h" +#include "../m_cond.h" 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 = { sizeof (OPTIONS_Gameplay) / sizeof (menuitem_t), &OPTIONS_MainDef, @@ -59,7 +65,7 @@ menu_t OPTIONS_GameplayDef = { M_DrawGenericOptions, M_DrawOptionsCogs, M_OptionsTick, - NULL, + init_routine, NULL, NULL, };