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

Merge pull request #6211 from Laserlicht/text_edit

Allowing editing town name
This commit is contained in:
Ivan Savenko
2025-10-28 15:33:50 +02:00
committed by GitHub
28 changed files with 265 additions and 58 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())