From 833bbdbbefac7d0c3b32aa528f4ea14aba93f6cb Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 26 Apr 2020 12:43:30 -0700 Subject: [PATCH] Add function Game::anything_unlocked() This will be a useful shorthand to ask "do we have the Secret Lab, or any Time Trial, or Intermission replays, or No Death Mode, or Flip Mode unlocked?" --- desktop_version/src/Game.cpp | 17 +++++++++++++++++ desktop_version/src/Game.h | 1 + 2 files changed, 18 insertions(+) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 47810dd1..f2189baf 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -7313,3 +7313,20 @@ int Game::crewmates() } return temp; } + +bool Game::anything_unlocked() +{ + for (size_t i = 0; i < unlock.size(); i++) + { + if (unlock[i] && + (i == 8 // Secret Lab + || i >= 9 || i <= 14 // any Time Trial + || i == 16 // Intermission replays + || i == 17 // No Death Mode + || i == 18)) // Flip Mode + { + return true; + } + } + return false; +} diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index d69a813c..aa98fe16 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -286,6 +286,7 @@ public: std::vector unlock; std::vector unlocknotify; + bool anything_unlocked(); int stat_trinkets; bool fullscreen; int bestgamedeaths;