Fixed displaying unsolved challenges

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4143 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2009-10-20 21:14:13 +00:00
parent f65ec54fc2
commit 018e6b3ba7
3 changed files with 23 additions and 2 deletions

View File

@ -348,3 +348,18 @@ bool UnlockManager::isLocked(const std::string& feature)
{
return m_locked_features.find(feature)!=m_locked_features.end();
} // featureIsLocked
//-----------------------------------------------------------------------------
const std::vector<const Challenge*> UnlockManager::getUnlockedFeatures()
{
std::vector<const Challenge*> out;
for(AllChallengesType::const_iterator i =m_all_challenges.begin();
i!=m_all_challenges.end(); i++)
{
if (i->second->isSolved()) out.push_back(i->second);
}
return out;
}

View File

@ -47,9 +47,15 @@ public:
void save ();
std::vector<const Challenge*>
getActiveChallenges();
/** Returns the list of recently unlocked features (e.g. call at the end of a
race to know if any features were unlocked) */
const std::vector<const Challenge*>
getUnlockedFeatures() {return m_unlocked_features;}
getRecentlyUnlockedFeatures() {return m_unlocked_features;}
const std::vector<const Challenge*> getUnlockedFeatures();
void clearUnlocked () {m_unlocked_features.clear(); }
void raceFinished ();
void grandPrixFinished ();

View File

@ -51,7 +51,7 @@ RaceOverDialog::RaceOverDialog(const float percentWidth, const float percentHeig
const int margin_between_buttons = 12;
const int buttons_y_from = m_area.getHeight() - 3*(button_h + margin_between_buttons);
if (unlock_manager->getUnlockedFeatures().size()>0)
if (unlock_manager->getRecentlyUnlockedFeatures().size()>0)
{
// TODO: unlocked features
}