diff --git a/Mods/vcmi/Content/Sprites/battle/queueDefend.png b/Mods/vcmi/Content/Sprites/battle/queueDefend.png new file mode 100644 index 000000000..87e61b3ab Binary files /dev/null and b/Mods/vcmi/Content/Sprites/battle/queueDefend.png differ diff --git a/Mods/vcmi/Content/Sprites/battle/queueWait.png b/Mods/vcmi/Content/Sprites/battle/queueWait.png new file mode 100644 index 000000000..82572bd8e Binary files /dev/null and b/Mods/vcmi/Content/Sprites/battle/queueWait.png differ diff --git a/Mods/vcmi/Content/Sprites/settingsWindow/gear.png b/Mods/vcmi/Content/Sprites/settingsWindow/gear.png index c5974983e..d59b548c7 100644 Binary files a/Mods/vcmi/Content/Sprites/settingsWindow/gear.png and b/Mods/vcmi/Content/Sprites/settingsWindow/gear.png differ diff --git a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/defendBig.png b/Mods/vcmi/Content/Sprites/vcmi/battleQueue/defendBig.png deleted file mode 100644 index ef9022ca6..000000000 Binary files a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/defendBig.png and /dev/null differ diff --git a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/defendSmall.png b/Mods/vcmi/Content/Sprites/vcmi/battleQueue/defendSmall.png deleted file mode 100644 index b22a1b5d6..000000000 Binary files a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/defendSmall.png and /dev/null differ diff --git a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/statesBig.json b/Mods/vcmi/Content/Sprites/vcmi/battleQueue/statesBig.json deleted file mode 100644 index e8383883c..000000000 --- a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/statesBig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "basepath": "vcmi/battleQueue/", - "images" : - [ - { "frame" : 0, "file" : "defendBig"}, - { "frame" : 1, "file" : "waitBig"} - ] -} diff --git a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/statesSmall.json b/Mods/vcmi/Content/Sprites/vcmi/battleQueue/statesSmall.json deleted file mode 100644 index 796657130..000000000 --- a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/statesSmall.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "basepath": "vcmi/battleQueue/", - "images" : - [ - { "frame" : 0, "file" : "defendSmall"}, - { "frame" : 1, "file" : "waitSmall"} - ] -} diff --git a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/waitBig.png b/Mods/vcmi/Content/Sprites/vcmi/battleQueue/waitBig.png deleted file mode 100644 index ed0b70ae6..000000000 Binary files a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/waitBig.png and /dev/null differ diff --git a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/waitSmall.png b/Mods/vcmi/Content/Sprites/vcmi/battleQueue/waitSmall.png deleted file mode 100644 index da6ebed50..000000000 Binary files a/Mods/vcmi/Content/Sprites/vcmi/battleQueue/waitSmall.png and /dev/null differ diff --git a/Mods/vcmi/Content/Sprites2x/battle/queueDefend.png b/Mods/vcmi/Content/Sprites2x/battle/queueDefend.png new file mode 100644 index 000000000..7ba9c0a58 Binary files /dev/null and b/Mods/vcmi/Content/Sprites2x/battle/queueDefend.png differ diff --git a/Mods/vcmi/Content/Sprites2x/battle/queueWait.png b/Mods/vcmi/Content/Sprites2x/battle/queueWait.png new file mode 100644 index 000000000..53e203dda Binary files /dev/null and b/Mods/vcmi/Content/Sprites2x/battle/queueWait.png differ diff --git a/Mods/vcmi/Content/Sprites2x/mapFormatIcons/vcmi1.png b/Mods/vcmi/Content/Sprites2x/mapFormatIcons/vcmi1.png new file mode 100644 index 000000000..1be03a460 Binary files /dev/null and b/Mods/vcmi/Content/Sprites2x/mapFormatIcons/vcmi1.png differ diff --git a/Mods/vcmi/Content/Sprites2x/settingsWindow/gear.png b/Mods/vcmi/Content/Sprites2x/settingsWindow/gear.png new file mode 100644 index 000000000..ff89fc0e6 Binary files /dev/null and b/Mods/vcmi/Content/Sprites2x/settingsWindow/gear.png differ diff --git a/Mods/vcmi/Content/Sprites2x/stackWindow/icons.png b/Mods/vcmi/Content/Sprites2x/stackWindow/icons.png new file mode 100644 index 000000000..b1cdf1c22 Binary files /dev/null and b/Mods/vcmi/Content/Sprites2x/stackWindow/icons.png differ diff --git a/Mods/vcmi/Content/Sprites3x/battle/queueDefend.png b/Mods/vcmi/Content/Sprites3x/battle/queueDefend.png new file mode 100644 index 000000000..1740d5b16 Binary files /dev/null and b/Mods/vcmi/Content/Sprites3x/battle/queueDefend.png differ diff --git a/Mods/vcmi/Content/Sprites3x/mapFormatIcons/vcmi1.png b/Mods/vcmi/Content/Sprites3x/mapFormatIcons/vcmi1.png new file mode 100644 index 000000000..d85607d13 Binary files /dev/null and b/Mods/vcmi/Content/Sprites3x/mapFormatIcons/vcmi1.png differ diff --git a/Mods/vcmi/Content/Sprites3x/settingsWindow/gear.png b/Mods/vcmi/Content/Sprites3x/settingsWindow/gear.png new file mode 100644 index 000000000..93cc18eeb Binary files /dev/null and b/Mods/vcmi/Content/Sprites3x/settingsWindow/gear.png differ diff --git a/Mods/vcmi/Content/Sprites3x/stackWindow/icons.png b/Mods/vcmi/Content/Sprites3x/stackWindow/icons.png new file mode 100644 index 000000000..3ec5a9e32 Binary files /dev/null and b/Mods/vcmi/Content/Sprites3x/stackWindow/icons.png differ diff --git a/Mods/vcmi/Content/Sprites4x/battle/queueDefend.png b/Mods/vcmi/Content/Sprites4x/battle/queueDefend.png new file mode 100644 index 000000000..df4a21235 Binary files /dev/null and b/Mods/vcmi/Content/Sprites4x/battle/queueDefend.png differ diff --git a/Mods/vcmi/Content/Sprites4x/mapFormatIcons/vcmi1.png b/Mods/vcmi/Content/Sprites4x/mapFormatIcons/vcmi1.png new file mode 100644 index 000000000..0193036be Binary files /dev/null and b/Mods/vcmi/Content/Sprites4x/mapFormatIcons/vcmi1.png differ diff --git a/Mods/vcmi/Content/Sprites4x/settingsWindow/gear.png b/Mods/vcmi/Content/Sprites4x/settingsWindow/gear.png new file mode 100644 index 000000000..83d451dbe Binary files /dev/null and b/Mods/vcmi/Content/Sprites4x/settingsWindow/gear.png differ diff --git a/Mods/vcmi/Content/Sprites4x/stackWindow/icons.png b/Mods/vcmi/Content/Sprites4x/stackWindow/icons.png new file mode 100644 index 000000000..95abe6c3c Binary files /dev/null and b/Mods/vcmi/Content/Sprites4x/stackWindow/icons.png differ diff --git a/client/battle/BattleInterfaceClasses.cpp b/client/battle/BattleInterfaceClasses.cpp index b7622316c..f9dde7e68 100644 --- a/client/battle/BattleInterfaceClasses.cpp +++ b/client/battle/BattleInterfaceClasses.cpp @@ -1066,11 +1066,13 @@ StackQueue::StackBox::StackBox(StackQueue * owner): roundRect = std::make_shared(Rect(0, 0, 15, 18), ColorRGBA(0, 0, 0, 255), ColorRGBA(241, 216, 120, 255)); round = std::make_shared(4, 2, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE); - int icon_x = pos.w - 17; - int icon_y = pos.h - 18; + Point iconPos(pos.w - 16, pos.h - 16); - stateIcon = std::make_shared(AnimationPath::builtin("VCMI/BATTLEQUEUE/STATESSMALL"), 0, 0, icon_x, icon_y); - stateIcon->visible = false; + defendIcon = std::make_shared(ImagePath::builtin("battle/QueueDefend"), iconPos); + waitIcon = std::make_shared(ImagePath::builtin("battle/QueueWait"), iconPos); + + defendIcon->setEnabled(false); + waitIcon->setEnabled(false); } roundRect->disable(); } @@ -1106,22 +1108,13 @@ void StackQueue::StackBox::setUnit(const battle::Unit * unit, size_t turn, std:: round->setText(tmp); } - if(stateIcon) + if(!owner->embedded) { - if(unit->defended((int)turn) || (turn > 0 && unit->defended((int)turn - 1))) - { - stateIcon->setFrame(0, 0); - stateIcon->visible = true; - } - else if(unit->waited((int)turn)) - { - stateIcon->setFrame(1, 0); - stateIcon->visible = true; - } - else - { - stateIcon->visible = false; - } + bool defended = unit->defended(turn) || (turn > 0 && unit->defended(turn - 1)); + bool waited = unit->waited(turn) && !defended; + + defendIcon->setEnabled(defended); + waitIcon->setEnabled(waited); } } else @@ -1131,9 +1124,11 @@ void StackQueue::StackBox::setUnit(const battle::Unit * unit, size_t turn, std:: icon->visible = false; icon->setFrame(0); amount->setText(""); - - if(stateIcon) - stateIcon->visible = false; + if(!owner->embedded) + { + defendIcon->setEnabled(false); + waitIcon->setEnabled(false); + } } } diff --git a/client/battle/BattleInterfaceClasses.h b/client/battle/BattleInterfaceClasses.h index 819ed3504..9465502bc 100644 --- a/client/battle/BattleInterfaceClasses.h +++ b/client/battle/BattleInterfaceClasses.h @@ -260,7 +260,8 @@ class StackQueue : public CIntObject std::shared_ptr background; std::shared_ptr icon; std::shared_ptr amount; - std::shared_ptr stateIcon; + std::shared_ptr waitIcon; + std::shared_ptr defendIcon; std::shared_ptr round; std::shared_ptr roundRect;