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

MetaString refactor to eliminate integer usage for identifiers

- entity names are now stored and serialized as text ID's
- added helper methods for convenience to get entities names to
metastring
This commit is contained in:
Ivan Savenko
2023-11-02 22:01:49 +02:00
parent f4feaea177
commit 86a3806bec
22 changed files with 185 additions and 158 deletions

View File

@@ -462,7 +462,7 @@ void BattleResultProcessor::endBattleConfirm(const CBattleInfoCallback & battle)
auto it = cs.spells.begin();
for (int i = 0; i < cs.spells.size(); i++, it++)
{
iw.text.replaceLocalString(EMetaText::SPELL_NAME, it->toEnum());
iw.text.replaceName(*it);
if (i == cs.spells.size() - 2) //we just added pre-last name
iw.text.replaceLocalString(EMetaText::GENERAL_TXT, 141); // " and "
iw.components.emplace_back(ComponentType::SPELL, *it);