1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-07 00:58:39 +02:00

* campaign against magic numbers

* ArtifactID was misleading and wrongly used in one place -- renamed and fixed
* minor changes
This commit is contained in:
mateuszb
2012-09-23 18:01:04 +00:00
parent 3fcba4fb5c
commit 6a81c8b1af
32 changed files with 567 additions and 511 deletions

View File

@ -240,7 +240,7 @@ void CGarrisonSlot::hover (bool on)
{
temp = CGI->generaltexth->tcommands[32]; //Select %s (visiting)
}
else if(owner->armedObjs[0] && owner->armedObjs[0]->ID == GameConstants::TOWNI_TYPE)
else if(owner->armedObjs[0] && owner->armedObjs[0]->ID == Obj::TOWN)
{
temp = CGI->generaltexth->tcommands[12]; //Select %s (in garrison)
}
@ -1405,7 +1405,7 @@ void CRecruitmentWindow::buy()
if(dstslot < 0 && !vstd::contains(CGI->arth->bigArtifacts,CGI->arth->convertMachineID(crid, true))) //no available slot
{
std::string txt;
if(dst->ID == GameConstants::HEROI_TYPE)
if(dst->ID == Obj::HERO)
{
txt = CGI->generaltexth->allTexts[425]; //The %s would join your hero, but there aren't enough provisions to support them.
boost::algorithm::replace_first(txt, "%s", slider->value > 1 ? CGI->creh->creatures[crid]->namePl : CGI->creh->creatures[crid]->nameSing);
@ -2433,7 +2433,7 @@ CMarketplaceWindow::CMarketplaceWindow(const IMarket *Market, const CGHeroInstan
std::string title;
if (market->o->ID == GameConstants::TOWNI_TYPE)
if (market->o->ID == Obj::TOWN)
{
switch (mode)
{
@ -5257,7 +5257,7 @@ CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, const IMarket
if ( market->o->ID == Obj::UNIVERSITY ) // this is adventure map university
titlePic = new CPicture("UNIVBLDG");
else
if (market->o->ID == GameConstants::TOWNI_TYPE)
if (market->o->ID == Obj::TOWN)
titlePic = new CAnimImage(CGI->townh->towns[ETownType::CONFLUX].clientInfo.buildingsIcons, EBuilding::MAGIC_UNIVERSITY);
else
tlog0<<"Error: Image for university was not found!\n";//This should not happen
@ -5835,9 +5835,9 @@ CIntObject * CRClickPopup::createInfoWin(Point position, const CGObjectInstance
switch(specific->ID)
{
case GameConstants::HEROI_TYPE:
case Obj::HERO:
return new CInfoBoxPopup(position, dynamic_cast<const CGHeroInstance *>(specific));
case GameConstants::TOWNI_TYPE:
case Obj::TOWN:
return new CInfoBoxPopup(position, dynamic_cast<const CGTownInstance *>(specific));
case Obj::GARRISON:
case Obj::GARRISON2: