mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
This commit is contained in:
@@ -1783,6 +1783,9 @@ void CBattleInterface::blockUI(bool on)
|
|||||||
{
|
{
|
||||||
ESpellCastProblem::ESpellCastProblem spellcastingProblem;
|
ESpellCastProblem::ESpellCastProblem spellcastingProblem;
|
||||||
bool canCastSpells = curInt->cb->battleCanCastSpell(&spellcastingProblem);
|
bool canCastSpells = curInt->cb->battleCanCastSpell(&spellcastingProblem);
|
||||||
|
//if magic is blocked, we leave button active, so the message can be displayed (cf bug #97)
|
||||||
|
if(!canCastSpells)
|
||||||
|
canCastSpells = spellcastingProblem == ESpellCastProblem::MAGIC_IS_BLOCKED;
|
||||||
bool canWait = activeStack ? !activeStack->waited() : false;
|
bool canWait = activeStack ? !activeStack->waited() : false;
|
||||||
|
|
||||||
bOptions->block(on);
|
bOptions->block(on);
|
||||||
@@ -1804,8 +1807,8 @@ void CBattleInterface::blockUI(bool on)
|
|||||||
bConsoleDown->block(on);
|
bConsoleDown->block(on);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if magic is blocked, we leave button active, so the message can be displayed (cf bug #97)
|
|
||||||
bSpell->block(on || (!canCastSpells && spellcastingProblem != ESpellCastProblem::MAGIC_IS_BLOCKED));
|
bSpell->block(on || tacticsMode || !canCastSpells);
|
||||||
bWait->block(on || tacticsMode || !canWait);
|
bWait->block(on || tacticsMode || !canWait);
|
||||||
bDefence->block(on || tacticsMode);
|
bDefence->block(on || tacticsMode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -618,9 +618,7 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
|
|||||||
int spellCost = owner->myInt->cb->getSpellCost(sp, owner->myHero);
|
int spellCost = owner->myInt->cb->getSpellCost(sp, owner->myHero);
|
||||||
if(spellCost > owner->myHero->mana) //insufficient mana
|
if(spellCost > owner->myHero->mana) //insufficient mana
|
||||||
{
|
{
|
||||||
char msgBuf[500];
|
owner->myInt->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[206]) % spellCost % owner->myHero->mana));
|
||||||
sprintf(msgBuf, CGI->generaltexth->allTexts[206].c_str(), spellCost, owner->myHero->mana);
|
|
||||||
owner->myInt->showInfoDialog(std::string(msgBuf));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//battle spell on adv map or adventure map spell during combat => display infowindow, not cast
|
//battle spell on adv map or adventure map spell during combat => display infowindow, not cast
|
||||||
@@ -702,6 +700,13 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
|
|||||||
owner->myInt->showInfoDialog(CGI->generaltexth->allTexts[185]);
|
owner->myInt->showInfoDialog(CGI->generaltexth->allTexts[185]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
// General message:
|
||||||
|
std::string text = CGI->generaltexth->allTexts[541], caster = owner->myHero->name;
|
||||||
|
text = boost::str(boost::format(text) % caster);
|
||||||
|
owner->myInt->showInfoDialog(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(sp->isAdventureSpell() && !owner->myInt->battleInt) //adventure spell and not in battle
|
else if(sp->isAdventureSpell() && !owner->myInt->battleInt) //adventure spell and not in battle
|
||||||
|
|||||||
Reference in New Issue
Block a user