mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-29 21:56:54 +02:00
Fix spellcast cancelation in battle
This commit is contained in:
parent
0e36a3ab5a
commit
1cec6918a0
@ -971,6 +971,9 @@ void BattleActionsController::activateStack()
|
|||||||
|
|
||||||
void BattleActionsController::onHexRightClicked(BattleHex clickedHex)
|
void BattleActionsController::onHexRightClicked(BattleHex clickedHex)
|
||||||
{
|
{
|
||||||
|
if (spellcastingModeActive())
|
||||||
|
endCastingSpell();
|
||||||
|
|
||||||
auto selectedStack = owner.curInt->cb->battleGetStackByPos(clickedHex, true);
|
auto selectedStack = owner.curInt->cb->battleGetStackByPos(clickedHex, true);
|
||||||
|
|
||||||
if (selectedStack != nullptr)
|
if (selectedStack != nullptr)
|
||||||
|
@ -85,7 +85,7 @@ BattleWindow::BattleWindow(BattleInterface & owner):
|
|||||||
else
|
else
|
||||||
tacticPhaseEnded();
|
tacticPhaseEnded();
|
||||||
|
|
||||||
addUsedEvents(RCLICK | KEYBOARD);
|
addUsedEvents(KEYBOARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleWindow::createQueue()
|
void BattleWindow::createQueue()
|
||||||
@ -203,12 +203,6 @@ void BattleWindow::keyPressed(EShortcut key)
|
|||||||
InterfaceObjectConfigurable::keyPressed(key);
|
InterfaceObjectConfigurable::keyPressed(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleWindow::clickRight(tribool down, bool previousState)
|
|
||||||
{
|
|
||||||
if (!down)
|
|
||||||
owner.actionsController->endCastingSpell();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BattleWindow::tacticPhaseStarted()
|
void BattleWindow::tacticPhaseStarted()
|
||||||
{
|
{
|
||||||
auto menuBattle = widget<CIntObject>("menuBattle");
|
auto menuBattle = widget<CIntObject>("menuBattle");
|
||||||
|
@ -86,7 +86,6 @@ public:
|
|||||||
void deactivate() override;
|
void deactivate() override;
|
||||||
void keyPressed(EShortcut key) override;
|
void keyPressed(EShortcut key) override;
|
||||||
bool captureThisKey(EShortcut key) override;
|
bool captureThisKey(EShortcut key) override;
|
||||||
void clickRight(tribool down, bool previousState) override;
|
|
||||||
void show(Canvas & to) override;
|
void show(Canvas & to) override;
|
||||||
void showAll(Canvas & to) override;
|
void showAll(Canvas & to) override;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user