mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-05 15:05:40 +02:00
Properly disable combat panel during spell targeting
This commit is contained in:
parent
47e774897d
commit
238de8a5d7
@ -119,7 +119,10 @@ BattleActionsController::BattleActionsController(BattleInterface & owner):
|
||||
void BattleActionsController::endCastingSpell()
|
||||
{
|
||||
if(heroSpellToCast)
|
||||
{
|
||||
heroSpellToCast.reset();
|
||||
owner.windowObject->blockUI(false);
|
||||
}
|
||||
|
||||
if(owner.stacksController->getActiveStack())
|
||||
possibleActions = getPossibleActionsForStack(owner.stacksController->getActiveStack()); //restore actions after they were cleared
|
||||
@ -287,6 +290,8 @@ void BattleActionsController::castThisSpell(SpellID spellID)
|
||||
possibleActions.push_back (spellSelMode); //only this one action can be performed at the moment
|
||||
GH.fakeMouseMove();//update cursor
|
||||
}
|
||||
|
||||
owner.windowObject->blockUI(true);
|
||||
}
|
||||
|
||||
const CSpell * BattleActionsController::getHeroSpellToCast( ) const
|
||||
|
@ -541,11 +541,8 @@ void BattleWindow::blockUI(bool on)
|
||||
w->block(on || owner.tacticsMode);
|
||||
if(auto w = widget<CButton>("alternativeAction"))
|
||||
w->block(on || owner.tacticsMode);
|
||||
|
||||
// block only if during enemy turn and auto-fight is off
|
||||
// otherwise - crash on accessing non-exisiting active stack
|
||||
if(auto w = widget<CButton>("options"))
|
||||
w->block(!owner.curInt->isAutoFightOn && !owner.stacksController->getActiveStack());
|
||||
if(auto w = widget<CButton>("autofight"))
|
||||
w->block(owner.actionsController->spellcastingModeActive());
|
||||
|
||||
auto btactEnd = widget<CButton>("tacticEnd");
|
||||
auto btactNext = widget<CButton>("tacticNext");
|
||||
|
Loading…
x
Reference in New Issue
Block a user