mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Custom Icon support for unlockable_t
This commit is contained in:
parent
6671e181b0
commit
017871eaad
3 changed files with 26 additions and 0 deletions
|
|
@ -156,6 +156,9 @@ void clear_unlockables(void)
|
|||
{
|
||||
Z_Free(unlockables[i].stringVar);
|
||||
unlockables[i].stringVar = NULL;
|
||||
|
||||
Z_Free(unlockables[i].icon);
|
||||
unlockables[i].icon = NULL;
|
||||
}
|
||||
|
||||
memset(&unlockables, 0, sizeof(unlockables));
|
||||
|
|
@ -2379,6 +2382,11 @@ void readunlockable(MYFILE *f, INT32 num)
|
|||
unlockables[num].stringVar = Z_StrDup(word2);
|
||||
unlockables[num].variable = (INT16)i;
|
||||
}
|
||||
else if (fastcmp(word, "ICON"))
|
||||
{
|
||||
Z_Free(unlockables[num].icon);
|
||||
unlockables[num].icon = Z_StrDup(word2);
|
||||
}
|
||||
else
|
||||
deh_warning("Unlockable %d: unknown word '%s'", num+1, word);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4517,6 +4517,23 @@ void M_DrawChallenges(void)
|
|||
goto drawborder;
|
||||
}
|
||||
|
||||
if (ref->icon != NULL)
|
||||
{
|
||||
patch_t *pat = W_CachePatchName(ref->icon, PU_CACHE);
|
||||
fixed_t siz = (SHORT(pat->width) << FRACBITS);
|
||||
|
||||
siz = FixedDiv(((ref->majorunlock) ? 32 : 16) << FRACBITS, siz);
|
||||
|
||||
V_DrawFixedPatch(
|
||||
x*FRACUNIT, y*FRACUNIT,
|
||||
siz,
|
||||
0, pat,
|
||||
NULL
|
||||
);
|
||||
|
||||
goto drawborder;
|
||||
}
|
||||
|
||||
switch (ref->type)
|
||||
{
|
||||
case SECRET_SKIN:
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ typedef struct
|
|||
{
|
||||
char name[64];
|
||||
char objective[64];
|
||||
char *icon;
|
||||
UINT8 conditionset;
|
||||
INT16 type;
|
||||
INT16 variable;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue