mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 12:40:58 +00:00
Merge branch 'showconditionset' into 'next'
Showconditionset See merge request STJr/SRB2!651
This commit is contained in:
commit
407b00b22b
3 changed files with 25 additions and 10 deletions
|
@ -3430,6 +3430,8 @@ static void readextraemblemdata(MYFILE *f, INT32 num)
|
|||
sizeof (extraemblems[num-1].description), va("Extra emblem %d: objective", num));
|
||||
else if (fastcmp(word, "CONDITIONSET"))
|
||||
extraemblems[num-1].conditionset = (UINT8)value;
|
||||
else if (fastcmp(word, "SHOWCONDITIONSET"))
|
||||
extraemblems[num-1].showconditionset = (UINT8)value;
|
||||
else
|
||||
{
|
||||
strupr(word2);
|
||||
|
@ -3516,6 +3518,8 @@ static void readunlockable(MYFILE *f, INT32 num)
|
|||
unlockables[num].height = (UINT16)i;
|
||||
else if (fastcmp(word, "CONDITIONSET"))
|
||||
unlockables[num].conditionset = (UINT8)i;
|
||||
else if (fastcmp(word, "SHOWCONDITIONSET"))
|
||||
unlockables[num].showconditionset = (UINT8)i;
|
||||
else if (fastcmp(word, "NOCECHO"))
|
||||
unlockables[num].nocecho = (UINT8)(i || word2[0] == 'T' || word2[0] == 'Y');
|
||||
else if (fastcmp(word, "NOCHECKLIST"))
|
||||
|
|
14
src/m_cond.h
14
src/m_cond.h
|
@ -97,12 +97,13 @@ typedef struct
|
|||
} emblem_t;
|
||||
typedef struct
|
||||
{
|
||||
char name[20]; ///< Name of the goal (used in the "emblem awarded" cecho)
|
||||
char description[40];///< Description of goal (used in statistics)
|
||||
UINT8 conditionset; ///< Condition set that awards this emblem.
|
||||
UINT8 sprite; ///< emblem sprite to use, 0 - 25
|
||||
UINT8 color; ///< skincolor to use
|
||||
UINT8 collected; ///< Do you have this emblem?
|
||||
char name[20]; ///< Name of the goal (used in the "emblem awarded" cecho)
|
||||
char description[40]; ///< Description of goal (used in statistics)
|
||||
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 color; ///< skincolor to use
|
||||
UINT8 collected; ///< Do you have this emblem?
|
||||
} extraemblem_t;
|
||||
|
||||
// Unlockable information
|
||||
|
@ -112,6 +113,7 @@ typedef struct
|
|||
char objective[64];
|
||||
UINT16 height; // menu height
|
||||
UINT8 conditionset;
|
||||
UINT8 showconditionset;
|
||||
INT16 type;
|
||||
INT16 variable;
|
||||
UINT8 nocecho;
|
||||
|
|
17
src/m_menu.c
17
src/m_menu.c
|
@ -6897,6 +6897,8 @@ static void M_HandleChecklist(INT32 choice)
|
|||
continue;
|
||||
if (unlockables[j].conditionset > MAXCONDITIONSETS)
|
||||
continue;
|
||||
if (!unlockables[j].unlocked && unlockables[j].showconditionset && !M_Achieved(unlockables[j].showconditionset))
|
||||
continue;
|
||||
if (unlockables[j].conditionset == unlockables[check_on].conditionset)
|
||||
continue;
|
||||
break;
|
||||
|
@ -6920,6 +6922,8 @@ static void M_HandleChecklist(INT32 choice)
|
|||
continue;
|
||||
if (unlockables[j].conditionset > MAXCONDITIONSETS)
|
||||
continue;
|
||||
if (!unlockables[j].unlocked && unlockables[j].showconditionset && !M_Achieved(unlockables[j].showconditionset))
|
||||
continue;
|
||||
if (j && unlockables[j].conditionset == unlockables[j-1].conditionset)
|
||||
continue;
|
||||
break;
|
||||
|
@ -6957,7 +6961,8 @@ static void M_DrawChecklist(void)
|
|||
while (i < MAXUNLOCKABLES)
|
||||
{
|
||||
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;
|
||||
continue;
|
||||
|
@ -6983,10 +6988,11 @@ static void M_DrawChecklist(void)
|
|||
|
||||
if (unlockables[i].objective[0] != '/')
|
||||
{
|
||||
addy(8);
|
||||
V_DrawString(currentMenu->x, y,
|
||||
addy(16);
|
||||
V_DrawString(currentMenu->x, y-8,
|
||||
V_ALLOWLOWERCASE,
|
||||
va("\x1E %s", unlockables[i].objective));
|
||||
y -= 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -9218,7 +9224,10 @@ static void M_DrawStatsMaps(int location)
|
|||
else
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue