From 966ce7a256e96cf41332fd2d9c80eae930092f09 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 19 Mar 2024 14:05:13 +0000 Subject: [PATCH] Challenges Menu: Highlight overlay for newly unlocked tiles that haven't yet been focused on Game design solution to the problem of multiple Challenges being unlocked at once not being clear enough. Uses the `unlockpending` array for gamedata save purposes, which I was always intending to use for this purpose but never quite got around to. --- src/k_menudraw.c | 18 +++++++++++++----- src/menus/extras-challenges.c | 15 +++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index a44c74725..beb08ed21 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -6389,7 +6389,7 @@ void M_DrawAddons(void) // Challenges Menu -static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili) +static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, UINT8 *flashmap, boolean hili) { #ifdef DEVELOP extern consvar_t cv_debugchallenges; @@ -6710,6 +6710,13 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili } drawborder: + + if (num < MAXUNLOCKABLES && gamedata->unlockpending[num]) + { + INT32 area = (ref->majorunlock) ? 42 : 20; + V_DrawFadeFill(x, y, area, area, 0, flashmap[(skullAnimCounter/5) ? 99 : 101], 2); + } + if (hili) { boolean maj = (ref != NULL && ref->majorunlock); @@ -6719,13 +6726,11 @@ drawborder: buffer[7] = (skullAnimCounter/5) ? '2' : '1'; pat = W_CachePatchName(buffer, PU_CACHE); - colormap = R_GetTranslationColormap(TC_DEFAULT, M_GetCvPlayerColor(0), GTC_MENUCACHE); - V_DrawFixedPatch( x*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, pat, - colormap + flashmap ); } @@ -7519,6 +7524,8 @@ void M_DrawChallenges(void) goto challengedesc; } + UINT8 *flashmap = R_GetTranslationColormap(TC_DEFAULT, M_GetCvPlayerColor(0), GTC_MENUCACHE); + y = currentMenu->y; V_DrawFadeFill(0, y-2, BASEVIDWIDTH, (challengesgridstep * CHALLENGEGRIDHEIGHT) + 2, 0, 31, challengetransparentstrength); @@ -7572,7 +7579,7 @@ void M_DrawChallenges(void) continue; } - M_DrawChallengeTile(i, j, x, y, false); + M_DrawChallengeTile(i, j, x, y, flashmap, false); } x -= challengesgridstep; @@ -7592,6 +7599,7 @@ void M_DrawChallenges(void) challengesmenu.hiliy, selectx, selecty, + flashmap, true); M_DrawCharSelectExplosions(false, explodex, currentMenu->y); diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index 4bff594a4..fe9c23e13 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -766,6 +766,21 @@ void M_ChallengesTick(void) } } } + + if (challengesmenu.currentunlock < MAXUNLOCKABLES + && gamedata->unlockpending[challengesmenu.currentunlock] == true) + { + UINT16 id = (challengesmenu.hilix * CHALLENGEGRIDHEIGHT) + challengesmenu.hiliy; + if (challengesmenu.extradata + && challengesmenu.extradata[id].flip != (TILEFLIP_MAX/2)) + { + // Only mark visited once flipped + } + else + { + gamedata->unlockpending[challengesmenu.currentunlock] = false; + } + } } }