Merge branch 'showconditionset' into 'next'

Showconditionset

See merge request STJr/SRB2!651
This commit is contained in:
James R 2020-01-10 15:59:37 -05:00
commit 407b00b22b
3 changed files with 25 additions and 10 deletions

View file

@ -3430,6 +3430,8 @@ static void readextraemblemdata(MYFILE *f, INT32 num)
sizeof (extraemblems[num-1].description), va("Extra emblem %d: objective", num)); sizeof (extraemblems[num-1].description), va("Extra emblem %d: objective", num));
else if (fastcmp(word, "CONDITIONSET")) else if (fastcmp(word, "CONDITIONSET"))
extraemblems[num-1].conditionset = (UINT8)value; extraemblems[num-1].conditionset = (UINT8)value;
else if (fastcmp(word, "SHOWCONDITIONSET"))
extraemblems[num-1].showconditionset = (UINT8)value;
else else
{ {
strupr(word2); strupr(word2);
@ -3516,6 +3518,8 @@ static void readunlockable(MYFILE *f, INT32 num)
unlockables[num].height = (UINT16)i; unlockables[num].height = (UINT16)i;
else if (fastcmp(word, "CONDITIONSET")) else if (fastcmp(word, "CONDITIONSET"))
unlockables[num].conditionset = (UINT8)i; unlockables[num].conditionset = (UINT8)i;
else if (fastcmp(word, "SHOWCONDITIONSET"))
unlockables[num].showconditionset = (UINT8)i;
else if (fastcmp(word, "NOCECHO")) else if (fastcmp(word, "NOCECHO"))
unlockables[num].nocecho = (UINT8)(i || word2[0] == 'T' || word2[0] == 'Y'); unlockables[num].nocecho = (UINT8)(i || word2[0] == 'T' || word2[0] == 'Y');
else if (fastcmp(word, "NOCHECKLIST")) else if (fastcmp(word, "NOCHECKLIST"))

View file

@ -100,6 +100,7 @@ typedef struct
char name[20]; ///< Name of the goal (used in the "emblem awarded" cecho) char name[20]; ///< Name of the goal (used in the "emblem awarded" cecho)
char description[40]; ///< Description of goal (used in statistics) char description[40]; ///< Description of goal (used in statistics)
UINT8 conditionset; ///< Condition set that awards this emblem. UINT8 conditionset; ///< Condition set that awards this emblem.
UINT8 showconditionset; ///< Condition set that shows this emblem.
UINT8 sprite; ///< emblem sprite to use, 0 - 25 UINT8 sprite; ///< emblem sprite to use, 0 - 25
UINT8 color; ///< skincolor to use UINT8 color; ///< skincolor to use
UINT8 collected; ///< Do you have this emblem? UINT8 collected; ///< Do you have this emblem?
@ -112,6 +113,7 @@ typedef struct
char objective[64]; char objective[64];
UINT16 height; // menu height UINT16 height; // menu height
UINT8 conditionset; UINT8 conditionset;
UINT8 showconditionset;
INT16 type; INT16 type;
INT16 variable; INT16 variable;
UINT8 nocecho; UINT8 nocecho;

View file

@ -6897,6 +6897,8 @@ static void M_HandleChecklist(INT32 choice)
continue; continue;
if (unlockables[j].conditionset > MAXCONDITIONSETS) if (unlockables[j].conditionset > MAXCONDITIONSETS)
continue; continue;
if (!unlockables[j].unlocked && unlockables[j].showconditionset && !M_Achieved(unlockables[j].showconditionset))
continue;
if (unlockables[j].conditionset == unlockables[check_on].conditionset) if (unlockables[j].conditionset == unlockables[check_on].conditionset)
continue; continue;
break; break;
@ -6920,6 +6922,8 @@ static void M_HandleChecklist(INT32 choice)
continue; continue;
if (unlockables[j].conditionset > MAXCONDITIONSETS) if (unlockables[j].conditionset > MAXCONDITIONSETS)
continue; continue;
if (!unlockables[j].unlocked && unlockables[j].showconditionset && !M_Achieved(unlockables[j].showconditionset))
continue;
if (j && unlockables[j].conditionset == unlockables[j-1].conditionset) if (j && unlockables[j].conditionset == unlockables[j-1].conditionset)
continue; continue;
break; break;
@ -6957,7 +6961,8 @@ static void M_DrawChecklist(void)
while (i < MAXUNLOCKABLES) while (i < MAXUNLOCKABLES)
{ {
if (unlockables[i].name[0] == 0 //|| unlockables[i].nochecklist if (unlockables[i].name[0] == 0 //|| unlockables[i].nochecklist
|| !unlockables[i].conditionset || unlockables[i].conditionset > MAXCONDITIONSETS) || !unlockables[i].conditionset || unlockables[i].conditionset > MAXCONDITIONSETS
|| (!unlockables[i].unlocked && unlockables[i].showconditionset && !M_Achieved(unlockables[i].showconditionset)))
{ {
i += 1; i += 1;
continue; continue;
@ -6983,10 +6988,11 @@ static void M_DrawChecklist(void)
if (unlockables[i].objective[0] != '/') if (unlockables[i].objective[0] != '/')
{ {
addy(8); addy(16);
V_DrawString(currentMenu->x, y, V_DrawString(currentMenu->x, y-8,
V_ALLOWLOWERCASE, V_ALLOWLOWERCASE,
va("\x1E %s", unlockables[i].objective)); va("\x1E %s", unlockables[i].objective));
y -= 8;
} }
else else
{ {
@ -9218,7 +9224,10 @@ static void M_DrawStatsMaps(int location)
else else
V_DrawSmallScaledPatch(292, y, 0, W_CachePatchName("NEEDIT", PU_PATCH)); V_DrawSmallScaledPatch(292, y, 0, W_CachePatchName("NEEDIT", PU_PATCH));
V_DrawString(20, y, V_YELLOWMAP|V_ALLOWLOWERCASE, va("%s", exemblem->description)); V_DrawString(20, y, V_YELLOWMAP|V_ALLOWLOWERCASE,
(!exemblem->collected && exemblem->showconditionset && !M_Achieved(exemblem->showconditionset))
? M_CreateSecretMenuOption(exemblem->description)
: exemblem->description);
} }
y += 8; y += 8;