From 44df9358dd37bec003674e44141441165dba1ee1 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Fri, 19 Aug 2016 22:18:43 -0700 Subject: [PATCH] If the game becomes modified during a record attack run, end it RA menu can be opened if the game is modified, but Start can't be selected. (Obvious reason: so scripts to display info can be used easier) Fixed the stupid background for messages in the Record Attack menu, it was bugging me --- src/g_game.c | 4 ++++ src/m_menu.c | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 8931f8b6..f891b010 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -711,6 +711,10 @@ void G_SetGameModified(boolean silent) if (!silent) CONS_Alert(CONS_NOTICE, M_GetText("Game must be restarted to record statistics.\n")); + + // If in record attack recording, cancel it. + if (modeattacking) + M_EndModeAttackRun(); } /** Builds an original game map name from a map number. diff --git a/src/m_menu.c b/src/m_menu.c index 6c129444..78c38127 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -705,7 +705,7 @@ static menuitem_t SP_TimeAttackMenu[] = {IT_DISABLED, NULL, "Guest Option...", &SP_GuestReplayDef, 100}, {IT_DISABLED, NULL, "Replay...", &SP_ReplayDef, 110}, {IT_DISABLED, NULL, "Ghosts...", &SP_GhostDef, 120}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_ChooseTimeAttack, 130}, + {IT_WHITESTRING|IT_CALL|IT_CALL_NOTMODIFIED, NULL, "Start", M_ChooseTimeAttack, 130}, }; enum @@ -797,7 +797,7 @@ static menuitem_t SP_NightsAttackMenu[] = {IT_DISABLED, NULL, "Guest Option...", &SP_NightsGuestReplayDef, 108}, {IT_DISABLED, NULL, "Replay...", &SP_NightsReplayDef, 118}, {IT_DISABLED, NULL, "Ghosts...", &SP_NightsGhostDef, 128}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_ChooseNightsAttack, 138}, + {IT_WHITESTRING|IT_CALL|IT_CALL_NOTMODIFIED, NULL, "Start", M_ChooseNightsAttack, 138}, }; enum @@ -3702,6 +3702,11 @@ static void M_DrawMessageMenu(void) mlines = currentMenu->lastOn>>8; max = (INT16)((UINT8)(currentMenu->lastOn & 0xFF)*8); + + // hack: draw RA background in RA menus + if (gamestate == GS_TIMEATTACK) + V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); + M_DrawTextBox(currentMenu->x, y - 8, (max+7)>>3, mlines); while (*(msg+start)) @@ -4310,9 +4315,9 @@ static void M_SinglePlayerMenu(INT32 choice) { (void)choice; SP_MainMenu[sprecordattack].status = - (M_SecretUnlocked(SECRET_RECORDATTACK)) ? IT_CALL|IT_STRING|IT_CALL_NOTMODIFIED : IT_SECRET; + (M_SecretUnlocked(SECRET_RECORDATTACK)) ? IT_CALL|IT_STRING : IT_SECRET; SP_MainMenu[spnightsmode].status = - (M_SecretUnlocked(SECRET_NIGHTSMODE)) ? IT_CALL|IT_STRING|IT_CALL_NOTMODIFIED : IT_SECRET; + (M_SecretUnlocked(SECRET_NIGHTSMODE)) ? IT_CALL|IT_STRING : IT_SECRET; M_SetupNextMenu(&SP_MainDef); }