mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
Full exchange when holding alt while pressing exchange screen creature arrow button
This commit is contained in:
parent
150f4904ab
commit
ceac0bc203
@ -248,7 +248,7 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
|
|||||||
Point(484 + 35 * i, 154),
|
Point(484 + 35 * i, 154),
|
||||||
AnimationPath::builtin("quick-exchange/unitLeft.DEF"),
|
AnimationPath::builtin("quick-exchange/unitLeft.DEF"),
|
||||||
CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.moveUnit")),
|
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);
|
moveUnitFromRightToLeftButtons.back()->block(leftHeroBlock);
|
||||||
|
|
||||||
moveUnitFromLeftToRightButtons.push_back(
|
moveUnitFromLeftToRightButtons.push_back(
|
||||||
@ -256,7 +256,7 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
|
|||||||
Point(66 + 35 * i, 154),
|
Point(66 + 35 * i, 154),
|
||||||
AnimationPath::builtin("quick-exchange/unitRight.DEF"),
|
AnimationPath::builtin("quick-exchange/unitRight.DEF"),
|
||||||
CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.moveUnit")),
|
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);
|
moveUnitFromLeftToRightButtons.back()->block(rightHeroBlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -264,6 +264,14 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
|
|||||||
CExchangeWindow::update();
|
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)
|
void CExchangeWindow::moveArtifactsCallback(bool leftToRight)
|
||||||
{
|
{
|
||||||
bool moveEquipped = !GH.isKeyboardShiftDown();
|
bool moveEquipped = !GH.isKeyboardShiftDown();
|
||||||
|
@ -54,6 +54,7 @@ class CExchangeWindow : public CStatusbarWindow, public IGarrisonHolder, public
|
|||||||
std::shared_ptr<CButton> backpackButtonRight;
|
std::shared_ptr<CButton> backpackButtonRight;
|
||||||
CExchangeController controller;
|
CExchangeController controller;
|
||||||
|
|
||||||
|
void creatureArrowButtonCallback(bool leftToRight, SlotID slotID);
|
||||||
void moveArtifactsCallback(bool leftToRight);
|
void moveArtifactsCallback(bool leftToRight);
|
||||||
void swapArtifactsCallback();
|
void swapArtifactsCallback();
|
||||||
void moveUnitsShortcut(bool leftToRight);
|
void moveUnitsShortcut(bool leftToRight);
|
||||||
|
Loading…
Reference in New Issue
Block a user