mirror of
https://github.com/vcmi/vcmi.git
synced 2025-10-08 23:22:25 +02:00
Merge pull request #6199 from Laserlicht/fix_button_condition
Fix button condition
This commit is contained in:
@@ -665,12 +665,6 @@ bool AdventureMapShortcuts::optionMarketplace()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AdventureMapShortcuts::optionHeroGround()
|
|
||||||
{
|
|
||||||
const CGHeroInstance *hero = GAME->interface()->localState->getCurrentHero();
|
|
||||||
return optionInMapView() && hero && !hero->inBoat();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AdventureMapShortcuts::optionHeroBoat(EPathfindingLayer layer)
|
bool AdventureMapShortcuts::optionHeroBoat(EPathfindingLayer layer)
|
||||||
{
|
{
|
||||||
const CGHeroInstance *hero = GAME->interface()->localState->getCurrentHero();
|
const CGHeroInstance *hero = GAME->interface()->localState->getCurrentHero();
|
||||||
|
@@ -101,7 +101,6 @@ public:
|
|||||||
bool optionMapScrollingActive();
|
bool optionMapScrollingActive();
|
||||||
bool optionMapViewActive();
|
bool optionMapViewActive();
|
||||||
bool optionMarketplace();
|
bool optionMarketplace();
|
||||||
bool optionHeroGround();
|
|
||||||
bool optionHeroBoat(EPathfindingLayer layer);
|
bool optionHeroBoat(EPathfindingLayer layer);
|
||||||
bool optionHeroDig();
|
bool optionHeroDig();
|
||||||
|
|
||||||
|
@@ -427,7 +427,7 @@ void AdventureMapWidget::updateActiveStateChildren(CIntObject * widget)
|
|||||||
container->setEnabled(shortcuts->optionHeroSleeping());
|
container->setEnabled(shortcuts->optionHeroSleeping());
|
||||||
|
|
||||||
if (container->disableCondition == "heroGround")
|
if (container->disableCondition == "heroGround")
|
||||||
container->setEnabled(shortcuts->optionHeroGround());
|
container->setEnabled(!shortcuts->optionHeroBoat(EPathfindingLayer::SAIL) && !shortcuts->optionHeroBoat(EPathfindingLayer::AIR));
|
||||||
|
|
||||||
if (container->disableCondition == "heroBoat")
|
if (container->disableCondition == "heroBoat")
|
||||||
container->setEnabled(shortcuts->optionHeroBoat(EPathfindingLayer::SAIL));
|
container->setEnabled(shortcuts->optionHeroBoat(EPathfindingLayer::SAIL));
|
||||||
|
Reference in New Issue
Block a user