Improve LOd on ferns

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9282 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2011-07-16 19:40:44 +00:00
parent c9e1413c1d
commit a7c9d88a4d
2 changed files with 25 additions and 3 deletions

View File

@@ -64,6 +64,25 @@ void ChallengesScreen::onUpdate(float elapsed_time, irr::video::IVideoDriver*)
// ------------------------------------------------------------------------------------------------------
void ChallengesScreen::beforeAddingWidget()
{
DynamicRibbonWidget* w = this->getWidget<DynamicRibbonWidget>("challenges");
assert( w != NULL );
const std::vector<const ChallengeData*>& activeChallenges = unlock_manager->getActiveChallenges();
const std::vector<const ChallengeData*>& solvedChallenges = unlock_manager->getUnlockedFeatures();
const std::vector<const ChallengeData*>& lockedChallenges = unlock_manager->getLockedChallenges();
const int activeChallengeAmount = activeChallenges.size();
const int solvedChallengeAmount = solvedChallenges.size();
const int lockedChallengeAmount = lockedChallenges.size();
w->setItemCountHint(activeChallengeAmount + solvedChallengeAmount + lockedChallengeAmount);
}
// ------------------------------------------------------------------------------------------------------
void ChallengesScreen::init()
{
Screen::init();

View File

@@ -43,13 +43,16 @@ public:
virtual void loadedFromFile();
/** \brief implement optional callback from parent class GUIEngine::Screen */
void onUpdate(float dt, irr::video::IVideoDriver*);
virtual void onUpdate(float dt, irr::video::IVideoDriver*);
/** \brief implement callback from parent class GUIEngine::Screen */
void init();
virtual void beforeAddingWidget();
/** \brief implement callback from parent class GUIEngine::Screen */
void eventCallback(GUIEngine::Widget* widget, const std::string& name, const int playerID);
virtual void init();
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name, const int playerID);
};
#endif