1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Hero experience tooltip will now be shown correctly despite of its type (bug #99)

This commit is contained in:
DjWarmonger
2009-10-27 20:40:11 +00:00
parent f22570712e
commit 2c77785bc7
2 changed files with 6 additions and 4 deletions

View File

@@ -231,9 +231,11 @@ void CHeroWindow::setHero(const CGHeroInstance *hero)
secSkillAreas[g]->hoverText = std::string(bufor); secSkillAreas[g]->hoverText = std::string(bufor);
} }
//printing experience //printing experience - original foramt does not support ui64
sprintf(bufor, CGI->generaltexth->allTexts[2].c_str(), hero->level, CGI->heroh->reqExp(hero->level+1), hero->exp); expArea->text = CGI->generaltexth->allTexts[2].c_str();
expArea->text = std::string(bufor); boost::replace_first(expArea->text, "%d", boost::lexical_cast<std::string>(hero->level));
boost::replace_first(expArea->text, "%d", boost::lexical_cast<std::string>(CGI->heroh->reqExp(hero->level+1)));
boost::replace_first(expArea->text, "%d", boost::lexical_cast<std::string>(hero->exp));
//printing spell points //printing spell points
sprintf(bufor, CGI->generaltexth->allTexts[205].c_str(), hero->name.c_str(), hero->mana, hero->manaLimit()); sprintf(bufor, CGI->generaltexth->allTexts[205].c_str(), hero->name.c_str(), hero->mana, hero->manaLimit());

View File

@@ -218,7 +218,7 @@ public:
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
CHero * type; CHero * type;
ui64 exp; //experience point ui64 exp; //experience points
si32 level; //current level of hero si32 level; //current level of hero
std::string name; //may be custom std::string name; //may be custom
std::string biography; //if custom std::string biography; //if custom