diff --git a/client/windows/CExchangeWindow.cpp b/client/windows/CExchangeWindow.cpp index 35c5d8c7f..e97f50412 100644 --- a/client/windows/CExchangeWindow.cpp +++ b/client/windows/CExchangeWindow.cpp @@ -248,7 +248,7 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2, Point(484 + 35 * i, 154), AnimationPath::builtin("quick-exchange/unitLeft.DEF"), CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.moveUnit")), - std::bind(&CExchangeController::moveStack, &controller, false, SlotID(i)))); + [this, i]() { creatureArrowButtonCallback(false, SlotID(i)); })); moveUnitFromRightToLeftButtons.back()->block(leftHeroBlock); moveUnitFromLeftToRightButtons.push_back( @@ -256,7 +256,7 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2, Point(66 + 35 * i, 154), AnimationPath::builtin("quick-exchange/unitRight.DEF"), CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.moveUnit")), - std::bind(&CExchangeController::moveStack, &controller, true, SlotID(i)))); + [this, i]() { creatureArrowButtonCallback(true, SlotID(i)); })); moveUnitFromLeftToRightButtons.back()->block(rightHeroBlock); } } @@ -264,6 +264,14 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2, CExchangeWindow::update(); } +void CExchangeWindow::creatureArrowButtonCallback(bool leftToRight, SlotID slotId) +{ + if (GH.isKeyboardAltDown()) + controller.moveArmy(leftToRight, slotId); + else + controller.moveStack(leftToRight, slotId); +} + void CExchangeWindow::moveArtifactsCallback(bool leftToRight) { bool moveEquipped = !GH.isKeyboardShiftDown(); diff --git a/client/windows/CExchangeWindow.h b/client/windows/CExchangeWindow.h index d19b27279..e1c31d3e2 100644 --- a/client/windows/CExchangeWindow.h +++ b/client/windows/CExchangeWindow.h @@ -54,6 +54,7 @@ class CExchangeWindow : public CStatusbarWindow, public IGarrisonHolder, public std::shared_ptr backpackButtonRight; CExchangeController controller; + void creatureArrowButtonCallback(bool leftToRight, SlotID slotID); void moveArtifactsCallback(bool leftToRight); void swapArtifactsCallback(); void moveUnitsShortcut(bool leftToRight);