Merge branch 'hidden_unlocks' into 'next'

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

See merge request STJr/SRB2!2500
This commit is contained in:
Barrels O'Fun 2025-03-21 23:51:54 +00:00
commit a64b1afdea
3 changed files with 10 additions and 7 deletions

View file

@ -3260,6 +3260,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

@ -7053,8 +7053,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)
@ -7078,8 +7078,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)
@ -7132,7 +7132,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)))
{
@ -7144,11 +7144,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
{