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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user