Skip to content

Commit bfd47c1

Browse files
committed
Port changes from OGSR - cellItem xml optimization; improves OpenXRay#1748
1 parent f8b0f34 commit bfd47c1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/xrGame/ui/UICellItem.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ CUICellItem::~CUICellItem()
4848

4949
void CUICellItem::init()
5050
{
51-
CUIXml uiXml;
52-
if (!uiXml.Load(CONFIG_PATH, UI_PATH, UI_PATH_DEFAULT, "actor_menu_item.xml", false))
53-
return;
51+
static CUIXml uiXml;
52+
static bool isXmlReady = false;
53+
if (!isXmlReady)
54+
{
55+
uiXml.Load(CONFIG_PATH, UI_PATH, UI_PATH_DEFAULT, "actor_menu_item.xml", false);
56+
isXmlReady = true;
57+
}
5458

5559
m_text = xr_new<CUIStatic>("Text");
5660
m_text->SetAutoDelete(true);

0 commit comments

Comments
 (0)