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:
@@ -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();
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user