Skip to content

Commit

Permalink
Fixed elite detector doesn't show artefacts (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Oct 10, 2019
1 parent 3c7e9ff commit e1a4a46
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/xrGame/EliteDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "xrUICore/Static/UIStatic.h"
#include "ui/ArtefactDetectorUI.h"

constexpr cpcstr AF_SIGN = "af_sign";

CEliteDetector::CEliteDetector() { m_artefacts.m_af_rank = 3; }
CEliteDetector::~CEliteDetector() {}
void CEliteDetector::CreateUI()
Expand Down Expand Up @@ -95,15 +97,28 @@ void CUIArtefactDetectorElite::construct(CEliteDetector* p)
AttachChild(m_wrk_area);

xr_sprintf(buff, "%s", p->ui_xml_tag());
int num = uiXml.GetNodesNum(buff, 0, "palette");
XML_NODE pStoredRoot = uiXml.GetLocalRoot();
uiXml.SetLocalRoot(uiXml.NavigateToNode(buff, 0));
for (int idx = 0; idx < num; ++idx)

const int num = uiXml.GetNodesNum(buff, 0, "palette");
if (num > 0)
{
for (int idx = 0; idx < num; ++idx)
{
CUIStatic* S = new CUIStatic();
shared_str name = uiXml.ReadAttrib("palette", idx, "id");
m_palette[name] = S;
CUIXmlInit::InitStatic(uiXml, "palette", idx, S);
S->SetAutoDelete(true);
m_wrk_area->AttachChild(S);
S->SetCustomDraw(true);
}
}
else
{
CUIStatic* S = new CUIStatic();
shared_str name = uiXml.ReadAttrib("palette", idx, "id");
m_palette[name] = S;
CUIXmlInit::InitStatic(uiXml, "palette", idx, S);
m_palette[AF_SIGN] = S;
CUIXmlInit::InitStatic(uiXml, AF_SIGN, 0, S);
S->SetAutoDelete(true);
m_wrk_area->AttachChild(S);
S->SetCustomDraw(true);
Expand Down

0 comments on commit e1a4a46

Please sign in to comment.