1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Refactoring of hoverText from objects:

- removed hoverText field
- split getHoverText() method into 3:
- - getObjectName() for generic name
- - getHoverText(Player) for player-specific text
- - getHoverText(Hero) for hero-specific strings
This commit is contained in:
Ivan Savenko
2014-06-24 20:39:36 +03:00
parent ad632d1e8a
commit a0689fa377
37 changed files with 212 additions and 251 deletions

View File

@@ -55,7 +55,7 @@ void CGDwelling::initObj()
}
}
void CGDwelling::setProperty(ui8 what, ui32 val)
void CGDwelling::setPropertyDer(ui8 what, ui32 val)
{
switch (what)
{
@@ -77,8 +77,8 @@ void CGDwelling::setProperty(ui8 what, ui32 val)
creatures[0].second[0] = CreatureID(val);
break;
}
CGObjectInstance::setProperty(what,val);
}
void CGDwelling::onHeroVisit( const CGHeroInstance * h ) const
{
if(ID == Obj::REFUGEE_CAMP && !creatures[0].first) //Refugee Camp, no available cres
@@ -523,11 +523,15 @@ void CGTownInstance::onHeroLeave(const CGHeroInstance * h) const
cb->stopHeroVisitCastle(this, h);
}
std::string CGTownInstance::getObjectName() const
{
return name + ", " + town->faction->name;
}
void CGTownInstance::initObj()
///initialize town structures
{
blockVisit = true;
hoverName = name + ", " + town->faction->name;
if (subID == ETownType::DUNGEON)
creatures.resize(GameConstants::CREATURES_PER_TOWN+1);//extra dwelling for Dungeon