mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
M_InterruptMenuWithChallenges: Fix a rendering error where an irrelevant unlockable could be highlighted during the fade-in before jumping into position
This commit is contained in:
parent
20e9b2f5e8
commit
749de36734
1 changed files with 51 additions and 47 deletions
|
|
@ -47,51 +47,6 @@ menu_t MISC_StatisticsDef = {
|
||||||
|
|
||||||
struct challengesmenu_s challengesmenu;
|
struct challengesmenu_s challengesmenu;
|
||||||
|
|
||||||
menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
|
||||||
{
|
|
||||||
UINT8 i;
|
|
||||||
|
|
||||||
M_UpdateUnlockablesAndExtraEmblems(false);
|
|
||||||
|
|
||||||
if ((challengesmenu.pending = challengesmenu.requestnew = (M_GetNextAchievedUnlock() < MAXUNLOCKABLES)))
|
|
||||||
{
|
|
||||||
MISC_ChallengesDef.prevMenu = desiredmenu;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (challengesmenu.pending || desiredmenu == NULL)
|
|
||||||
{
|
|
||||||
challengesmenu.currentunlock = MAXUNLOCKABLES;
|
|
||||||
challengesmenu.unlockcondition = NULL;
|
|
||||||
|
|
||||||
M_PopulateChallengeGrid();
|
|
||||||
if (gamedata->challengegrid)
|
|
||||||
challengesmenu.extradata = M_ChallengeGridExtraData();
|
|
||||||
|
|
||||||
memset(setup_explosions, 0, sizeof(setup_explosions));
|
|
||||||
memset(&challengesmenu.unlockcount, 0, sizeof(challengesmenu.unlockcount));
|
|
||||||
for (i = 0; i < MAXUNLOCKABLES; i++)
|
|
||||||
{
|
|
||||||
if (!unlockables[i].conditionset)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
challengesmenu.unlockcount[CC_TOTAL]++;
|
|
||||||
|
|
||||||
if (!gamedata->unlocked[i])
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
challengesmenu.unlockcount[CC_UNLOCKED]++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return &MISC_ChallengesDef;
|
|
||||||
}
|
|
||||||
|
|
||||||
return desiredmenu;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void M_ChallengesAutoFocus(UINT8 unlockid, boolean fresh)
|
static void M_ChallengesAutoFocus(UINT8 unlockid, boolean fresh)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
|
|
@ -196,6 +151,56 @@ static void M_ChallengesAutoFocus(UINT8 unlockid, boolean fresh)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
||||||
|
{
|
||||||
|
UINT8 i;
|
||||||
|
UINT16 newunlock = M_GetNextAchievedUnlock();
|
||||||
|
|
||||||
|
M_UpdateUnlockablesAndExtraEmblems(false);
|
||||||
|
|
||||||
|
if ((challengesmenu.pending = (newunlock < MAXUNLOCKABLES)))
|
||||||
|
{
|
||||||
|
MISC_ChallengesDef.prevMenu = desiredmenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (challengesmenu.pending || desiredmenu == NULL)
|
||||||
|
{
|
||||||
|
challengesmenu.requestnew = false;
|
||||||
|
challengesmenu.currentunlock = MAXUNLOCKABLES;
|
||||||
|
challengesmenu.unlockcondition = NULL;
|
||||||
|
|
||||||
|
M_PopulateChallengeGrid();
|
||||||
|
if (gamedata->challengegrid)
|
||||||
|
challengesmenu.extradata = M_ChallengeGridExtraData();
|
||||||
|
|
||||||
|
memset(setup_explosions, 0, sizeof(setup_explosions));
|
||||||
|
memset(&challengesmenu.unlockcount, 0, sizeof(challengesmenu.unlockcount));
|
||||||
|
for (i = 0; i < MAXUNLOCKABLES; i++)
|
||||||
|
{
|
||||||
|
if (!unlockables[i].conditionset)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
challengesmenu.unlockcount[CC_TOTAL]++;
|
||||||
|
|
||||||
|
if (!gamedata->unlocked[i])
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
challengesmenu.unlockcount[CC_UNLOCKED]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (challengesmenu.pending)
|
||||||
|
M_ChallengesAutoFocus(newunlock, true);
|
||||||
|
|
||||||
|
return &MISC_ChallengesDef;
|
||||||
|
}
|
||||||
|
|
||||||
|
return desiredmenu;
|
||||||
|
}
|
||||||
|
|
||||||
void M_Challenges(INT32 choice)
|
void M_Challenges(INT32 choice)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
|
|
@ -249,7 +254,6 @@ void M_ChallengesTick(void)
|
||||||
{
|
{
|
||||||
const UINT8 pid = 0;
|
const UINT8 pid = 0;
|
||||||
UINT8 i, newunlock = MAXUNLOCKABLES;
|
UINT8 i, newunlock = MAXUNLOCKABLES;
|
||||||
boolean fresh = (challengesmenu.currentunlock >= MAXUNLOCKABLES);
|
|
||||||
|
|
||||||
// Ticking
|
// Ticking
|
||||||
challengesmenu.ticker++;
|
challengesmenu.ticker++;
|
||||||
|
|
@ -274,7 +278,7 @@ void M_ChallengesTick(void)
|
||||||
if ((newunlock = M_GetNextAchievedUnlock()) < MAXUNLOCKABLES)
|
if ((newunlock = M_GetNextAchievedUnlock()) < MAXUNLOCKABLES)
|
||||||
{
|
{
|
||||||
// We got one!
|
// We got one!
|
||||||
M_ChallengesAutoFocus(newunlock, fresh);
|
M_ChallengesAutoFocus(newunlock, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue