1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00
This commit is contained in:
Michał W. Urbańczyk
2010-05-31 21:14:15 +00:00
parent 9af18cf487
commit 39eb87924e
3 changed files with 37 additions and 19 deletions

View File

@ -1517,6 +1517,14 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
LOCPLINT->openTownWindow(t);
return;
}
case SDLK_ESCAPE:
{
if(isActive() || GH.topInt() != this || !spellBeingCasted || key.state != SDL_PRESSED)
return;
leaveCastingMode();
return;
}
case SDLK_t:
{
//act on key down if marketplace windows is not already opened
@ -1993,7 +2001,6 @@ void CAdvMapInt::tileRClicked(const int3 &mp)
if(spellBeingCasted)
{
leaveCastingMode();
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[731]); //Spell cancelled
return;
}
@ -2034,7 +2041,10 @@ void CAdvMapInt::leaveCastingMode(bool cast /*= false*/, int3 dest /*= int3(-1,
terrain.deactivate();
activate();
LOCPLINT->cb->castSpell(curHero(), id, dest);
if(cast)
LOCPLINT->cb->castSpell(curHero(), id, dest);
else
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[731]); //Spell cancelled
}
const CGHeroInstance * CAdvMapInt::curHero() const