From 25da02f0e69f00b732385b1797e6fe33f0f02a93 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Mar 2024 21:36:33 +0000 Subject: [PATCH 1/3] Rework debugchallenges a little - Instead of referring to conditionset id, the number you provide is unlockable id (as seen in unlocks.pk3, so plus one). - This is preferable because multiple unlocks have the same conditionset. - Show flashing highlight for the desired unlockable id on the scrollbar, too - Different flash to unlock that hasn't been inspected yet --- src/k_menudraw.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 175156392..0c115c0fe 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -6417,9 +6417,9 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, UINT8 *flash #ifdef DEVELOP if (cv_debugchallenges.value > 0 && - cv_debugchallenges.value != ref->conditionset) + cv_debugchallenges.value != num+1) { - // Searching for a conditionset, fade out any tiles + // Searching for an unlockable ID, fade out any tiles // that don't match. tileflags = V_80TRANS; } @@ -6749,7 +6749,7 @@ drawborder: // Display the conditionset for this tile. V_DrawThinString(x, y, ref->conditionset == cv_debugchallenges.value ? V_AQUAMAP : V_GRAYMAP, - va("%u", ref->conditionset)); + va("%u", num+1)); } #endif } @@ -7508,6 +7508,10 @@ static void M_DrawChallengeKeys(INT32 tilex, INT32 tiley) static void M_DrawChallengeScrollBar(UINT8 *flashmap) { +#ifdef DEVELOP + extern consvar_t cv_debugchallenges; +#endif + const INT32 bary = 4, barh = 1, hiliw = 1; if (!gamedata->challengegrid || !gamedata->challengegridwidth) @@ -7574,7 +7578,21 @@ static void M_DrawChallengeScrollBar(UINT8 *flashmap) if (gamedata->challengegrid[i] >= MAXUNLOCKABLES) continue; - if (gamedata->unlocked[gamedata->challengegrid[i]] && completionamount != -1) +#ifdef DEVELOP + if (cv_debugchallenges.value > 0 + && cv_debugchallenges.value == gamedata->challengegrid[i]+1) + { + V_DrawFill(barx + hilix, bary, hiliw, barh, (challengesmenu.ticker & 2) ? 0 : 32); + + // The debug fill overrides everything else. + completionamount = -1; + } +#endif + + if (completionamount == -1) + continue; + + if (gamedata->unlocked[gamedata->challengegrid[i]]) { completionamount += (10/CHALLENGEGRIDHEIGHT); From 6f67984e27b57ad5d5f820580406a8242ace395c Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Mar 2024 21:41:55 +0000 Subject: [PATCH 2/3] Add "Track 10" to the Message from the Stars Stays with you after you leave the Challenges screen. Also remove the duplicate-effort attempt-to-pre-optimise considersealedswapalert that only considered SECRET_SPECIALATTACK - it should also report here under other unlockable progressions, if relevant. --- src/k_menu.h | 2 -- src/k_menufunc.c | 4 ++++ src/m_cond.h | 1 + src/menus/extras-challenges.c | 13 ++++--------- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/k_menu.h b/src/k_menu.h index dcd9aedd6..b22853bde 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1405,8 +1405,6 @@ extern struct challengesmenu_s { boolean chaokeyadd, keywasadded; UINT8 chaokeyhold; - boolean considersealedswapalert; - boolean requestflip; UINT16 unlockcount[CMC_MAX]; diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 06e9991c3..8a73bbe4e 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -528,6 +528,7 @@ void M_PlayMenuJam(void) const char* overridetotrack[GDMUSIC_MAX-1] = { "KEYGEN", "LOSERC", + "TRACKA", }; if (refMenu != NULL && NotCurrentlyPlaying(overridetotrack[override - 1])) @@ -580,6 +581,9 @@ boolean M_ConsiderSealedSwapAlert(void) NULL, MM_NOTHING, NULL, NULL ); + if (gamedata->musicstate < GDMUSIC_TRACK10) + gamedata->musicstate = GDMUSIC_TRACK10; + return true; } diff --git a/src/m_cond.h b/src/m_cond.h index b9989af56..c54711791 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -286,6 +286,7 @@ typedef enum { GDMUSIC_KEYG, GDMUSIC_KEEPONMENU, // Minimum to keep after leaving the Challenge Grid GDMUSIC_LOSERCLUB = GDMUSIC_KEEPONMENU, + GDMUSIC_TRACK10, GDMUSIC_MAX } gdmusic_t; diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index 75e393b53..60f4265e7 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -361,7 +361,6 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu) challengesmenu.requestnew = false; challengesmenu.chaokeyadd = false; challengesmenu.keywasadded = false; - challengesmenu.considersealedswapalert = false; challengesmenu.chaokeyhold = 0; challengesmenu.unlockcondition = NULL; @@ -707,9 +706,6 @@ void M_ChallengesTick(void) gamedata->unlocked[challengesmenu.currentunlock] = true; M_UpdateUnlockablesAndExtraEmblems(true, true); - if (ref->type == SECRET_SPECIALATTACK) - challengesmenu.considersealedswapalert = true; - // Update shown description just in case..? if (challengesmenu.unlockcondition) Z_Free(challengesmenu.unlockcondition); @@ -780,11 +776,7 @@ void M_ChallengesTick(void) // Fade decrease. if (--challengesmenu.fade == 0) { - // Play music the moment control returns. - M_PlayMenuJam(); - - if (challengesmenu.considersealedswapalert == true - && M_ConsiderSealedSwapAlert() == true) + if (M_ConsiderSealedSwapAlert() == true) { // No keygen tutorial in this case... // not ideal but at least unlikely to @@ -795,6 +787,9 @@ void M_ChallengesTick(void) { M_ChallengesTutorial(CCTUTORIAL_KEYGEN); } + + // Play music the moment control returns. + M_PlayMenuJam(); } } From 01cb8c028974639f4f952efd28ea9d2fc92ac24a Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Mar 2024 22:27:07 +0000 Subject: [PATCH 3/3] Seperate out Key Generation and Challenge Achievement sounds Also removes unused sound effect defintion for sfx_endwrp --- src/k_kart.c | 2 +- src/m_cond.c | 12 ++++++++++-- src/menus/extras-challenges.c | 2 +- src/sounds.c | 4 ++-- src/sounds.h | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index d6b7befc1..34d25c9fc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -207,7 +207,7 @@ void K_TimerInit(void) } else if (skipstats != 0 && bossintro == false) { - S_StartSound(NULL, sfx_s26c); //sfx_endwrp + S_StartSound(NULL, sfx_s26c); } if ((gametyperules & (GTR_CATCHER|GTR_CIRCUIT)) == (GTR_CATCHER|GTR_CIRCUIT)) diff --git a/src/m_cond.c b/src/m_cond.c index 33683d531..6be7dcf23 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -3113,8 +3113,6 @@ boolean M_UpdateUnlockablesAndExtraEmblems(boolean loud, boolean doall) response++; } - response += newkeys; - // Announce if (response != 0) { @@ -3124,6 +3122,16 @@ boolean M_UpdateUnlockablesAndExtraEmblems(boolean loud, boolean doall) } return true; } + + if (newkeys != 0) + { + if (loud) + { + S_StartSound(NULL, sfx_keygen); + } + return true; + } + return false; } diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index 60f4265e7..e090a9e3c 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -648,7 +648,7 @@ void M_ChallengesTick(void) if (gamedata->keyspending > 0) { - S_StartSound(NULL, sfx_achiev); + S_StartSound(NULL, sfx_keygen); gamedata->keyspending--; gamedata->chaokeys++; challengesmenu.unlockcount[CMC_CHAOANIM]++; diff --git a/src/sounds.c b/src/sounds.c index de2ada781..91f5c4278 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1102,8 +1102,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"typri2", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SA2 final boss-type typewriting {"eggspr", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Sonic Unleashed Trap Spring {"achiev", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Achievement"}, - {"gpmetr", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // End of a "Tutorial Teleport" - {"endwrp", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // End of a "Tutorial Teleport" + {"keygen", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Key Generated"}, + {"gpmetr", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SRB2Kart - Ring Box {"slot00", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bar"}, diff --git a/src/sounds.h b/src/sounds.h index 86f012c11..9e1c7a52b 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1170,8 +1170,8 @@ typedef enum sfx_typri2, sfx_eggspr, sfx_achiev, + sfx_keygen, sfx_gpmetr, - sfx_endwrp, // SRB2Kart - Ring Box sfx_slot00,