1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Factor out Secret Lab/Time Trial/NDM conds to function

They are now factored out to an inline function named incompetitive().
This is so their usage can be changed without having to change each
individual one in every place. This also clarifies the intent of using
these conditionals (they are for when we're in a "competitive" mode).
This commit is contained in:
Misa 2021-05-03 18:22:59 -07:00 committed by Ethan Lee
parent 9f603ea3fe
commit 96488d27c8
2 changed files with 9 additions and 4 deletions

View file

@ -6060,8 +6060,8 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
#if !defined(MAKEANDPLAY)
option("unlock play modes");
#endif
option("invincibility", !ingame_titlemode || (!insecretlab && !intimetrial && !nodeathmode));
option("slowdown", !ingame_titlemode || (!insecretlab && !intimetrial && !nodeathmode));
option("invincibility", !ingame_titlemode || !incompetitive());
option("slowdown", !ingame_titlemode || !incompetitive());
option("animated backgrounds");
option("screen effects");
option("text outline");
@ -6805,3 +6805,8 @@ int Game::get_timestep(void)
return 34;
}
}
bool Game::incompetitive(void)
{
return insecretlab || intimetrial || nodeathmode;
}

View file

@ -636,7 +636,7 @@ static void menuactionpress(void)
#endif
if (game.currentmenuoption == accessibilityoffset + 0) {
//invincibility
if (!game.ingame_titlemode || (!game.insecretlab && !game.intimetrial && !game.nodeathmode))
if (!game.ingame_titlemode || !game.incompetitive())
{
if (!map.invincibility)
{
@ -658,7 +658,7 @@ static void menuactionpress(void)
}
else if (game.currentmenuoption == accessibilityoffset + 1) {
//change game speed
if (!game.ingame_titlemode || (!game.insecretlab && !game.intimetrial && !game.nodeathmode))
if (!game.ingame_titlemode || !game.incompetitive())
{
game.createmenu(Menu::setslowdown);
map.nexttowercolour();