From f577f4cf6b6171de978a439188d7e5533c4e0e29 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Thu, 28 Dec 2023 17:17:01 +0100 Subject: [PATCH] bugfix: enable first, then set text --- client/battle/BattleInterfaceClasses.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/battle/BattleInterfaceClasses.cpp b/client/battle/BattleInterfaceClasses.cpp index eae23b22a..721caf49b 100644 --- a/client/battle/BattleInterfaceClasses.cpp +++ b/client/battle/BattleInterfaceClasses.cpp @@ -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) {