1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

CAdvMapInt: block spellbook button when no hero selected

This commit is contained in:
ArseniyShestakov
2015-12-06 03:12:39 +03:00
parent e872b400b7
commit 807fd6391b
2 changed files with 8 additions and 0 deletions

View File

@@ -767,6 +767,11 @@ void CAdvMapInt::updateMoveHero(const CGHeroInstance *h, tribool hasPath)
moveHero->block(!hasPath || (h->movement == 0));
}
void CAdvMapInt::updateSpellbook(const CGHeroInstance *h)
{
spellbook->block(!h);
}
int CAdvMapInt::getNextHeroIndex(int startIndex)
{
if (LOCPLINT->wanderingHeroes.size() == 0)
@@ -1262,6 +1267,7 @@ void CAdvMapInt::select(const CArmedInstance *sel, bool centerView /*= true*/)
updateSleepWake(nullptr);
updateMoveHero(nullptr);
updateSpellbook(nullptr);
}
else //hero selected
{
@@ -1275,6 +1281,7 @@ void CAdvMapInt::select(const CArmedInstance *sel, bool centerView /*= true*/)
updateSleepWake(hero);
updateMoveHero(hero);
updateSpellbook(hero);
}
townList.redraw();
heroList.redraw();

View File

@@ -235,6 +235,7 @@ public:
//button updates
void updateSleepWake(const CGHeroInstance *h);
void updateMoveHero(const CGHeroInstance *h, tribool hasPath = boost::logic::indeterminate);
void updateSpellbook(const CGHeroInstance *h);
void updateNextHero(const CGHeroInstance *h);
/// changes current adventure map mode; used to switch between default view and world view; scale is ignored if EAdvMapMode == NORMAL