MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / construct

Method construct

ogsr_engine/xrGame/EliteDetector.cpp:56–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void CUIArtefactDetectorElite::construct(CEliteDetector* p)
57{
58 m_parent = p;
59 CUIXml uiXml;
60 bool xml_result = uiXml.Init(CONFIG_PATH, UI_PATH, "ui_detector_artefact.xml");
61 if (xml_result)
62 {
63 string512 buff;
64 xr_strcpy(buff, p->ui_xml_tag());
65
66 CUIXmlInit::InitWindow(uiXml, buff, 0, this);
67
68 m_wrk_area = xr_new<CUIWindow>();
69
70 xr_sprintf(buff, "%s:wrk_area", p->ui_xml_tag());
71
72 CUIXmlInit::InitWindow(uiXml, buff, 0, m_wrk_area);
73 m_wrk_area->SetAutoDelete(true);
74 AttachChild(m_wrk_area);
75
76 xr_sprintf(buff, "%s", p->ui_xml_tag());
77 XML_NODE* pStoredRoot = uiXml.GetLocalRoot();
78 uiXml.SetLocalRoot(uiXml.NavigateToNode(buff, 0));
79
80 const int num = uiXml.GetNodesNum(buff, 0, "palette");
81 if (num > 0)
82 {
83 for (int idx = 0; idx < num; ++idx)
84 {
85 CUIStatic* S = xr_new<CUIStatic>();
86 shared_str name = uiXml.ReadAttrib("palette", idx, "id");
87 m_palette[name] = S;
88 CUIXmlInit::InitStatic(uiXml, "palette", idx, S);
89 S->SetAutoDelete(true);
90 m_wrk_area->AttachChild(S);
91 S->SetCustomDraw(true);
92 }
93 }
94 else
95 {
96 CUIStatic* S = xr_new<CUIStatic>();
97 m_palette[AF_SIGN] = S;
98 CUIXmlInit::InitStatic(uiXml, AF_SIGN, 0, S);
99 S->SetAutoDelete(true);
100 m_wrk_area->AttachChild(S);
101 S->SetCustomDraw(true);
102 }
103 uiXml.SetLocalRoot(pStoredRoot);
104 }
105 else
106 {
107 // R_ASSERT3(xml_result, "xml file not found", "ui_detector_artefact.xml");
108 Msg("!![%s] xml file [ui_detector_artefact.xml] not found!", __FUNCTION__);
109 }
110
111 Fvector _map_attach_p = pSettings->r_fvector3(m_parent->cNameSect(), "ui_p");
112 Fvector _map_attach_r = pSettings->r_fvector3(m_parent->cNameSect(), "ui_r");
113

Callers 1

CreateUIMethod · 0.45

Calls 11

MsgFunction · 0.85
NavigateToNodeMethod · 0.80
GetNodesNumMethod · 0.80
ReadAttribMethod · 0.80
AttachChildMethod · 0.80
setHPBMethod · 0.80
translate_overMethod · 0.80
InitMethod · 0.45
ui_xml_tagMethod · 0.45
r_fvector3Method · 0.45
mulMethod · 0.45

Tested by

no test coverage detected