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:
@@ -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)
|
||||||
{
|
{
|
||||||
|
@@ -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)
|
||||||
|
@@ -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
|
||||||
{
|
{
|
||||||
|
@@ -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
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user