1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

Block turn end button after player ends turn

This commit is contained in:
Ivan Savenko 2023-09-19 19:50:07 +03:00
parent 64c43c91dc
commit 56074e18a9
2 changed files with 7 additions and 1 deletions

View File

@ -71,7 +71,7 @@ std::vector<AdventureMapShortcutState> AdventureMapShortcuts::getShortcuts()
{ EShortcut::ADVENTURE_GAME_OPTIONS, optionInMapView(), [this]() { this->adventureOptions(); } },
{ EShortcut::GLOBAL_OPTIONS, optionInMapView(), [this]() { this->systemOptions(); } },
{ EShortcut::ADVENTURE_NEXT_HERO, optionHasNextHero(), [this]() { this->nextHero(); } },
{ EShortcut::GAME_END_TURN, optionInMapView(), [this]() { this->endTurn(); } },
{ EShortcut::GAME_END_TURN, optionCanEndTurn(), [this]() { this->endTurn(); } },
{ EShortcut::ADVENTURE_THIEVES_GUILD, optionInMapView(), [this]() { this->showThievesGuild(); } },
{ EShortcut::ADVENTURE_VIEW_SCENARIO, optionInMapView(), [this]() { this->showScenarioInfo(); } },
{ EShortcut::GAME_SAVE_GAME, optionInMapView(), [this]() { this->saveGame(); } },
@ -453,6 +453,11 @@ bool AdventureMapShortcuts::optionHasNextHero()
return optionInMapView() && nextSuitableHero != nullptr;
}
bool AdventureMapShortcuts::optionCanEndTurn()
{
return optionInMapView() && LOCPLINT->makingTurn;
}
bool AdventureMapShortcuts::optionSpellcasting()
{
return state == EAdventureState::CASTING_SPELL;

View File

@ -78,6 +78,7 @@ public:
bool optionHeroCanMove();
bool optionHasNextHero();
bool optionCanVisitObject();
bool optionCanEndTurn();
bool optionSpellcasting();
bool optionInMapView();
bool optionInWorldView();