1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Merge pull request #2235 from IvanSavenko/hota_h3m_support

Hota h3m support
This commit is contained in:
Ivan Savenko
2023-06-23 13:32:10 +03:00
committed by GitHub
104 changed files with 2788 additions and 2007 deletions

View File

@ -270,14 +270,14 @@ void CPlayerInterface::acceptTurn()
auto daysWithoutCastle = optDaysWithoutCastle.value();
if (daysWithoutCastle < 6)
{
text.addTxt(MetaString::ARRAY_TXT,128); //%s, you only have %d days left to capture a town or you will be banished from this land.
text.addReplacement(MetaString::COLOR, playerColor.getNum());
text.addReplacement(7 - daysWithoutCastle);
text.appendLocalString(EMetaText::ARRAY_TXT,128); //%s, you only have %d days left to capture a town or you will be banished from this land.
text.replaceLocalString(EMetaText::COLOR, playerColor.getNum());
text.replaceNumber(7 - daysWithoutCastle);
}
else if (daysWithoutCastle == 6)
{
text.addTxt(MetaString::ARRAY_TXT,129); //%s, this is your last day to capture a town or you will be banished from this land.
text.addReplacement(MetaString::COLOR, playerColor.getNum());
text.appendLocalString(EMetaText::ARRAY_TXT,129); //%s, this is your last day to capture a town or you will be banished from this land.
text.replaceLocalString(EMetaText::COLOR, playerColor.getNum());
}
showInfoDialogAndWait(components, text);
@ -1048,8 +1048,7 @@ void CPlayerInterface::showInfoDialogAndWait(std::vector<Component> & components
{
EVENT_HANDLER_CALLED_BY_CLIENT;
std::string str;
text.toString(str);
std::string str = text.toString();
showInfoDialog(EInfoWindowMode::MODAL, str, components, 0);
waitWhileDialog();
@ -1586,9 +1585,9 @@ void CPlayerInterface::gameOver(PlayerColor player, const EVictoryLossCheckResul
{
if (victoryLossCheckResult.loss() && cb->getPlayerStatus(playerID) == EPlayerStatus::INGAME) //enemy has lost
{
std::string str = victoryLossCheckResult.messageToSelf;
boost::algorithm::replace_first(str, "%s", CGI->generaltexth->capColors[player.getNum()]);
showInfoDialog(str, std::vector<std::shared_ptr<CComponent>>(1, std::make_shared<CComponent>(CComponent::flag, player.getNum(), 0)));
MetaString message = victoryLossCheckResult.messageToSelf;
message.appendLocalString(EMetaText::COLOR, player.getNum());
showInfoDialog(message.toString(), std::vector<std::shared_ptr<CComponent>>(1, std::make_shared<CComponent>(CComponent::flag, player.getNum(), 0)));
}
}
}