Minor changes (nothing visible)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4147 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2009-10-21 22:51:23 +00:00
parent 77ff213440
commit 1d64a45e79
5 changed files with 43 additions and 9 deletions

View File

@@ -361,5 +361,18 @@ const std::vector<const Challenge*> UnlockManager::getUnlockedFeatures()
return out;
}
//-----------------------------------------------------------------------------
const std::vector<const Challenge*> UnlockManager::getLockedChallenges()
{
std::vector<const Challenge*> out;
for(AllChallengesType::const_iterator i =m_all_challenges.begin();
i!=m_all_challenges.end(); i++)
{
if (!i->second->isSolved() && !i->second->isActive()) out.push_back(i->second);
}
return out;
}

View File

@@ -53,10 +53,15 @@ public:
const std::vector<const Challenge*>
getRecentlyUnlockedFeatures() {return m_unlocked_features;}
/** Clear the list of recently unlocked challenges */
void clearUnlocked () {m_unlocked_features.clear(); }
/** Returns a complete list of all solved challenges */
const std::vector<const Challenge*> getUnlockedFeatures();
/** Returns the list of currently inaccessible (locked) challenges */
const std::vector<const Challenge*> getLockedChallenges();
void clearUnlocked () {m_unlocked_features.clear(); }
void raceFinished ();
void grandPrixFinished ();
void unlockFeature (Challenge* c, bool do_save=true);

View File

@@ -444,7 +444,7 @@ void EventHandler::navigateDown(const int playerID, Input::InputType type, const
Widget* w = (el == NULL) ? NULL : GUIEngine::getWidget( el->getID() );
std::cout << "!!! Player " << playerID << " navigating down of " << w->m_element->getID() << std::endl;
//std::cout << "!!! Player " << playerID << " navigating down of " << w->m_element->getID() << std::endl;
// list widgets are a bit special, because up/down keys are also used
// to navigate between various list items, not only to navigate between
@@ -482,7 +482,7 @@ void EventHandler::navigateDown(const int playerID, Input::InputType type, const
if (el != NULL && el->getTabGroup() != NULL &&
el->getTabGroup()->getNextElement(el->getTabOrder(), false, false, first, closest))
{
std::cout << "!!! Player " << playerID << " navigating to " << closest->getID() << std::endl;
// std::cout << "!!! Player " << playerID << " navigating to " << closest->getID() << std::endl;
if (playerID == 0)
{
@@ -496,7 +496,7 @@ void EventHandler::navigateDown(const int playerID, Input::InputType type, const
}
else
{
std::cout << "!!! Player " << playerID << " cannot navigating down, no next widget found;\n";
//std::cout << "!!! Player " << playerID << " cannot navigating down, no next widget found;\n";
// select the first widget
Widget* w = NULL;

View File

@@ -40,6 +40,7 @@ Item::Item(ItemType type, const Vec3& xyz, const Vec3& normal,
m_node = irr_driver->addMesh(mesh);
// If lighting would be enabled certain items (esp. bananas)
// don't look smooth, so for now generally disable lighting
// FIXME : re-export models with normals instead
m_node->setMaterialFlag(video::EMF_LIGHTING, false);
m_node->setPosition(xyz.toIrrVector());
m_node->grab();

View File

@@ -20,6 +20,7 @@
#include "challenges/unlock_manager.hpp"
#include "states_screens/state_manager.hpp"
#include "utils/translation.hpp"
#include <fstream>
@@ -53,17 +54,20 @@ namespace GUIEngine
// Re-build track list everytime (accounts for locking changes, etc.)
w->clearItems();
const std::vector<const Challenge*>& challenges = unlock_manager->getActiveChallenges();
const std::vector<const Challenge*>& activeChallenges = unlock_manager->getActiveChallenges();
const std::vector<const Challenge*>& solvedChallenges = unlock_manager->getUnlockedFeatures();
const std::vector<const Challenge*>& lockedChallenges = unlock_manager->getLockedChallenges();
const int challengeAmount = challenges.size();
const int activeChallengeAmount = activeChallenges.size();
const int solvedChallengeAmount = solvedChallenges.size();
const int lockedChallengeAmount = lockedChallenges.size();
char buffer[64];
for (int n=0; n<challengeAmount; n++)
for (int n=0; n<activeChallengeAmount; n++)
{
// TODO : temporary icon until we have a 'unsolved challenge' icon
sprintf(buffer, "challenge%i", n);
w->addItem(challenges[n]->getName() + L"\n" + challenges[n]->getChallengeDescription(),
w->addItem(activeChallenges[n]->getName() + L"\n" + activeChallenges[n]->getChallengeDescription(),
buffer, file_manager->getTextureFile("speedback.png"));
}
for (int n=0; n<solvedChallengeAmount; n++)
@@ -72,6 +76,13 @@ namespace GUIEngine
sprintf(buffer, "solved%i", n);
w->addItem(solvedChallenges[n]->getName(), buffer, file_manager->getTextureFile("cup_gold.png"));
}
for (int n=0; n<lockedChallengeAmount; n++)
{
w->addItem( _("Locked : solve active challenges to gain access to more!"), "locked",
file_manager->getTextureFile("gui_lock.png"));
}
w->updateItemDisplay();
}
@@ -82,10 +93,14 @@ namespace GUIEngine
void ChallengesScreen::eventCallback(GUIEngine::Widget* widget, const std::string& name)
{
if(name == "back")
if (name == "back")
{
StateManager::get()->escapePressed();
}
else if (name == "locked")
{
unlock_manager->playLockSound();
}
}
} // end namespace