Add Extras-related unlocks

- When SECRET_ADDONS is locked
    - No Addons option on Extras submenu
    - No mid-game Addons in K_CanChangeRules
    - Forced onto CORE on Server Browser room selection page
        - Semi-related: If modifiedgame is true, force onto MODDED, even if you haven't unlocked it
        - TODO: Update UI to show you can't switch in a more elegant way
    - Hide Addons Options on Data Options submenu
- When SECRET_EGGTV is locked
    - No Egg TV option on Extras submenu
    - Semi-related: Rename to Egg TV per team discussion
This commit is contained in:
toaster 2023-02-27 19:55:11 +00:00
parent b0ae6a7532
commit 54a58178a1
8 changed files with 83 additions and 16 deletions

View file

@ -2292,6 +2292,10 @@ void readunlockable(MYFILE *f, INT32 num)
unlockables[num].type = SECRET_SPECIALATTACK;
else if (fastcmp(word2, "ONLINE"))
unlockables[num].type = SECRET_ONLINE;
else if (fastcmp(word2, "ADDONS"))
unlockables[num].type = SECRET_ADDONS;
else if (fastcmp(word2, "EGGTV"))
unlockables[num].type = SECRET_EGGTV;
else if (fastcmp(word2, "SOUNDTEST"))
unlockables[num].type = SECRET_SOUNDTEST;
else if (fastcmp(word2, "ALTTITLE"))

View file

@ -781,6 +781,7 @@ extern struct mpmenu_s {
// See M_OptSelectTick, it'll make more sense there. Sorry if this is a bit of a mess!
UINT8 room;
boolean roomforced;
tic_t ticker;
UINT8 servernum;

View file

@ -2775,8 +2775,12 @@ void M_DrawMPRoomSelect(void)
// Draw buttons:
V_DrawFixedPatch(160<<FRACBITS, 100<<FRACBITS, FRACUNIT, mpmenu.room ? (5<<V_ALPHASHIFT) : 0, butt1[(mpmenu.room) ? 1 : 0], NULL);
V_DrawFixedPatch(160<<FRACBITS, 100<<FRACBITS, FRACUNIT, (!mpmenu.room) ? (5<<V_ALPHASHIFT) : 0, butt2[(!mpmenu.room) ? 1 : 0], NULL);
if (!mpmenu.roomforced || mpmenu.room == 0)
V_DrawFixedPatch(160<<FRACBITS, 100<<FRACBITS, FRACUNIT, mpmenu.room ? (5<<V_ALPHASHIFT) : 0, butt1[(mpmenu.room) ? 1 : 0], NULL);
if (!mpmenu.roomforced || mpmenu.room == 1)
V_DrawFixedPatch(160<<FRACBITS, 100<<FRACBITS, FRACUNIT, (!mpmenu.room) ? (5<<V_ALPHASHIFT) : 0, butt2[(!mpmenu.room) ? 1 : 0], NULL);
}
// SERVER BROWSER
@ -4728,6 +4732,8 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili
categoryid = '5';
break;
case SECRET_ONLINE:
case SECRET_ADDONS:
case SECRET_EGGTV:
case SECRET_ALTTITLE:
case SECRET_SOUNDTEST:
categoryid = '6';
@ -4798,6 +4804,12 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili
case SECRET_ONLINE:
iconid = 10;
break;
case SECRET_ADDONS:
iconid = 12;
break;
case SECRET_EGGTV:
iconid = 11;
break;
case SECRET_ALTTITLE:
iconid = 6;
break;

View file

@ -129,6 +129,8 @@ typedef enum
// Option restrictions
SECRET_ONLINE, // Permit netplay (ankle-high barrier to jumping in the deep end)
SECRET_ADDONS, // Permit menu addfile
SECRET_EGGTV, // Permit replay playback menu
SECRET_SOUNDTEST, // Permit Sound Test
SECRET_ALTTITLE, // Permit alternate titlescreen

View file

@ -2,22 +2,26 @@
/// \brief Extras Menu
#include "../k_menu.h"
#include "../m_cond.h"
#include "../s_sound.h"
menuitem_t EXTRAS_Main[] =
{
// The following has NULL strings for text and tooltip.
// These are populated in M_InitExtras depending on unlock state.
// (This is legal - they're (const char)*'s, not const (char*)'s.
{IT_STRING | IT_CALL, "Addons", "Add files to customize your experience.",
{IT_STRING | IT_CALL, NULL, NULL,
NULL, {.routine = M_Addons}, 0, 0},
{IT_STRING | IT_CALL, "Challenges", "View the requirements for some of the secret content you can unlock!",
NULL, {.routine = M_Challenges}, 0, 0},
{IT_STRING | IT_CALL, "Replay Hut", "Play the replays you've saved throughout your many races & battles!",
NULL, {.routine = M_ReplayHut}, 0, 0},
{IT_STRING | IT_CALL, "Statistics", "Look back on some of your greatest achievements such as your playtime and wins!",
NULL, {.routine = M_Statistics}, 0, 0},
{IT_STRING | IT_CALL, NULL, NULL,
NULL, {.routine = M_ReplayHut}, 0, 0},
};
// the extras menu essentially reuses the options menu stuff
@ -54,6 +58,40 @@ void M_InitExtras(INT32 choice)
extrasmenu.textx = 0;
extrasmenu.texty = 0;
// Addons
if (M_SecretUnlocked(SECRET_ADDONS, true))
{
EXTRAS_Main[0].status = IT_STRING | IT_CALL;
EXTRAS_Main[0].text = "Addons";
EXTRAS_Main[0].tooltip = "Add files to customize your experience.";
}
else
{
EXTRAS_Main[0].status = IT_STRING | IT_TRANSTEXT;
EXTRAS_Main[0].text = EXTRAS_Main[0].tooltip = "???";
if (EXTRAS_MainDef.lastOn == 0)
{
EXTRAS_MainDef.lastOn = 1;
}
}
// Egg TV
if (M_SecretUnlocked(SECRET_EGGTV, true))
{
EXTRAS_Main[3].status = IT_STRING | IT_CALL;
EXTRAS_Main[3].text = "Egg TV";
EXTRAS_Main[3].tooltip = "Watch the replays you've saved throughout your many races & battles!";
}
else
{
EXTRAS_Main[3].status = IT_STRING | IT_TRANSTEXT;
EXTRAS_Main[3].text = EXTRAS_Main[3].tooltip = "???";
if (EXTRAS_MainDef.lastOn == 3)
{
EXTRAS_MainDef.lastOn = 2;
}
}
M_SetupNextMenu(&EXTRAS_MainDef, false);
}

View file

@ -91,6 +91,9 @@ void M_InitOptions(INT32 choice)
(M_SecretUnlocked(SECRET_ENCORE, false) ? (IT_STRING | IT_CVAR) : IT_DISABLED);
}
OPTIONS_DataDef.menuitems[dopt_addon].status = (M_SecretUnlocked(SECRET_ADDONS, true)
? (IT_STRING | IT_SUBMENU)
: (IT_TRANSTEXT2 | IT_SPACE));
OPTIONS_DataDef.menuitems[dopt_erase].status = (gamestate == GS_MENU
? (IT_STRING | IT_SUBMENU)
: (IT_TRANSTEXT2 | IT_SPACE));

View file

@ -3,6 +3,7 @@
#include "../k_menu.h"
#include "../s_sound.h"
#include "../m_cond.h"
menuitem_t PLAY_MP_RoomSelect[] =
{
@ -30,23 +31,23 @@ void M_MPRoomSelect(INT32 choice)
const UINT8 pid = 0;
(void) choice;
if (menucmd[pid].dpad_lr)
{
mpmenu.room = (!mpmenu.room) ? 1 : 0;
S_StartSound(NULL, sfx_s3k5b);
M_SetMenuDelay(pid);
}
else if (M_MenuBackPressed(pid))
if (M_MenuBackPressed(pid))
{
M_GoBack(0);
M_SetMenuDelay(pid);
}
else if (M_MenuConfirmPressed(pid))
{
M_ServersMenu(0);
M_SetMenuDelay(pid);
}
else if (mpmenu.roomforced == false
&& menucmd[pid].dpad_lr != 0)
{
mpmenu.room ^= 1;
S_StartSound(NULL, sfx_s3k5b);
M_SetMenuDelay(pid);
}
}
void M_MPRoomSelectTick(void)
@ -57,7 +58,8 @@ void M_MPRoomSelectTick(void)
void M_MPRoomSelectInit(INT32 choice)
{
(void)choice;
mpmenu.room = 0;
mpmenu.room = (modifiedgame == true) ? 1 : 0;
mpmenu.roomforced = ((modifiedgame == true) || (!M_SecretUnlocked(SECRET_ADDONS, true)));
mpmenu.ticker = 0;
mpmenu.servernum = 0;
mpmenu.scrolln = 0;

View file

@ -3,6 +3,7 @@
#include "../../k_menu.h"
#include "../../k_grandprix.h" // K_CanChangeRules
#include "../../m_cond.h"
#include "../../s_sound.h"
// ESC pause menu
@ -136,7 +137,11 @@ void M_OpenPauseMenu(void)
PAUSE_Main[mpause_switchmap].status = IT_STRING | IT_CALL;
PAUSE_Main[mpause_restartmap].status = IT_STRING | IT_CALL;
PAUSE_Main[mpause_addons].status = IT_STRING | IT_CALL;
if (M_SecretUnlocked(SECRET_ADDONS, true))
{
PAUSE_Main[mpause_addons].status = IT_STRING | IT_CALL;
}
}
}
else if (!netgame && !demo.playback)