From 91fa244dec2054251957161a9d5dd38e8de92b3d Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 25 Feb 2023 13:28:11 +0000 Subject: [PATCH] Challenges Menu: Adjust ticker behaviour for flipping panels - Handle beginning a flip in M_ChallengesTick - Removes set in M_ChallengesInput - Reduces complexity of set in M_ChallengesAutoFocus - Fixes an issue where starting the menu would have the tiles partly compacted during the intro wipe --- src/menus/extras-challenges.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index a9d056cd4..76d86c9e8 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -85,13 +85,9 @@ static void M_ChallengesAutoFocus(UINT8 unlockid, boolean fresh) challengesmenu.row = challengesmenu.hiliy = i%CHALLENGEGRIDHEIGHT; // Begin animation - if (challengesmenu.extradata[i].flip == 0) + if (challengesmenu.pending) { - challengesmenu.extradata[i].flip = - (challengesmenu.pending - ? (TILEFLIP_MAX/2) - : 1 - ); + challengesmenu.extradata[i].flip = (TILEFLIP_MAX/2); } if (fresh) @@ -178,6 +174,7 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu) if (challengesmenu.pending || desiredmenu == NULL) { + challengesmenu.ticker = 0; challengesmenu.requestnew = false; challengesmenu.currentunlock = MAXUNLOCKABLES; challengesmenu.unlockcondition = NULL; @@ -297,7 +294,7 @@ void M_ChallengesTick(void) { allthewaythrough = (!seeeveryone && !challengesmenu.pending && i != id); maxflip = ((seeeveryone || !allthewaythrough) ? (TILEFLIP_MAX/2) : TILEFLIP_MAX); - if ((seeeveryone || (challengesmenu.extradata[i].flip > 0)) + if ((seeeveryone || (i == id) || (challengesmenu.extradata[i].flip > 0)) && (challengesmenu.extradata[i].flip != maxflip)) { challengesmenu.extradata[i].flip++; @@ -629,13 +626,9 @@ boolean M_ChallengesInputs(INT32 ch) } } - i = (challengesmenu.hilix * CHALLENGEGRIDHEIGHT) + challengesmenu.hiliy; + //i = (challengesmenu.hilix * CHALLENGEGRIDHEIGHT) + challengesmenu.hiliy; } - // Begin animation - if (challengesmenu.extradata[i].flip == 0) - challengesmenu.extradata[i].flip++; - return true; }