mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Unblock basic adventure map actions (scrolling / right-click) in multiplayer
This commit is contained in:
@@ -36,6 +36,14 @@
|
||||
#include "../../lib/mapping/CMap.h"
|
||||
#include "../../lib/pathfinder/CGPathNode.h"
|
||||
|
||||
bool isCurrentPlayerHuman()
|
||||
{
|
||||
PlayerColor currentPlayer = LOCPLINT->cb->getCurrentPlayer();
|
||||
bool isHuman = LOCPLINT->cb->getStartInfo()->playerInfos.count(currentPlayer)
|
||||
&& LOCPLINT->cb->getStartInfo()->playerInfos.at(currentPlayer).isControlledByHuman();
|
||||
return isHuman;
|
||||
}
|
||||
|
||||
AdventureMapShortcuts::AdventureMapShortcuts(AdventureMapInterface & owner)
|
||||
: owner(owner)
|
||||
, state(EAdventureState::NOT_INITIALIZED)
|
||||
@@ -461,7 +469,13 @@ bool AdventureMapShortcuts::optionSidePanelActive()
|
||||
return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW;
|
||||
}
|
||||
|
||||
bool AdventureMapShortcuts::optionMapScrollingActive()
|
||||
{
|
||||
return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW || (state == EAdventureState::ENEMY_TURN && isCurrentPlayerHuman());
|
||||
}
|
||||
|
||||
bool AdventureMapShortcuts::optionMapViewActive()
|
||||
{
|
||||
return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW || state == EAdventureState::CASTING_SPELL;
|
||||
return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW || state == EAdventureState::CASTING_SPELL
|
||||
|| (state == EAdventureState::ENEMY_TURN && isCurrentPlayerHuman());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user