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

Method OnDraw

engine/Poseidon/UI/Map/UIMapDisplayBriefing.cpp:1535–1579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1533}
1534
1535void DisplayMap::OnDraw(EntityAI* vehicle, float alpha)
1536{
1537 // Compass orientation
1538 Camera* camera = GScene->GetCamera();
1539 if (camera)
1540 {
1541 Vector3Val dir = camera->Direction();
1542 _compass->SetOrient(Vector3(dir.X(), dir.Z(), dir.Y()), Vector3(0, 0, -1));
1543 }
1544 // Radio slots
1545 SetRadioText();
1546 // Show / hide mission name
1547 _name->ShowCtrl(_briefing->ActiveBookmark() >= 0);
1548 // GPS position
1549 Object* cameraOn = GWorld->CameraOn();
1550 if (cameraOn)
1551 {
1552 char buffer[16];
1553 PositionToAA11(cameraOn->Position(), buffer);
1554 _gpsCtrl->SetText(buffer);
1555 }
1556 else
1557 {
1558 _gpsCtrl->SetText("----");
1559 }
1560
1561 // tooltip
1562 RString tooltip;
1563 const HTMLField* field = _briefing->GetActiveField();
1564 if (_currentUnit >= 0 && field)
1565 {
1566 tooltip = GetTooltip(_weaponsInfo._weapons[_currentUnit], field->href);
1567 }
1568 _briefing->SetTooltip(tooltip);
1569
1570 // FIX: do not show notepad for dead units (not for unassigned JIP players)
1571 Person* player = GWorld->GetRealPlayer();
1572 AIUnit* playerUnit = player ? player->Brain() : nullptr;
1573 if (playerUnit && playerUnit->GetLifeState() == AIUnit::LSDead)
1574 {
1575 ShowNotepad(false);
1576 }
1577
1578 Display::OnDraw(vehicle, alpha);
1579}
1580
1581void DisplayMap::OnSimulate(EntityAI* vehicle)
1582{

Callers

nothing calls this directly

Calls 15

PositionToAA11Function · 0.85
GetTooltipFunction · 0.85
ShowNotepadFunction · 0.85
GetCameraMethod · 0.80
ShowCtrlMethod · 0.80
ActiveBookmarkMethod · 0.80
CameraOnMethod · 0.80
GetActiveFieldMethod · 0.80
SetTooltipMethod · 0.80
GetRealPlayerMethod · 0.80
BrainMethod · 0.80
GetLifeStateMethod · 0.80

Tested by

no test coverage detected