1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

make town title editable

This commit is contained in:
Laserlicht
2025-10-05 01:49:00 +02:00
parent da79b27547
commit f5d1657041
7 changed files with 120 additions and 14 deletions

View File

@@ -852,7 +852,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
@@ -865,6 +865,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())