1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Win/loss condition texts use MetaString

This commit is contained in:
Ivan Savenko
2023-06-18 13:51:11 +03:00
parent 56d69e790b
commit d51fe62804
16 changed files with 230 additions and 180 deletions

View File

@@ -5790,12 +5790,8 @@ void CGameHandler::checkVictoryLossConditionsForPlayer(PlayerColor player)
void CGameHandler::getVictoryLossMessage(PlayerColor player, const EVictoryLossCheckResult & victoryLossCheckResult, InfoWindow & out) const
{
out.player = player;
out.text.clear();
out.text.appendRawString(VLC->generaltexth->translate(victoryLossCheckResult.messageToOthers));
// hackish, insert one player-specific string, if applicable
if (victoryLossCheckResult.messageToOthers.find("%s") != std::string::npos)
out.text.replaceLocalString(EMetaText::COLOR, player.getNum());
out.text = victoryLossCheckResult.messageToOthers;
out.text.replaceLocalString(EMetaText::COLOR, player.getNum());
out.components.emplace_back(Component::EComponentType::FLAG, player.getNum(), 0, 0);
}