diff --git a/src/challenges/story_mode_status.cpp b/src/challenges/story_mode_status.cpp index fefad60e1..c763c6973 100644 --- a/src/challenges/story_mode_status.cpp +++ b/src/challenges/story_mode_status.cpp @@ -70,7 +70,7 @@ void StoryModeStatus::addStatus(ChallengeStatus *cs) //----------------------------------------------------------------------------- bool StoryModeStatus::isLocked(const std::string& feature) { - if (UserConfigParams::m_everything_unlocked) + if (UserConfigParams::m_everything_unlocked > 0) return false; return m_locked_features.find(feature)!=m_locked_features.end(); diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp index 37703b16f..3cb33621d 100644 --- a/src/config/user_config.hpp +++ b/src/config/user_config.hpp @@ -1032,9 +1032,10 @@ namespace UserConfigParams PARAM_DEFAULT(BoolUserConfigParam(false, "debug_hide_gui", "Whether to hide the GUI (artist debug mode)")); - PARAM_PREFIX BoolUserConfigParam m_everything_unlocked - PARAM_DEFAULT( BoolUserConfigParam(false, "everything_unlocked", - "Enable all karts and tracks") ); + PARAM_PREFIX IntUserConfigParam m_everything_unlocked + PARAM_DEFAULT( IntUserConfigParam(0, "everything_unlocked", + "Enable all karts and tracks: 0 = disabled, " + "1 = everything except final race, 2 = everything") ); PARAM_PREFIX StringUserConfigParam m_commandline PARAM_DEFAULT( StringUserConfigParam("", "commandline", diff --git a/src/main.cpp b/src/main.cpp index 9de7c047d..85f85b0fd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1562,12 +1562,12 @@ int handleCmdLine(bool has_server_config, bool has_parent_process) if(CommandLine::has("--unlock-all")) { - UserConfigParams::m_everything_unlocked = true; + UserConfigParams::m_everything_unlocked = 2; } // --unlock-all if(CommandLine::has("--no-unlock-all")) { - UserConfigParams::m_everything_unlocked = false; + UserConfigParams::m_everything_unlocked = 0; } // --no-unlock-all if(CommandLine::has("--profile-time", &n)) diff --git a/src/main_android.cpp b/src/main_android.cpp index 8befb8790..d939f8a71 100644 --- a/src/main_android.cpp +++ b/src/main_android.cpp @@ -78,7 +78,7 @@ void override_default_params() // Make sure that user can play every track even if there are installed // only few tracks and it's impossible to finish overworld challenges - UserConfigParams::m_everything_unlocked = true; + UserConfigParams::m_everything_unlocked = 1; // Create default user istead of showing login screen to make life easier UserConfigParams::m_enforce_current_player = true; diff --git a/src/modes/overworld.cpp b/src/modes/overworld.cpp index 05499d52f..597ab78d5 100644 --- a/src/modes/overworld.cpp +++ b/src/modes/overworld.cpp @@ -264,7 +264,7 @@ void OverWorld::onFirePressed(Controller* who) #endif bool unlocked = enough_challenges && (PlayerManager::getCurrentPlayer()->getPoints() >= val); - if (UserConfigParams::m_everything_unlocked) + if (UserConfigParams::m_everything_unlocked > 0) unlocked = true; if (unlocked) diff --git a/src/scriptengine/script_challenges.cpp b/src/scriptengine/script_challenges.cpp index 615161a99..f32418768 100644 --- a/src/scriptengine/script_challenges.cpp +++ b/src/scriptengine/script_challenges.cpp @@ -61,7 +61,7 @@ namespace Scripting /** Get number of challenges that were completed at any difficulty */ int getCompletedChallengesCount() { - if (UserConfigParams::m_everything_unlocked) + if (UserConfigParams::m_everything_unlocked > 1) return getChallengeCount(); return ::Track::getCurrentTrack()->getNumOfCompletedChallenges(); @@ -86,7 +86,7 @@ namespace Scripting // -------------------------------------------------------------------- bool isChallengeUnlocked(std::string* challenge_name) { - if (UserConfigParams::m_everything_unlocked) + if (UserConfigParams::m_everything_unlocked > 0) return true; const ChallengeData* challenge = diff --git a/src/states_screens/race_gui_overworld.cpp b/src/states_screens/race_gui_overworld.cpp index 2a4fbc1e8..5893928ef 100644 --- a/src/states_screens/race_gui_overworld.cpp +++ b/src/states_screens/race_gui_overworld.cpp @@ -486,7 +486,7 @@ void RaceGUIOverworld::drawGlobalMiniMap() int state = (unlocked ? OPEN : LOCKED); - if (UserConfigParams::m_everything_unlocked) + if (UserConfigParams::m_everything_unlocked > 0) state = OPEN; const ChallengeStatus* c = PlayerManager::getCurrentPlayer() @@ -534,7 +534,7 @@ void RaceGUIOverworld::drawGlobalMiniMap() const unsigned int val = challenge->getNumTrophies(); bool unlocked = (PlayerManager::getCurrentPlayer()->getPoints() >= val); - if (UserConfigParams::m_everything_unlocked) + if (UserConfigParams::m_everything_unlocked > 0) unlocked = true; if (!unlocked)