Achievements progress now actually gets saved.. how cool is that?

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13634 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
unitraxx 2013-09-05 23:20:39 +00:00
parent d6f6383833
commit c67c5a6fb1
4 changed files with 13 additions and 8 deletions

View File

@ -75,6 +75,8 @@ void Achievement::check()
SingleAchievement::SingleAchievement(const AchievementInfo * info)
: Achievement(info)
{
m_progress = 0;
m_achieved = false;
}
// ============================================================================

View File

@ -77,7 +77,6 @@ public:
virtual ~MapAchievementInfo () {};
int getGoalValue (const std::string & key) { return m_goal_values[key];}
virtual bool checkCompletion (Achievement * achievement) const;
virtual Achievement::AchievementType getType() const { return Achievement::AT_MAP; };
}; // class MapAchievementInfo

View File

@ -152,14 +152,18 @@ void AchievementsManager::createSlotsIfNeeded()
}
}
if(something_changed) save();
if(something_changed){
Log::warn("AchievementsManager::save",
"errueeeur");
save();
}
} // UnlockManager::createSlotsIfNeeded
// ============================================================================
void AchievementsManager::save()
{
std::string filename = file_manager->getConfigFile("challenges.xml");
std::string filename = file_manager->getConfigFile("achievements.xml");
std::ofstream achievements_file(filename.c_str(), std::ios::out);

View File

@ -1367,7 +1367,6 @@ int main(int argc, char *argv[] )
file_manager->getGUIDir() + "options_video.png") );
kart_properties_manager -> loadAllKarts ();
unlock_manager = new UnlockManager();
AchievementsManager::get();
//m_tutorial_manager = new TutorialManager();
GUIEngine::addLoadingIcon( irr_driver->getTexture(
file_manager->getTextureFile("gui_lock.png")) );
@ -1524,6 +1523,7 @@ int main(int argc, char *argv[] )
// Go straight to the race
StateManager::get()->enterGameState();
}
AchievementsManager::get();
// If an important news message exists it is shown in a popup dialog.