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

Renamed MetaString methods to more logical names

This commit is contained in:
Ivan Savenko
2023-06-18 12:18:25 +03:00
parent 2636a0dcc3
commit 56d69e790b
32 changed files with 592 additions and 557 deletions

View File

@@ -173,7 +173,7 @@ BattleHex Unit::occupiedHex(BattleHex assumedPos, bool twoHex, ui8 side)
}
}
void Unit::addText(MetaString & text, ui8 type, int32_t serial, const boost::logic::tribool & plural) const
void Unit::addText(MetaString & text, EMetaText type, int32_t serial, const boost::logic::tribool & plural) const
{
if(boost::logic::indeterminate(plural))
serial = VLC->generaltexth->pluralText(serial, getCount());
@@ -182,17 +182,17 @@ void Unit::addText(MetaString & text, ui8 type, int32_t serial, const boost::log
else
serial = VLC->generaltexth->pluralText(serial, 1);
text.addTxt(type, serial);
text.appendLocalString(type, serial);
}
void Unit::addNameReplacement(MetaString & text, const boost::logic::tribool & plural) const
{
if(boost::logic::indeterminate(plural))
text.addCreReplacement(creatureId(), getCount());
text.replaceCreatureName(creatureId(), getCount());
else if(plural)
text.addReplacement(MetaString::CRE_PL_NAMES, creatureIndex());
text.replaceLocalString(EMetaText::CRE_PL_NAMES, creatureIndex());
else
text.addReplacement(MetaString::CRE_SING_NAMES, creatureIndex());
text.replaceLocalString(EMetaText::CRE_SING_NAMES, creatureIndex());
}
std::string Unit::formatGeneralMessage(const int32_t baseTextId) const
@@ -200,8 +200,8 @@ std::string Unit::formatGeneralMessage(const int32_t baseTextId) const
const int32_t textId = VLC->generaltexth->pluralText(baseTextId, getCount());
MetaString text;
text.addTxt(MetaString::GENERAL_TXT, textId);
text.addCreReplacement(creatureId(), getCount());
text.appendLocalString(EMetaText::GENERAL_TXT, textId);
text.replaceCreatureName(creatureId(), getCount());
return text.toString();
}