Skip to content

Commit a88326d

Browse files
committed
Сделал необязательной artefact_panel
гирлянду с артами на худе
1 parent 3fcb1bd commit a88326d

File tree

3 files changed

+11
-30
lines changed

3 files changed

+11
-30
lines changed

ogsr_engine/xrGame/Actor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,8 +1433,8 @@ void CActor::OnItemSlot(CInventoryItem* inventory_item, EItemPlace previous_plac
14331433

14341434
void CActor::UpdateArtefactPanel()
14351435
{
1436-
if (Level().CurrentViewEntity() && Level().CurrentViewEntity() == this) //Оно надо вообще без мультиплеера?
1437-
HUD().GetUI()->UIMainIngameWnd->m_artefactPanel->InitIcons(inventory().m_belt);
1436+
if (auto* art_pan = HUD().GetUI()->UIMainIngameWnd->m_artefactPanel)
1437+
art_pan->InitIcons(inventory().m_belt);
14381438
}
14391439

14401440
void CActor::ApplyArtefactEffects(ActorRestoreParams& r, CArtefact* artefact)

ogsr_engine/xrGame/ui/UIMainIngameWnd.cpp

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ CUIMainIngameWnd::CUIMainIngameWnd()
103103
m_pItem = NULL;
104104
UIZoneMap = xr_new<CUIZoneMap>();
105105
m_pPickUpItem = NULL;
106-
m_artefactPanel = xr_new<CUIArtefactPanel>();
107106

108107
warn_icon_list[ewiWeaponJammed] = &UIWeaponJammedIcon;
109108
warn_icon_list[ewiRadiation] = &UIRadiaitionIcon;
@@ -121,7 +120,8 @@ CUIMainIngameWnd::~CUIMainIngameWnd()
121120
{
122121
DestroyFlashingIcons();
123122
xr_delete(UIZoneMap);
124-
xr_delete(m_artefactPanel);
123+
if (m_artefactPanel)
124+
xr_delete(m_artefactPanel);
125125
HUD_SOUND::DestroySound(m_contactSnd);
126126
xr_delete(g_MissileForceShape);
127127
}
@@ -264,15 +264,12 @@ void CUIMainIngameWnd::Init()
264264
AttachChild(&UIMotionIcon);
265265
UIMotionIcon.Init();
266266

267-
m_artefactPanel->InitFromXML(uiXml, "artefact_panel", 0);
268-
this->AttachChild(m_artefactPanel);
269-
270-
//AttachChild(&UIStaticDiskIO);
271-
//UIStaticDiskIO.SetWndRect(1000, 750, 16, 16);
272-
//UIStaticDiskIO.GetUIStaticItem().SetRect(0, 0, 16, 16);
273-
//UIStaticDiskIO.InitTexture("ui\\ui_disk_io");
274-
//UIStaticDiskIO.SetOriginalRect(0, 0, 32, 32);
275-
//UIStaticDiskIO.SetStretchTexture(TRUE);
267+
if (uiXml.NavigateToNode("artefact_panel"))
268+
{
269+
m_artefactPanel = xr_new<CUIArtefactPanel>();
270+
m_artefactPanel->InitFromXML(uiXml, "artefact_panel", 0);
271+
this->AttachChild(m_artefactPanel);
272+
}
276273

277274
HUD_SOUND::LoadSound("maingame_ui", "snd_new_contact", m_contactSnd, SOUND_TYPE_IDLE);
278275
}
@@ -281,21 +278,6 @@ float UIStaticDiskIO_start_time = 0.0f;
281278

282279
void CUIMainIngameWnd::Draw()
283280
{
284-
// show IO icon
285-
//bool IOActive = (FS.dwOpenCounter > 0);
286-
//if (IOActive)
287-
// UIStaticDiskIO_start_time = Device.fTimeGlobal;
288-
289-
//if ((UIStaticDiskIO_start_time + 1.0f) < Device.fTimeGlobal)
290-
// UIStaticDiskIO.Show(false);
291-
//else
292-
//{
293-
// u32 alpha = clampr(iFloor(255.f * (1.f - (Device.fTimeGlobal - UIStaticDiskIO_start_time) / 1.f)), 0, 255);
294-
// UIStaticDiskIO.Show(true);
295-
// UIStaticDiskIO.SetColor(color_rgba(255, 255, 255, alpha));
296-
//}
297-
//FS.dwOpenCounter = 0;
298-
299281
if (!m_pActor)
300282
return;
301283

ogsr_engine/xrGame/ui/UIMainIngameWnd.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class CUIMainIngameWnd : public CUIWindow
3939
bool OnKeyboardPress(int dik);
4040

4141
protected:
42-
//CUIStatic UIStaticDiskIO;
4342
CUIStatic UIStaticHealth;
4443
CUIStatic UIStaticArmor;
4544
CUIStatic UIStaticQuickHelp;
@@ -83,7 +82,7 @@ class CUIMainIngameWnd : public CUIWindow
8382
CUIScrollView* m_UIIcons{};
8483

8584
public:
86-
CUIArtefactPanel* m_artefactPanel;
85+
CUIArtefactPanel* m_artefactPanel{};
8786

8887
public:
8988
// Енумы соответсвующие предупреждающим иконкам

0 commit comments

Comments
 (0)