mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add a x/X counter to the unlocks menu, like KAR and Smash
This commit is contained in:
parent
d2c9c7027d
commit
6d4b55a2d5
3 changed files with 73 additions and 16 deletions
|
|
@ -1088,6 +1088,12 @@ void M_DrawAddons(void);
|
||||||
#define RIGHTUNLOCKSCROLL 3
|
#define RIGHTUNLOCKSCROLL 3
|
||||||
#define LEFTUNLOCKSCROLL (RIGHTUNLOCKSCROLL-1)
|
#define LEFTUNLOCKSCROLL (RIGHTUNLOCKSCROLL-1)
|
||||||
|
|
||||||
|
#define CC_TOTAL 0
|
||||||
|
#define CC_UNLOCKED 1
|
||||||
|
#define CC_TALLY 2
|
||||||
|
#define CC_ANIM 3
|
||||||
|
#define CC_MAX 4
|
||||||
|
|
||||||
// Keep track of some pause menu data for visual goodness.
|
// Keep track of some pause menu data for visual goodness.
|
||||||
extern struct challengesmenu_s {
|
extern struct challengesmenu_s {
|
||||||
|
|
||||||
|
|
@ -1105,6 +1111,8 @@ extern struct challengesmenu_s {
|
||||||
boolean pending;
|
boolean pending;
|
||||||
boolean requestnew;
|
boolean requestnew;
|
||||||
|
|
||||||
|
UINT8 unlockcount[CC_MAX];
|
||||||
|
|
||||||
UINT8 fade;
|
UINT8 fade;
|
||||||
} challengesmenu;
|
} challengesmenu;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4684,6 +4684,18 @@ void M_DrawChallenges(void)
|
||||||
M_DrawCharSelectExplosions(false, explodex, currentMenu->y);
|
M_DrawCharSelectExplosions(false, explodex, currentMenu->y);
|
||||||
|
|
||||||
challengedesc:
|
challengedesc:
|
||||||
|
|
||||||
|
// Tally
|
||||||
|
{
|
||||||
|
str = va("%d/%d",
|
||||||
|
challengesmenu.unlockcount[CC_UNLOCKED] + challengesmenu.unlockcount[CC_TALLY],
|
||||||
|
challengesmenu.unlockcount[CC_TOTAL]
|
||||||
|
);
|
||||||
|
V_DrawRightAlignedKartString(BASEVIDWIDTH-7, 9-challengesmenu.unlockcount[CC_ANIM], 0, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name bar
|
||||||
|
{
|
||||||
y = 120;
|
y = 120;
|
||||||
V_DrawScaledPatch(0, y, 0, W_CachePatchName("MENUHINT", PU_CACHE));
|
V_DrawScaledPatch(0, y, 0, W_CachePatchName("MENUHINT", PU_CACHE));
|
||||||
|
|
||||||
|
|
@ -4702,6 +4714,7 @@ challengedesc:
|
||||||
|
|
||||||
offset = V_LSTitleLowStringWidth(str, 0) / 2;
|
offset = V_LSTitleLowStringWidth(str, 0) / 2;
|
||||||
V_DrawLSTitleLowString(BASEVIDWIDTH/2 - offset, y+6, 0, str);
|
V_DrawLSTitleLowString(BASEVIDWIDTH/2 - offset, y+6, 0, str);
|
||||||
|
}
|
||||||
|
|
||||||
if (!challengesmenu.fade)
|
if (!challengesmenu.fade)
|
||||||
V_DrawThinString(20, 120 + 60, V_ALLOWLOWERCASE, "Press (B)");
|
V_DrawThinString(20, 120 + 60, V_ALLOWLOWERCASE, "Press (B)");
|
||||||
|
|
|
||||||
|
|
@ -6848,6 +6848,8 @@ struct challengesmenu_s challengesmenu;
|
||||||
|
|
||||||
menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
||||||
{
|
{
|
||||||
|
UINT8 i;
|
||||||
|
|
||||||
M_UpdateUnlockablesAndExtraEmblems(false);
|
M_UpdateUnlockablesAndExtraEmblems(false);
|
||||||
|
|
||||||
if ((challengesmenu.pending = challengesmenu.requestnew = (M_GetNextAchievedUnlock() < MAXUNLOCKABLES)))
|
if ((challengesmenu.pending = challengesmenu.requestnew = (M_GetNextAchievedUnlock() < MAXUNLOCKABLES)))
|
||||||
|
|
@ -6864,6 +6866,24 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
||||||
if (gamedata->challengegrid)
|
if (gamedata->challengegrid)
|
||||||
challengesmenu.extradata = M_ChallengeGridExtraData();
|
challengesmenu.extradata = M_ChallengeGridExtraData();
|
||||||
|
|
||||||
|
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 &MISC_ChallengesDef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7035,6 +7055,8 @@ void M_ChallengesTick(void)
|
||||||
if (setup_explosions[i].tics > 0)
|
if (setup_explosions[i].tics > 0)
|
||||||
setup_explosions[i].tics--;
|
setup_explosions[i].tics--;
|
||||||
}
|
}
|
||||||
|
if (challengesmenu.unlockcount[CC_ANIM] > 0)
|
||||||
|
challengesmenu.unlockcount[CC_ANIM]--;
|
||||||
|
|
||||||
if (challengesmenu.pending)
|
if (challengesmenu.pending)
|
||||||
{
|
{
|
||||||
|
|
@ -7075,6 +7097,8 @@ void M_ChallengesTick(void)
|
||||||
{
|
{
|
||||||
// Unlock animation... also tied directly to the actual unlock!
|
// Unlock animation... also tied directly to the actual unlock!
|
||||||
gamedata->unlocked[challengesmenu.currentunlock] = true;
|
gamedata->unlocked[challengesmenu.currentunlock] = true;
|
||||||
|
challengesmenu.unlockcount[CC_TALLY]++;
|
||||||
|
challengesmenu.unlockcount[CC_ANIM]++;
|
||||||
|
|
||||||
Z_Free(challengesmenu.extradata);
|
Z_Free(challengesmenu.extradata);
|
||||||
if ((challengesmenu.extradata = M_ChallengeGridExtraData()))
|
if ((challengesmenu.extradata = M_ChallengeGridExtraData()))
|
||||||
|
|
@ -7127,11 +7151,23 @@ void M_ChallengesTick(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (challengesmenu.fade > 0)
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
// Tick down the tally. (currently not visible)
|
||||||
|
/*if ((challengesmenu.ticker & 1)
|
||||||
|
&& challengesmenu.unlockcount[CC_TALLY] > 0)
|
||||||
|
{
|
||||||
|
challengesmenu.unlockcount[CC_TALLY]--;
|
||||||
|
challengesmenu.unlockcount[CC_UNLOCKED]++;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if (challengesmenu.fade > 0)
|
||||||
{
|
{
|
||||||
// Fade decrease.
|
// Fade decrease.
|
||||||
challengesmenu.fade--;
|
challengesmenu.fade--;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean M_ChallengesInputs(INT32 ch)
|
boolean M_ChallengesInputs(INT32 ch)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue