1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Do not hide minimap on human player turn

This commit is contained in:
Ivan Savenko 2023-07-03 19:36:10 +03:00
parent 8b61c0d59b
commit 4e80356bea
5 changed files with 9 additions and 6 deletions

View File

@ -183,7 +183,10 @@ void CPlayerInterface::playerStartsTurn(PlayerColor player)
if (player != playerID && LOCPLINT == this) if (player != playerID && LOCPLINT == this)
{ {
waitWhileDialog(); waitWhileDialog();
adventureInt->onEnemyTurnStarted(player);
bool isHuman = cb->getStartInfo()->playerInfos.count(player) && cb->getStartInfo()->playerInfos.at(player).isControlledByHuman();
adventureInt->onEnemyTurnStarted(player, isHuman);
} }
} }

View File

@ -309,13 +309,13 @@ void AdventureMapInterface::onHotseatWaitStarted(PlayerColor playerID)
setState(EAdventureState::HOTSEAT_WAIT); setState(EAdventureState::HOTSEAT_WAIT);
} }
void AdventureMapInterface::onEnemyTurnStarted(PlayerColor playerID) void AdventureMapInterface::onEnemyTurnStarted(PlayerColor playerID, bool isHuman)
{ {
if(settings["session"]["spectate"].Bool()) if(settings["session"]["spectate"].Bool())
return; return;
mapAudio->onEnemyTurnStarted(); mapAudio->onEnemyTurnStarted();
widget->getMinimap()->setAIRadar(true); widget->getMinimap()->setAIRadar(!isHuman);
widget->getInfoBar()->startEnemyTurn(LOCPLINT->cb->getCurrentPlayer()); widget->getInfoBar()->startEnemyTurn(LOCPLINT->cb->getCurrentPlayer());
setState(EAdventureState::ENEMY_TURN); setState(EAdventureState::ENEMY_TURN);
} }

View File

@ -115,7 +115,7 @@ public:
void onHotseatWaitStarted(PlayerColor playerID); void onHotseatWaitStarted(PlayerColor playerID);
/// Called by PlayerInterface when AI or remote human player starts his turn /// Called by PlayerInterface when AI or remote human player starts his turn
void onEnemyTurnStarted(PlayerColor playerID); void onEnemyTurnStarted(PlayerColor playerID, bool isHuman);
/// Called by PlayerInterface when local human player starts his turn /// Called by PlayerInterface when local human player starts his turn
void onPlayerTurnStarted(PlayerColor playerID); void onPlayerTurnStarted(PlayerColor playerID);

View File

@ -231,7 +231,7 @@ void CMinimap::setAIRadar(bool on)
redraw(); redraw();
} }
void CMinimap::updateTiles(std::unordered_set<int3> positions) void CMinimap::updateTiles(const std::unordered_set<int3> & positions)
{ {
if(minimap) if(minimap)
{ {

View File

@ -68,6 +68,6 @@ public:
void showAll(Canvas & to) override; void showAll(Canvas & to) override;
void updateTiles(std::unordered_set<int3> positions); void updateTiles(const std::unordered_set<int3> & positions);
}; };