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

Method OnObjectMoved

engine/Poseidon/UI/DisplayUIMenus.cpp:581–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

579void DisplayNewUser::OnObjectMoved(int idc, Vector3Par offset)
580{
581 if (idc == IDC_NEW_USER_NOTEBOOK)
582 {
583 PoseidonAssert(dynamic_cast<Control3D*>(GetCtrl(IDC_NEW_USER_HEAD_AREA)));
584 Control3D* area = static_cast<Control3D*>(GetCtrl(IDC_NEW_USER_HEAD_AREA));
585 Vector3 pos = area->GetCenter();
586 float coef = _head->Position().Z() / pos.Z();
587 _head->SetPosition(_head->Position() + coef * offset);
588 }
589 Display::OnObjectMoved(idc, offset);
590}
591
592void DisplayNewUser::OnCtrlClosed(int idc)
593{
594 if (idc == IDC_NEW_USER_NOTEBOOK)
595 {

Callers

nothing calls this directly

Calls 5

GetCtrlFunction · 0.85
GetCenterMethod · 0.45
ZMethod · 0.45
PositionMethod · 0.45
SetPositionMethod · 0.45

Tested by

no test coverage detected