From 9a35a39f5d03f43a66b5823839c54502c735868a Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 10 Aug 2023 00:27:15 +0100 Subject: [PATCH] Challenges Chao Key usage: Eggman numbers to REALLY drive home that you have to hold the button, and that you can release it early --- src/k_hud.c | 2 +- src/k_hud.h | 2 ++ src/k_menudraw.c | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/k_hud.c b/src/k_hud.c index 9e74ce0f8..20da0419c 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -162,7 +162,7 @@ static patch_t *kp_localtag[4][2]; static patch_t *kp_talk; static patch_t *kp_typdot; -static patch_t *kp_eggnum[6]; +patch_t *kp_eggnum[6]; static patch_t *kp_flameshieldmeter[FLAMESHIELD_MAX][2]; static patch_t *kp_flameshieldmeter_bg[FLAMESHIELD_MAX][2]; diff --git a/src/k_hud.h b/src/k_hud.h index 498a6295f..041243d5b 100644 --- a/src/k_hud.h +++ b/src/k_hud.h @@ -75,6 +75,8 @@ extern patch_t *kp_button_down[2]; extern patch_t *kp_button_right[2]; extern patch_t *kp_button_left[2]; +extern patch_t *kp_eggnum[6]; + #ifdef __cplusplus } // extern "C" #endif diff --git a/src/k_menudraw.c b/src/k_menudraw.c index d18affab1..b789a97f4 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -5988,6 +5988,10 @@ challengedesc: keyholdrotation = 360 * ((challengesmenu.chaokeyhold - CHAOHOLD_BEGIN)) * (FRACUNIT/(CHAOHOLD_MAX - (CHAOHOLD_BEGIN + CHAOHOLD_END))); + + INT32 time = 3 - (keyholdrotation - 1) / (90 * FRACUNIT); + if (time <= 5 && time >= 0) + V_DrawScaledPatch(selectx + 2, selecty - 2, 0, kp_eggnum[time]); } else {