From 4d62fbf50991777e668faaff02024c5c9de85899 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 4 Mar 2018 18:42:06 -0500 Subject: [PATCH] Unlock all cheat no longer sets game modified if it can't find anything to unlock Sound test is also in the Options menu now. --- src/m_cheat.c | 20 ++++++++++++++++---- src/m_cond.c | 2 -- src/m_menu.c | 15 +++++++++++++-- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index f7476fca..fed76edd 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -75,6 +75,7 @@ typedef struct static UINT8 cheatf_warp(void) { UINT8 i; + boolean success = false; /*if (modifiedgame) return 0;*/ @@ -82,12 +83,23 @@ static UINT8 cheatf_warp(void) if (menuactive && currentMenu != &MainDef) return 0; // Only on the main menu! - S_StartSound(0, sfx_kc42); - // Temporarily unlock EVERYTHING. - G_SetGameModified(false); for (i = 0; i < MAXUNLOCKABLES; i++) - unlockables[i].unlocked = true; + { + if (!unlockables[i].conditionset) + continue; + if (!unlockables[i].unlocked) + { + unlockables[i].unlocked = true; + success = true; + } + } + + if (success) + { + G_SetGameModified(false); + S_StartSound(0, sfx_kc42); + } // Refresh secrets menu existing. M_ClearMenus(true); diff --git a/src/m_cond.c b/src/m_cond.c index 2dfb502a..72932365 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -117,8 +117,6 @@ unlockable_t unlockables[MAXUNLOCKABLES] = /* 02 */ {"Chaotic Kart Cup", "Collect 15 Emblems", 0, 2, SECRET_NONE, 0, false, false, 0}, /* 03 */ {"Record Attack", "", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0}, - /* 04 */ {"Play Credits", "", 10, -1, SECRET_CREDITS, 0, true, true, 0}, - /* 05 */ {"Sound Test", "", 20, -1, SECRET_SOUNDTEST, 0, true, true, 0}, }; // Default number of emblems and extra emblems diff --git a/src/m_menu.c b/src/m_menu.c index 1775dc9e..6c5e71f1 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1042,7 +1042,7 @@ static menuitem_t OP_MainMenu[] = {IT_SUBMENU | IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 80}, {IT_CALL | IT_STRING, NULL, "Play Credits", M_Credits, 100}, - //{IT_KEYHANDLER | IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 110}, + {IT_KEYHANDLER | IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 110}, }; static menuitem_t OP_ControlsMenu[] = @@ -1792,7 +1792,18 @@ menu_t MP_PlayerSetupDef = }; // Options -menu_t OP_MainDef = DEFAULTMENUSTYLE("M_OPTTTL", OP_MainMenu, &MainDef, 60, 30); +menu_t OP_MainDef = +{ + "M_OPTTTL", + sizeof (OP_MainMenu)/sizeof (menuitem_t), + &MainDef, + OP_MainMenu, + M_DrawSkyRoom, + 60, 30, + 0, + NULL +}; + menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30); //menu_t OP_ControlListDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlListMenu, &OP_ControlsDef, 60, 30); menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlsDef);