MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / DrawGroupInfo

Method DrawGroupInfo

engine/Poseidon/UI/InGame/InGameUIDraw.cpp:1753–2188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1751}
1752
1753void InGameUI::DrawGroupInfo(EntityAI* vehicle)
1754{
1755 AIUnit* unit = GWorld->FocusOn();
1756 PoseidonAssert(unit);
1757 AISubgroup* subgroup = unit->GetSubgroup();
1758 PoseidonAssert(subgroup);
1759 AIGroup* group = subgroup->GetGroup();
1760 PoseidonAssert(group);
1761
1762 bool changed = false;
1763 bool isValid = false;
1764 int i;
1765 for (i = 0; i < MAX_UNITS_PER_GROUP; i++)
1766 {
1767 AIUnit* u = group->UnitWithID(i + 1);
1768 UnitDescription& info = _groupInfo[i];
1769 bool valid = (u && u->GetSubgroup() && !group->GetReportedDown(u) && unit->IsGroupLeader());
1770 if (valid != info.valid)
1771 {
1772 info.valid = valid;
1773 changed = true;
1774 }
1775 if (!valid)
1776 {
1777 continue;
1778 }
1779
1780 isValid = true;
1781 EntityAI* veh = u->GetVehicle();
1782 Transport* trans = u->GetVehicleIn();
1783 // const VehicleType *type = veh->GetType();
1784
1785 if (trans != info.vehicle)
1786 {
1787 info.vehicle = trans;
1788 changed = true;
1789 }
1790
1791 if (u->GetPerson() != info.person)
1792 {
1793 info.person = u->GetPerson();
1794 changed = true;
1795 }
1796
1797 AIUnit::ResourceState problemStatus = group->GetWorstStateReported(u);
1798 bool problems = problemStatus >= AIUnit::RSCritical;
1799 if (problems != info.problems)
1800 {
1801 info.problems = problems;
1802 changed = true;
1803 }
1804
1805 if (u->GetSemaphore() != info.semaphore)
1806 {
1807 info.semaphore = u->GetSemaphore();
1808 changed = true;
1809 }
1810

Callers

nothing calls this directly

Calls 15

GetSelectedUnitFunction · 0.85
GetTeamFunction · 0.85
DrawFrameFunction · 0.85
LocalizeStringFunction · 0.85
swapFunction · 0.85
FocusOnMethod · 0.80
UnitWithIDMethod · 0.80
GetReportedDownMethod · 0.80
IsGroupLeaderMethod · 0.80
GetVehicleInMethod · 0.80
GetPersonMethod · 0.80
GetWorstStateReportedMethod · 0.80

Tested by

no test coverage detected