From 4001c933c42e1ae0df5dcee0361ba384b573ac17 Mon Sep 17 00:00:00 2001 From: BarrelsOFun <161785144+BarrelsOFun@users.noreply.github.com> Date: Sat, 13 Jul 2024 20:43:38 -0700 Subject: [PATCH] Adds 'hidden' SOC value for Unlockables to absolutely hide unlockable from checklist --- src/deh_soc.c | 2 ++ src/m_cond.h | 1 + src/m_menu.c | 14 +++++++------- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/deh_soc.c b/src/deh_soc.c index 3759cc9c7..44e091811 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -3223,6 +3223,8 @@ void readunlockable(MYFILE *f, INT32 num) unlockables[num].nocecho = (UINT8)(i || word2[0] == 'T' || word2[0] == 'Y'); else if (fastcmp(word, "NOCHECKLIST")) unlockables[num].nochecklist = (UINT8)(i || word2[0] == 'T' || word2[0] == 'Y'); + else if (fastcmp(word, "HIDDEN")) + unlockables[num].hidden = (UINT8)(i || word2[0] == 'T' || word2[0] == 'Y'); else if (fastcmp(word, "TYPE")) { if (fastcmp(word2, "NONE")) diff --git a/src/m_cond.h b/src/m_cond.h index 2491a384c..448fbddf7 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -120,6 +120,7 @@ typedef struct char *stringVar; UINT8 nocecho; UINT8 nochecklist; + UINT8 hidden; // Completely hide unlockable from the checklist whether or not it's unlocked. } unlockable_t; #define SECRET_NONE -6 // Does nil. Use with levels locked by UnlockRequired diff --git a/src/m_menu.c b/src/m_menu.c index 301c40075..94370ea2e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7284,8 +7284,8 @@ static void M_HandleChecklist(INT32 choice) { if (!unlockables[j].name[0]) continue; - // if (unlockables[j].nochecklist) - // continue; + if (unlockables[j].hidden) + continue; if (!unlockables[j].conditionset) continue; if (unlockables[j].conditionset > MAXCONDITIONSETS) @@ -7309,8 +7309,8 @@ static void M_HandleChecklist(INT32 choice) { if (!unlockables[j].name[0]) continue; - // if (unlockables[j].nochecklist) - // continue; + if (unlockables[j].hidden) + continue; if (!unlockables[j].conditionset) continue; if (unlockables[j].conditionset > MAXCONDITIONSETS) @@ -7363,7 +7363,7 @@ static void M_DrawChecklist(void) while (i < MAXUNLOCKABLES) { - if (unlockables[i].name[0] == 0 //|| unlockables[i].nochecklist + if (unlockables[i].name[0] == 0 || unlockables[i].hidden || !unlockables[i].conditionset || unlockables[i].conditionset > MAXCONDITIONSETS || (!data->unlocked[i] && unlockables[i].showconditionset && !M_Achieved(unlockables[i].showconditionset, data))) { @@ -7375,11 +7375,11 @@ static void M_DrawChecklist(void) for (j = i+1; j < MAXUNLOCKABLES; j++) { - if (!(unlockables[j].name[0] == 0 //|| unlockables[j].nochecklist + if (!(unlockables[j].name[0] == 0 || unlockables[j].hidden || !unlockables[j].conditionset || unlockables[j].conditionset > MAXCONDITIONSETS)) break; } - if ((j != MAXUNLOCKABLES) && (unlockables[i].conditionset == unlockables[j].conditionset)) + if ((j != MAXUNLOCKABLES) && (unlockables[i].conditionset == unlockables[j].conditionset) && !unlockables[j].hidden) addy(8) else {