1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Icons for heroes on minimap

VCMI will now show icons for all heroes on visible part of minimap to
help with readability on large maps

Old behavior can be enable via toggle in game settings menu
This commit is contained in:
Ivan Savenko
2025-05-27 18:38:44 +03:00
parent f9e88557ca
commit 24def2ed16
11 changed files with 93 additions and 16 deletions

View File

@@ -718,6 +718,20 @@ int CGameInfoCallback::getHeroCount( PlayerColor player, bool includeGarrisoned
return ret;
}
std::vector<const CGHeroInstance*> CGameInfoCallback::getHeroes(PlayerColor player) const
{
std::vector<const CGHeroInstance*> ret;
const PlayerState *p = gameState().getPlayerState(player);
ERROR_RET_VAL_IF(!p, "No such player!", ret);
for(const auto & hero : p->getHeroes())
{
if(!getPlayerID().has_value() || isVisibleFor(hero, *getPlayerID()) || hero->getOwner() == getPlayerID())
ret.push_back(hero);
}
return ret;
}
bool CGameInfoCallback::isPlayerMakingTurn(PlayerColor player) const
{
return gameState().actingPlayers.count(player);