diff --git a/ogsr_engine/xrGame/ui/UIArtefactPanel.cpp b/ogsr_engine/xrGame/ui/UIArtefactPanel.cpp index 110c1938ad..19f956a464 100644 --- a/ogsr_engine/xrGame/ui/UIArtefactPanel.cpp +++ b/ogsr_engine/xrGame/ui/UIArtefactPanel.cpp @@ -9,7 +9,9 @@ void CUIArtefactPanel::InitFromXML(CUIXml& xml, LPCSTR path, int index) CUIXmlInit::InitWindow(xml, path, index, this); m_cell_size.x = xml.ReadAttribFlt(path, index, "cell_width"); m_cell_size.y = xml.ReadAttribFlt(path, index, "cell_height"); - m_fScale = xml.ReadAttribFlt(path, index, "scale"); + m_fScale = xml.ReadAttribFlt(path, index, "scale", 1); + m_iIndent = xml.ReadAttribFlt(path, index, "indent", 1); + m_bVert = xml.ReadAttribInt(path, index, "vert") == 1; } void CUIArtefactPanel::InitIcons(const TIItemContainer& artefacts) @@ -29,7 +31,6 @@ void CUIArtefactPanel::InitIcons(const TIItemContainer& artefacts) void CUIArtefactPanel::Draw() { - const float iIndent = 1.0f; float x = 0.0f; float y = 0.0f; float iHeight; @@ -52,7 +53,10 @@ void CUIArtefactPanel::Draw() m_si.SetRect(0, 0, iWidth, iHeight); m_si.SetPos(x, y); - x = x + iIndent + iWidth; + if (!m_bVert) + x = x + m_iIndent + iWidth; + else + y = y + m_iIndent + iHeight; m_si.Render(); } diff --git a/ogsr_engine/xrGame/ui/UIArtefactPanel.h b/ogsr_engine/xrGame/ui/UIArtefactPanel.h index 6d2abc6d7c..b17499b17d 100644 --- a/ogsr_engine/xrGame/ui/UIArtefactPanel.h +++ b/ogsr_engine/xrGame/ui/UIArtefactPanel.h @@ -18,6 +18,8 @@ class CUIArtefactPanel : public CUIWindow void InitFromXML(CUIXml& xml, LPCSTR path, int index); protected: + bool m_bVert; + float m_iIndent; float m_fScale; Fvector2 m_cell_size; xr_vector m_vRects; diff --git a/ogsr_engine/xrGame/ui/UIProgressBar.cpp b/ogsr_engine/xrGame/ui/UIProgressBar.cpp index 39ef9dbaa9..d2ccf8b1b2 100644 --- a/ogsr_engine/xrGame/ui/UIProgressBar.cpp +++ b/ogsr_engine/xrGame/ui/UIProgressBar.cpp @@ -10,6 +10,7 @@ CUIProgressBar::CUIProgressBar() m_bBackgroundPresent = false; m_bUseColor = false; + m_bUseMidColor = false; m_bUseGradient = true; AttachChild(&m_UIBackgroundItem); @@ -55,7 +56,10 @@ void CUIProgressBar::UpdateProgressBar() if (m_bUseGradient) { Fcolor curr; - curr.lerp(m_minColor, m_middleColor, m_maxColor, fCurrentLength); + if (m_bUseMidColor) + curr.lerp(m_minColor, m_middleColor, m_maxColor, fCurrentLength); + else + curr.lerp(m_minColor, m_maxColor, fCurrentLength); m_UIProgressItem.SetTextureColor(curr.get()); } else diff --git a/ogsr_engine/xrGame/ui/UIProgressBar.h b/ogsr_engine/xrGame/ui/UIProgressBar.h index 17b02274fd..4f5ea8e30d 100644 --- a/ogsr_engine/xrGame/ui/UIProgressBar.h +++ b/ogsr_engine/xrGame/ui/UIProgressBar.h @@ -35,6 +35,7 @@ class CUIProgressBar : public CUIWindow public: bool m_bUseColor; + bool m_bUseMidColor; bool m_bUseGradient; // Alundaio: if false then use only solid color with m_maxColor Fcolor m_minColor; Fcolor m_middleColor; diff --git a/ogsr_engine/xrGame/ui/UIXmlInit.cpp b/ogsr_engine/xrGame/ui/UIXmlInit.cpp index c0461fcbf6..1a155c2e6e 100644 --- a/ogsr_engine/xrGame/ui/UIXmlInit.cpp +++ b/ogsr_engine/xrGame/ui/UIXmlInit.cpp @@ -666,9 +666,12 @@ bool CUIXmlInit::InitProgressBar(CUIXml& xml_doc, LPCSTR path, int index, CUIPro pWnd->m_minColor.set(color); strconcat(sizeof(buf), buf, path, ":middle_color"); - - color = GetColor(xml_doc, buf, index, 0xff); - pWnd->m_middleColor.set(color); + if (xml_doc.NavigateToNode(buf, index)) + { + pWnd->m_bUseMidColor = true; + color = GetColor(xml_doc, buf, index, 0xff); + pWnd->m_middleColor.set(color); + } strconcat(sizeof(buf), buf, path, ":max_color");