1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

bugfix: enable first, then set text

This commit is contained in:
Laserlicht
2023-12-28 17:17:01 +01:00
committed by GitHub
parent a9005da01e
commit f577f4cf6b

View File

@@ -983,6 +983,10 @@ void StackQueue::StackBox::setUnit(const battle::Unit * unit, size_t turn, std::
if (unit->unitType()->getId() == CreatureID::ARROW_TOWERS)
icon->setFrame(owner->getSiegeShooterIconID(), 1);
roundRect->setEnabled(currentTurn.has_value());
if(!owner->embedded)
round->setEnabled(currentTurn.has_value());
amount->setText(TextOperations::formatMetric(unit->getCount(), 4));
if(currentTurn && !owner->embedded)
{
@@ -991,9 +995,6 @@ void StackQueue::StackBox::setUnit(const battle::Unit * unit, size_t turn, std::
roundRect->pos.w = len + 6;
round->setText(tmp);
}
roundRect->setEnabled(currentTurn.has_value());
if(!owner->embedded)
round->setEnabled(currentTurn.has_value());
if(stateIcon)
{