Challenges menu: More complicated music behaviour

- Pure silence when challenges are being unlocked
- Begin playing the menujam as control returns to the player
This commit is contained in:
toaster 2023-02-01 22:14:26 +00:00
parent 57b22f32d5
commit f630bbb1cf
2 changed files with 9 additions and 1 deletions

View file

@ -358,6 +358,9 @@ boolean M_Responder(event_t *ev)
void M_PlayMenuJam(void)
{
if (challengesmenu.pending)
return;
if (cv_menujam_update.value)
{
CV_AddValue(&cv_menujam, 1);

View file

@ -160,6 +160,7 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
if ((challengesmenu.pending = (newunlock < MAXUNLOCKABLES)))
{
S_StopMusic();
MISC_ChallengesDef.prevMenu = desiredmenu;
}
@ -380,7 +381,11 @@ void M_ChallengesTick(void)
if (challengesmenu.fade > 0)
{
// Fade decrease.
challengesmenu.fade--;
if (--challengesmenu.fade == 0)
{
// Play music the moment control returns.
M_PlayMenuJam();
}
}
}
}