mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Fix preserveCountSuffix if no parentheses are present
This commit is contained in:
@@ -1676,9 +1676,12 @@ void CObjectListWindow::trimTextIfTooWide(std::string & text, bool preserveCount
|
|||||||
{
|
{
|
||||||
auto posBrace = text.find_last_of("(");
|
auto posBrace = text.find_last_of("(");
|
||||||
auto posClosing = text.find_last_of(")");
|
auto posClosing = text.find_last_of(")");
|
||||||
std::string objCount = text.substr(posBrace, posClosing - posBrace) + ')';
|
if (posBrace != std::string::npos && posClosing != std::string::npos && posClosing > posBrace)
|
||||||
suffix += " ";
|
{
|
||||||
suffix += objCount;
|
std::string objCount = text.substr(posBrace, posClosing - posBrace) + ')';
|
||||||
|
suffix += " ";
|
||||||
|
suffix += objCount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto & font = ENGINE->renderHandler().loadFont(FONT_SMALL);
|
const auto & font = ENGINE->renderHandler().loadFont(FONT_SMALL);
|
||||||
|
|||||||
Reference in New Issue
Block a user