diff --git a/src/k_menu.h b/src/k_menu.h index 3b1151aae..4847a988f 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1458,6 +1458,8 @@ extern struct challengesmenu_s { boolean chaokeyadd, keywasadded; UINT8 chaokeyhold; + UINT16 tutorialfound; + boolean requestflip; UINT16 unlockcount[CMC_MAX]; diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index 828605c38..6569ca291 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -376,6 +376,7 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu) challengesmenu.requestnew = false; challengesmenu.chaokeyadd = false; challengesmenu.keywasadded = false; + challengesmenu.tutorialfound = NEXTMAP_INVALID; challengesmenu.chaokeyhold = 0; challengesmenu.unlockcondition = NULL; @@ -479,6 +480,7 @@ boolean M_CanKeyHiliTile(void) enum { CCTUTORIAL_KEYGEN = 0, CCTUTORIAL_MAJORSKIP, + CCTUTORIAL_TUTORIAL, // I heard you like tutorials, so I... } cctutorial_e; static void M_ChallengesTutorial(UINT8 option) @@ -512,6 +514,23 @@ static void M_ChallengesTutorial(UINT8 option) gamedata->majorkeyskipattempted = true; break; } + case CCTUTORIAL_TUTORIAL: + { + M_StartMessage("New Tutorial Data", + va(M_GetText( + "A new piece of Eggman and Tails'\n" + "short adventure has been decrypted.\n" + "\n" + "You can find \"""\x87""%s""\x80""\" on\n" + "the Tutorials menu under Extras!\n" + ), (challengesmenu.tutorialfound < nummapheaders + && mapheaderinfo[challengesmenu.tutorialfound] + ? mapheaderinfo[challengesmenu.tutorialfound]->menuttl + : "ERROR!?" + )), NULL, MM_NOTHING, NULL, "Got it!"); + challengesmenu.tutorialfound = NEXTMAP_INVALID; + break; + } default: { M_StartMessage("M_ChallengesTutorial ERROR", @@ -725,6 +744,28 @@ void M_ChallengesTick(void) gamedata->unlocked[challengesmenu.currentunlock] = true; M_UpdateUnlockablesAndExtraEmblems(true, true); + if (challengesmenu.tutorialfound == NEXTMAP_INVALID + && ref->type == SECRET_MAP) + { + // Map exists... + UINT16 mapnum = M_UnlockableMapNum(ref); + if (mapnum < nummapheaders && mapheaderinfo[mapnum]) + { + // is tutorial... + INT32 guessgt = G_GuessGametypeByTOL(mapheaderinfo[mapnum]->typeoflevel); + if (guessgt == GT_TUTORIAL) + { + // and isn't the playground? + if (!tutorialplaygroundmap + || strcmp(tutorialplaygroundmap, mapheaderinfo[mapnum]->lumpname)) + { + // Pop an alert up! + challengesmenu.tutorialfound = mapnum; + } + } + } + } + // Update shown description just in case..? if (challengesmenu.unlockcondition) Z_Free(challengesmenu.unlockcondition); @@ -801,6 +842,11 @@ void M_ChallengesTick(void) // not ideal but at least unlikely to // get at same time?? :V } + else if (challengesmenu.tutorialfound != NEXTMAP_INVALID) + { + M_ChallengesTutorial(CCTUTORIAL_TUTORIAL); + // Also no keygen, but that can come later. + } else if (gamedata->chaokeytutorial == false && challengesmenu.keywasadded == true) {