diff --git a/src/deh_soc.c b/src/deh_soc.c index 974532c24..94ae9b764 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -3539,6 +3539,14 @@ void readmaincfg(MYFILE *f, boolean mainfile) Z_Free(tutorialchallengemap); tutorialchallengemap = Z_StrDup(word2); } + else if (fastcmp(word, "GAMESTARTCHALLENGE")) + { + INT32 val = get_number(word2) - 1; + if (val < 0 || val >= MAXUNLOCKABLES) + gamestartchallenge = MAXUNLOCKABLES; + else + gamestartchallenge = (UINT16)val; + } else if (fastcmp(word, "HIDETITLEPICS") || fastcmp(word, "TITLEPICSHIDE")) { hidetitlepics = (boolean)(value != 0 || word2[0] == 'T' || word2[0] == 'Y'); diff --git a/src/f_finale.c b/src/f_finale.c index e751084bc..2e56f3c1d 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1470,6 +1470,8 @@ static void F_CacheTitleScreen(void) } } +static boolean cache_gametrulystarted = false; + void F_StartTitleScreen(void) { INT32 titleMapNum; @@ -1486,7 +1488,10 @@ void F_StartTitleScreen(void) else wipegamestate = GS_TITLESCREEN; - if (titlemap + cache_gametrulystarted = M_GameTrulyStarted(); + + if (cache_gametrulystarted == true + && titlemap && ((titleMapNum = G_MapNumber(titlemap)) < nummapheaders) && mapheaderinfo[titleMapNum] && mapheaderinfo[titleMapNum]->lumpnum != LUMPERROR) @@ -1598,16 +1603,19 @@ void F_TitleScreenDrawer(void) { boolean hidepics = false; -#if 0 - if (modeattacking) - return; // We likely came here from retrying. Don't do a damn thing. -#endif - // Draw that sky! - if (curbgcolor >= 0) + if (cache_gametrulystarted == false) + { + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + } + else if (curbgcolor >= 0) + { V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor); + } else if (!curbghide || !titlemapinaction || gamestate == GS_WAITINGPLAYERS) + { F_SkyScroll(curbgxspeed, curbgyspeed, curbgname); + } // Don't draw outside of the title screen, or if the patch isn't there. if (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS) @@ -1629,35 +1637,42 @@ void F_TitleScreenDrawer(void) case TTMODE_RINGRACERS: { - const char *eggName = "eggman"; - INT32 eggSkin = R_SkinAvailable(eggName); - skincolornum_t eggColor = SKINCOLOR_RED; - UINT8 *eggColormap = NULL; - - const char *tailsName = "tails"; - INT32 tailsSkin = R_SkinAvailable(tailsName); - skincolornum_t tailsColor = SKINCOLOR_ORANGE; - UINT8 *tailsColormap = NULL; - - if (eggSkin != -1) + if (cache_gametrulystarted == true) { - eggColor = skins[eggSkin].prefcolor; - } - eggColormap = R_GetTranslationColormap(TC_DEFAULT, eggColor, GTC_MENUCACHE); + const char *eggName = "eggman"; + INT32 eggSkin = R_SkinAvailable(eggName); + skincolornum_t eggColor = SKINCOLOR_RED; + UINT8 *eggColormap = NULL; - if (tailsSkin != -1) + const char *tailsName = "tails"; + INT32 tailsSkin = R_SkinAvailable(tailsName); + skincolornum_t tailsColor = SKINCOLOR_ORANGE; + UINT8 *tailsColormap = NULL; + + if (eggSkin != -1) + { + eggColor = skins[eggSkin].prefcolor; + } + eggColormap = R_GetTranslationColormap(TC_DEFAULT, eggColor, GTC_MENUCACHE); + + if (tailsSkin != -1) + { + tailsColor = skins[tailsSkin].prefcolor; + } + tailsColormap = R_GetTranslationColormap(TC_DEFAULT, tailsColor, GTC_MENUCACHE); + + V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_tails_tails, tailsColormap); + V_DrawFixedPatch(0, 0, FRACUNIT, V_ADD, kts_electricity[finalecount % 6], NULL); + + V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_eggman, eggColormap); + V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_tails, tailsColormap); + + V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_bumper, NULL); + } + else { - tailsColor = skins[tailsSkin].prefcolor; + V_DrawCenteredString(BASEVIDWIDTH/2, (BASEVIDHEIGHT/2) - 4, 0, "Press any button/key to continue"); } - tailsColormap = R_GetTranslationColormap(TC_DEFAULT, tailsColor, GTC_MENUCACHE); - - V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_tails_tails, tailsColormap); - V_DrawFixedPatch(0, 0, FRACUNIT, V_ADD, kts_electricity[finalecount % 6], NULL); - - V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_eggman, eggColormap); - V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_tails, tailsColormap); - - V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_bumper, NULL); V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_copyright, NULL); break; @@ -1796,7 +1811,7 @@ void F_TitleScreenTicker(boolean run) } // no demos to play? or, are they disabled? - if (!cv_rollingdemos.value) + if (!cv_rollingdemos.value || cache_gametrulystarted == false) return; #if defined (TESTERS) diff --git a/src/m_cond.c b/src/m_cond.c index 7815eae6f..b4f5a0ba6 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -48,6 +48,9 @@ unlockable_t unlockables[MAXUNLOCKABLES]; // Number of emblems INT32 numemblems = 0; +// The challenge that will truly let the games begin. +UINT16 gamestartchallenge = 600; // 601 + // Create a new gamedata_t, for start-up void M_NewGameDataStruct(void) { @@ -3200,6 +3203,27 @@ UINT16 M_CompletionEmblems(void) // Bah! Duplication sucks, but it's for a separ // Quick unlock checks // ------------------- +boolean M_GameTrulyStarted(void) +{ + // Fail safe + if (gamedata == NULL) + return false; + + // Not set + if (gamestartchallenge >= MAXUNLOCKABLES) + return true; + + // An unfortunate sidestep, but sync is important. + if (netgame) + return true; + + // Okay, we can check to see if this challenge has been achieved. + return ( + gamedata->unlockpending[gamestartchallenge] + || gamedata->unlocked[gamestartchallenge] + ); +} + boolean M_CheckNetUnlockByID(UINT16 unlockid) { if (unlockid >= MAXUNLOCKABLES diff --git a/src/m_cond.h b/src/m_cond.h index e79a28676..87c38060e 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -435,9 +435,12 @@ void M_UpdateNextPrisonEggPickup(void); UINT16 M_CheckLevelEmblems(void); UINT16 M_CompletionEmblems(void); +extern UINT16 gamestartchallenge; + // Checking unlockable status boolean M_CheckNetUnlockByID(UINT16 unlockid); boolean M_SecretUnlocked(INT32 type, boolean local); +boolean M_GameTrulyStarted(void); boolean M_CupLocked(cupheader_t *cup); boolean M_CupSecondRowLocked(void); boolean M_MapLocked(UINT16 mapnum); diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index da5dc2bd1..fcfd72fe5 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -291,7 +291,8 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu) { UINT16 newunlock; - if (Playing()) + if (Playing() == true + || M_GameTrulyStarted() == false) return desiredmenu; M_UpdateUnlockablesAndExtraEmblems(false, true); @@ -376,9 +377,8 @@ boolean M_CanKeyHiliTile(void) UINT16 i = (challengesmenu.hilix * CHALLENGEGRIDHEIGHT) + challengesmenu.hiliy; - // Not a hinted tile OR a fresh board. - if (!(challengesmenu.extradata[i].flags & CHE_HINT) - && (challengesmenu.unlockcount[CMC_UNLOCKED] > 0)) + // Not a hinted tile. + if (!(challengesmenu.extradata[i].flags & CHE_HINT)) return false; // Marked as major?