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

Alignment

This commit is contained in:
Laserlicht
2023-09-12 16:13:35 +02:00
parent dd4c95bd04
commit d948cb72a0
2 changed files with 12 additions and 1 deletions

View File

@@ -147,7 +147,17 @@ std::vector<std::string> CMessage::breakText( std::string text, size_t maxLineWi
/* We don't count braces in string length. */
if (text[currPos] == '{')
{
opened=true;
std::smatch match;
std::regex expr("^\\{#([0-9a-fA-F]{6})$");
std::string tmp = text.substr(currPos, 8);
if(std::regex_search(tmp, match, expr))
{
currPos += 7;
}
}
else if (text[currPos]=='}')
opened=false;
else