1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +02:00

Merge pull request #1478 from kambala-decapitator/units-huge-numbers

limit displayed units number to 4 digits
This commit is contained in:
Andrey Filipenkov
2023-01-25 17:47:08 +03:00
committed by GitHub
4 changed files with 4 additions and 4 deletions

View File

@@ -850,7 +850,7 @@ void StackQueue::StackBox::setUnit(const battle::Unit * unit, size_t turn)
if (unit->unitType()->idNumber == CreatureID::ARROW_TOWERS) if (unit->unitType()->idNumber == CreatureID::ARROW_TOWERS)
icon->setFrame(owner->getSiegeShooterIconID(), 1); icon->setFrame(owner->getSiegeShooterIconID(), 1);
amount->setText(CSDL_Ext::makeNumberShort(unit->getCount())); amount->setText(CSDL_Ext::makeNumberShort(unit->getCount(), 4));
if(stateIcon) if(stateIcon)
{ {

View File

@@ -318,7 +318,7 @@ void BattleStacksController::showStackAmountBox(Canvas & canvas, const CStack *
//blitting amount //blitting amount
Point textPos = stackAnimation[stack->ID]->pos.topLeft() + amountBG->dimensions()/2 + Point(xAdd, yAdd); Point textPos = stackAnimation[stack->ID]->pos.topLeft() + amountBG->dimensions()/2 + Point(xAdd, yAdd);
canvas.drawText(textPos, EFonts::FONT_TINY, Colors::WHITE, ETextAlignment::CENTER, CSDL_Ext::makeNumberShort(stack->getCount())); canvas.drawText(textPos, EFonts::FONT_TINY, Colors::WHITE, ETextAlignment::CENTER, CSDL_Ext::makeNumberShort(stack->getCount(), 4));
} }
void BattleStacksController::showStack(Canvas & canvas, const CStack * stack) void BattleStacksController::showStack(Canvas & canvas, const CStack * stack)

View File

@@ -378,7 +378,7 @@ void CGarrisonSlot::update()
creatureImage->setFrame(creature->getIconIndex()); creatureImage->setFrame(creature->getIconIndex());
stackCount->enable(); stackCount->enable();
stackCount->setText(boost::lexical_cast<std::string>(myStack->count)); stackCount->setText(CSDL_Ext::makeNumberShort(myStack->count, 4));
} }
else else
{ {

View File

@@ -247,7 +247,7 @@ void CArmyTooltip::init(const InfoAboutArmy &army)
std::string subtitle; std::string subtitle;
if(army.army.isDetailed) if(army.army.isDetailed)
{ {
subtitle = boost::lexical_cast<std::string>(slot.second.count); subtitle = CSDL_Ext::makeNumberShort(slot.second.count, 4);
} }
else else
{ {