diff --git a/src/deh_soc.c b/src/deh_soc.c index 1cf6f5d57..a4bd8dc77 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2290,6 +2290,8 @@ void readunlockable(MYFILE *f, INT32 num) unlockables[num].type = SECRET_BREAKTHECAPSULES; else if (fastcmp(word2, "SPECIALATTACK")) unlockables[num].type = SECRET_SPECIALATTACK; + else if (fastcmp(word2, "ONLINE")) + unlockables[num].type = SECRET_ONLINE; else if (fastcmp(word2, "SOUNDTEST")) unlockables[num].type = SECRET_SOUNDTEST; else if (fastcmp(word2, "ALTTITLE")) diff --git a/src/k_menu.h b/src/k_menu.h index 3adbf25de..9145027ae 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -704,6 +704,7 @@ boolean M_CharacterSelectHandler(INT32 choice); void M_CharacterSelectTick(void); boolean M_CharacterSelectQuit(void); +void M_SetupPlayMenu(INT32 choice); void M_SetupGametypeMenu(INT32 choice); void M_SetupRaceMenu(INT32 choice); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 5ad49a066..7f2fa0f7e 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -801,6 +801,8 @@ void M_DrawKartGamemodeMenu(void) for (i = 0; i < currentMenu->numitems; i++) { + INT32 type; + if (currentMenu->menuitems[i].status == IT_DISABLED) { continue; @@ -817,9 +819,12 @@ void M_DrawKartGamemodeMenu(void) } } - switch (currentMenu->menuitems[i].status & IT_DISPLAY) + type = (currentMenu->menuitems[i].status & IT_DISPLAY); + + switch (type) { case IT_STRING: + case IT_TRANSTEXT2: { UINT8 *colormap = NULL; @@ -833,7 +838,13 @@ void M_DrawKartGamemodeMenu(void) } V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, W_CachePatchName("MENUPLTR", PU_CACHE), colormap); - V_DrawGamemodeString(x + 16, y - 3, V_ALLOWLOWERCASE, colormap, currentMenu->menuitems[i].text); + V_DrawGamemodeString(x + 16, y - 3, + (type == IT_TRANSTEXT2 + ? V_TRANSLUCENT + : 0 + )|V_ALLOWLOWERCASE, + colormap, + currentMenu->menuitems[i].text); } break; } @@ -4716,6 +4727,7 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili case SECRET_ENCORE: categoryid = '5'; break; + case SECRET_ONLINE: case SECRET_ALTTITLE: case SECRET_SOUNDTEST: categoryid = '6'; @@ -4783,6 +4795,9 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili iconid = 5; break; + case SECRET_ONLINE: + iconid = 10; + break; case SECRET_ALTTITLE: iconid = 6; break; @@ -5036,12 +5051,21 @@ static void M_DrawChallengePreview(INT32 x, INT32 y) specialmap = mastermapcache; break; } + case SECRET_ONLINE: + { + V_DrawFixedPatch(-3*FRACUNIT, (y-40)*FRACUNIT, + FRACUNIT, + 0, W_CachePatchName("EGGASTLA", PU_CACHE), + NULL); + break; + } case SECRET_ALTTITLE: { x = 8; y = BASEVIDHEIGHT-16; V_DrawGamemodeString(x, y - 32, V_ALLOWLOWERCASE, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_MENUCACHE), cv_alttitle.string); V_DrawThinString(x, y, V_6WIDTHSPACE|V_ALLOWLOWERCASE|highlightflags, "Press (A)"); + break; } default: { diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 05d282e7f..ab4cca6bc 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -447,6 +447,7 @@ menu_t *M_SpecificMenuRestore(menu_t *torestore) } // One last catch. + M_SetupPlayMenu(-1); PLAY_CharSelectDef.prevMenu = &MainDef; return torestore; diff --git a/src/m_cond.h b/src/m_cond.h index 01f055758..dafbf8048 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -126,6 +126,9 @@ typedef enum SECRET_TIMEATTACK, // Permit Time attack SECRET_BREAKTHECAPSULES, // Permit SP Capsule attack SECRET_SPECIALATTACK, // Permit Special attack (You're blue now!) + + // Option restrictions + SECRET_ONLINE, // Permit netplay (ankle-high barrier to jumping in the deep end) SECRET_SOUNDTEST, // Permit Sound Test SECRET_ALTTITLE, // Permit alternate titlescreen diff --git a/src/menus/play-1.c b/src/menus/play-1.c index d4c8ee099..53ca72dc3 100644 --- a/src/menus/play-1.c +++ b/src/menus/play-1.c @@ -2,16 +2,42 @@ /// \brief Play Menu #include "../k_menu.h" +#include "../m_cond.h" menuitem_t PLAY_MainMenu[] = { {IT_STRING | IT_CALL, "Local Play", "Play only on this computer.", NULL, {.routine = M_SetupGametypeMenu}, 0, 0}, - {IT_STRING | IT_CALL, "Online", "Connect to other computers.", + {IT_STRING | IT_CALL, "Online", NULL, NULL, {.routine = M_MPOptSelectInit}, /*M_MPRoomSelectInit,*/ 0, 0}, {IT_STRING | IT_CALL, "Back", NULL, NULL, {.routine = M_GoBack}, 0, 0}, }; menu_t PLAY_MainDef = KARTGAMEMODEMENU(PLAY_MainMenu, &PLAY_CharSelectDef); + +void M_SetupPlayMenu(INT32 choice) +{ +#ifdef TESTERS + (void)choice; +#else + if (choice != -1) + PLAY_MainDef.prevMenu = currentMenu; + + // Enable/disable online play. + if (!M_SecretUnlocked(SECRET_ONLINE, true)) + { + PLAY_MainMenu[1].status = IT_TRANSTEXT2 | IT_CALL; + PLAY_MainMenu[1].tooltip = "You'll need experience to play over the internet!"; + } + else + { + PLAY_MainMenu[1].status = IT_STRING | IT_CALL; + PLAY_MainMenu[1].tooltip = "Connect to other computers over the internet."; + } + + if (choice != -1) + M_SetupNextMenu(&PLAY_MainDef, false); +#endif +} diff --git a/src/menus/play-char-select.c b/src/menus/play-char-select.c index a6ac59d1a..d7d1d4e44 100644 --- a/src/menus/play-char-select.c +++ b/src/menus/play-char-select.c @@ -5,6 +5,7 @@ #include "../r_skins.h" #include "../s_sound.h" #include "../k_grandprix.h" // K_CanChangeRules +#include "../m_cond.h" // Condition Sets menuitem_t PLAY_CharSelect[] = { @@ -1491,7 +1492,7 @@ void M_CharacterSelectTick(void) #if defined (TESTERS) M_MPOptSelectInit(0); #else - M_SetupNextMenu(&PLAY_MainDef, false); + M_SetupPlayMenu(0); #endif } diff --git a/src/menus/play-online-1.c b/src/menus/play-online-1.c index e48154648..e146926b1 100644 --- a/src/menus/play-online-1.c +++ b/src/menus/play-online-1.c @@ -2,6 +2,8 @@ /// \brief MULTIPLAYER OPTION SELECT #include "../k_menu.h" +#include "../m_cond.h" +#include "../s_sound.h" #if defined (TESTERS) #define IT_STRING_CALL_NOTESTERS IT_DISABLED @@ -62,6 +64,15 @@ void M_MPOptSelectInit(INT32 choice) INT16 arrcpy[3][3] = {{0,68,0}, {0,12,0}, {0,74,0}}; const UINT32 forbidden = GTR_FORBIDMP; +#ifndef TESTERS + if (choice != -1 && !M_SecretUnlocked(SECRET_ONLINE, true)) + { + M_StartMessage("Online play is ""\x8B""not yet unlocked""\x80"".\n\nYou'll want experience in ""\x8B""Grand Prix""\x80""\nbefore even thinking about facing\nopponents from across the world.\n\nPress (B)", NULL, MM_NOTHING); + S_StartSound(NULL, sfx_s3k36); + return; + } +#endif + mpmenu.modechoice = 0; mpmenu.ticker = 0;