puzzlepaint / freeage

An open-source reimplementation of the game engine of Age of Empires 2: Definitive Edition.
59 stars 4 forks source link

Idle Villager button and hotkey #2

Open puzzlepaint opened 4 years ago

puzzlepaint commented 4 years ago

Hints: Iterate over map->GetObjects(), check IsUnit(), GetPlayerIndex() == match->GetPlayerIndex(), and IsVillager() for each entry, and check whether the UnitAction is UnitAction::Idle to find the idle villagers. Use ClearSelection(), AddToSelection(), and SelectionChanged() to modify the selection.