From bd7be2dd6f0498e5bbee0733bd289ff404c5315a Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 28 Sep 2023 09:58:21 +0100 Subject: [PATCH] M_DrawChallengeKeys: Grey out the last Chao Key on the stack if you're either out of them, or going to be out of them after the animation is over --- src/k_menudraw.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 82c4405ad..762361bdc 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -5996,7 +5996,7 @@ static void M_DrawChallengeKeys(INT32 tilex, INT32 tiley) if (specifickeyholdtime < CHAOHOLD_BEGIN) { - if (specifickeyholdtime < 0) + if (specifickeyholdtime <= 0) { // Nothing following will be relevant break; @@ -6045,7 +6045,15 @@ static void M_DrawChallengeKeys(INT32 tilex, INT32 tiley) // The final Chao Key on the stack { - V_DrawFixedPatch(keyx, keyy, FRACUNIT, 0, key, NULL); + UINT8 *lastkeycolormap = NULL; + + if (gamedata->chaokeys <= keysbeingused) + { + // Greyed out if there's going to be none left + lastkeycolormap = R_GetTranslationColormap(TC_BLINK, SKINCOLOR_BLACK, GTC_MENUCACHE); + } + + V_DrawFixedPatch(keyx, keyy, FRACUNIT, 0, key, lastkeycolormap); } }