From fe8bf92a206b71fb9e95fe23d8be3715c22312dc Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Sat, 23 Dec 2023 22:00:28 +0100 Subject: [PATCH] only a bar in small mode --- client/battle/BattleInterfaceClasses.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/battle/BattleInterfaceClasses.cpp b/client/battle/BattleInterfaceClasses.cpp index fee833855..0986834ce 100644 --- a/client/battle/BattleInterfaceClasses.cpp +++ b/client/battle/BattleInterfaceClasses.cpp @@ -795,7 +795,7 @@ void StackQueue::update() for(size_t unitIndex = 0; unitIndex < queueData[turn].size() && boxIndex < stackBoxes.size(); boxIndex++, unitIndex++) { ui32 currentTurn = owner.round + turn; - stackBoxes[boxIndex]->setUnit(queueData[turn][unitIndex], turn, tmpTurn != currentTurn && owner.round != 0 ? (std::optional)currentTurn : std::nullopt); + stackBoxes[boxIndex]->setUnit(queueData[turn][unitIndex], turn, tmpTurn != currentTurn && owner.round != 0 && (!embedded || tmpTurn != -1) ? (std::optional)currentTurn : std::nullopt); tmpTurn = currentTurn; } } @@ -835,8 +835,7 @@ StackQueue::StackBox::StackBox(StackQueue * owner): { icon = std::make_shared(owner->icons, 0, 0, 5, 2); amount = std::make_shared(pos.w/2, pos.h - 7, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE); - roundRect = std::make_shared(Rect(0, 48, 15, 18), ColorRGBA(0, 0, 0, 255), ColorRGBA(241, 216, 120, 255)); - round = std::make_shared(4, pos.h + 1, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE); + roundRect = std::make_shared(Rect(0, 0, 2, 48), ColorRGBA(0, 0, 0, 255), ColorRGBA(0, 255, 0, 255)); } else { @@ -851,6 +850,7 @@ StackQueue::StackBox::StackBox(StackQueue * owner): stateIcon = std::make_shared(owner->stateIcons, 0, 0, icon_x, icon_y); stateIcon->visible = false; } + roundRect->disable(); } void StackQueue::StackBox::setUnit(const battle::Unit * unit, size_t turn, std::optional currentTurn) @@ -871,7 +871,7 @@ void StackQueue::StackBox::setUnit(const battle::Unit * unit, size_t turn, std:: icon->setFrame(owner->getSiegeShooterIconID(), 1); amount->setText(TextOperations::formatMetric(unit->getCount(), 4)); - if(currentTurn) + if(currentTurn && !owner->embedded) { std::string tmp = std::to_string(*currentTurn); int len = graphics->fonts[FONT_SMALL]->getStringWidth(tmp); @@ -879,7 +879,8 @@ void StackQueue::StackBox::setUnit(const battle::Unit * unit, size_t turn, std:: round->setText(tmp); } roundRect->setEnabled(currentTurn.has_value()); - round->setEnabled(currentTurn.has_value()); + if(!owner->embedded) + round->setEnabled(currentTurn.has_value()); if(stateIcon) {