Adds 'hidden' SOC value for Unlockables to absolutely hide unlockable from checklist

This commit is contained in:
BarrelsOFun 2024-07-13 20:43:38 -07:00
parent 8824ce8787
commit 4001c933c4
3 changed files with 10 additions and 7 deletions

View file

@ -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"))

View file

@ -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

View file

@ -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
{