1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Merge branch 'develop' into feature/nullkiller2

This commit is contained in:
Mircea TheHonestCTO
2025-10-28 22:30:39 +01:00
55 changed files with 484 additions and 159 deletions

View File

@@ -860,7 +860,7 @@ CBonusSystemNode & CGTownInstance::whatShouldBeAttached()
std::string CGTownInstance::getNameTranslated() const
{
return LIBRARY->generaltexth->translate(nameTextId);
return customName.empty() ? LIBRARY->generaltexth->translate(nameTextId) : customName;
}
std::string CGTownInstance::getNameTextID() const
@@ -873,6 +873,11 @@ void CGTownInstance::setNameTextId( const std::string & newName )
nameTextId = newName;
}
void CGTownInstance::setCustomName( const std::string & newName )
{
customName = newName;
}
const CArmedInstance * CGTownInstance::getUpperArmy() const
{
if(getGarrisonHero())

View File

@@ -46,6 +46,7 @@ class DLL_LINKAGE CGTownInstance : public CGDwelling, public IShipyard, public I
{
friend class CTownInstanceConstructor;
std::string nameTextId; // name of town
std::string customName;
std::map<BuildingID, TownRewardableBuildingInstance*> convertOldBuildings(std::vector<TownRewardableBuildingInstance*> oldVector);
std::set<BuildingID> builtBuildings;
@@ -75,6 +76,8 @@ public:
{
h & static_cast<CGDwelling&>(*this);
h & nameTextId;
if (h.version >= Handler::Version::CUSTOM_NAMES)
h & customName;
h & built;
h & destroyed;
h & identifier;
@@ -128,6 +131,7 @@ public:
std::string getNameTranslated() const;
std::string getNameTextID() const;
void setNameTextId(const std::string & newName);
void setCustomName(const std::string & newName);
//////////////////////////////////////////////////////////////////////////

View File

@@ -66,7 +66,7 @@ void ObjectTemplate::afterLoadFixup()
if(id == Obj::EVENT)
{
setSize(1,1);
usedTiles[0][0] = VISITABLE;
usedTiles[0][0] = VISITABLE | VISIBLE;
visitDir = 0xFF;
}
}