mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Fix delayed notification of NDM unlock
No Death Mode is intended to be unlocked by getting at least S-rank in at least 4 time trials. Before 2.3, completing a time trial put you at the main menu, so you would always be notified of having unlocked No Death Mode once you went to the play menu again. But since 2.3, completing a time trial puts you back at the Time Trial selection screen, which isn't the play menu, so you would need to back all the way out first in order to get the notification. And since you don't actually unlock No Death Mode until you see the notification, this would be required to be able to play No Death Mode. To fix this, I decided to do something a bit kludge-y and just re-use the code to check and unlock No Death Mode when the player presses ACTION on the Time Trial complete screen (and there's also another path by pressing Escape). At least I put it in a function, so it's not a pure copy-paste, although it might as well be. I don't have time to think of a proper solution, but it would probably involve disentangling unlock notifications from Menu::play, for starters. But that's for later.
This commit is contained in:
@@ -6206,6 +6206,7 @@ void Game::returnmenu(void)
|
||||
{
|
||||
music.play(Music_PRESENTINGVVVVVV);
|
||||
}
|
||||
enum Menu::MenuName camefrom = currentmenuname;
|
||||
|
||||
MenuStackFrame& frame = menustack[menustack.size()-1];
|
||||
|
||||
@@ -6221,6 +6222,15 @@ void Game::returnmenu(void)
|
||||
{
|
||||
menustack.pop_back();
|
||||
}
|
||||
|
||||
/* FIXME: Even more horrible kludge! */
|
||||
if (camefrom == Menu::timetrialcomplete3)
|
||||
{
|
||||
if (can_unlock_ndm())
|
||||
{
|
||||
unlock_ndm();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Game::returntomenu(enum Menu::MenuName t)
|
||||
@@ -6858,20 +6868,9 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
||||
else
|
||||
{
|
||||
//Alright, we haven't unlocked any time trials. How about no death mode?
|
||||
temp = 0;
|
||||
if (bestrank[TimeTrial_SPACESTATION1] >= 2) temp++;
|
||||
if (bestrank[TimeTrial_LABORATORY] >= 2) temp++;
|
||||
if (bestrank[TimeTrial_TOWER] >= 2) temp++;
|
||||
if (bestrank[TimeTrial_SPACESTATION2] >= 2) temp++;
|
||||
if (bestrank[TimeTrial_WARPZONE] >= 2) temp++;
|
||||
if (bestrank[TimeTrial_FINALLEVEL] >= 2) temp++;
|
||||
if (temp >= 4 && !unlocknotify[Unlock_NODEATHMODE])
|
||||
if (can_unlock_ndm())
|
||||
{
|
||||
//Unlock No Death Mode
|
||||
unlocknotify[Unlock_NODEATHMODE] = true;
|
||||
unlock[Unlock_NODEATHMODE] = true;
|
||||
createmenu(Menu::unlocknodeathmode, true);
|
||||
savestatsandsettings();
|
||||
unlock_ndm();
|
||||
}
|
||||
//Alright then! Flip mode?
|
||||
else if (unlock[UnlockTrophy_GAME_COMPLETE]
|
||||
@@ -7078,6 +7077,26 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
||||
menuxoff = (320-menuwidth)/2;
|
||||
}
|
||||
|
||||
bool Game::can_unlock_ndm(void)
|
||||
{
|
||||
int temp = 0;
|
||||
if (bestrank[TimeTrial_SPACESTATION1] >= 2) temp++;
|
||||
if (bestrank[TimeTrial_LABORATORY] >= 2) temp++;
|
||||
if (bestrank[TimeTrial_TOWER] >= 2) temp++;
|
||||
if (bestrank[TimeTrial_SPACESTATION2] >= 2) temp++;
|
||||
if (bestrank[TimeTrial_WARPZONE] >= 2) temp++;
|
||||
if (bestrank[TimeTrial_FINALLEVEL] >= 2) temp++;
|
||||
return temp >= 4 && !unlocknotify[Unlock_NODEATHMODE];
|
||||
}
|
||||
|
||||
void Game::unlock_ndm(void)
|
||||
{
|
||||
unlocknotify[Unlock_NODEATHMODE] = true;
|
||||
unlock[Unlock_NODEATHMODE] = true;
|
||||
createmenu(Menu::unlocknodeathmode, true);
|
||||
savestatsandsettings();
|
||||
}
|
||||
|
||||
void Game::deletequick(void)
|
||||
{
|
||||
if (inspecial() || map.custommode)
|
||||
|
||||
Reference in New Issue
Block a user