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

Method InitComboBox

ogsr_engine/xrGame/ui/UIXmlInit.cpp:1489–1528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1487}
1488
1489bool CUIXmlInit::InitComboBox(CUIXml& xml_doc, const char* path, int index, CUIComboBox* pWnd)
1490{
1491 u32 color;
1492 CGameFont* pFont;
1493
1494 pWnd->SetListLength(xml_doc.ReadAttribInt(path, index, "list_length", 4));
1495
1496 InitWindow(xml_doc, path, index, pWnd);
1497 InitOptionsItem(xml_doc, path, index, pWnd);
1498
1499 bool b = (1 == xml_doc.ReadAttribInt(path, index, "always_show_scroll", 1));
1500
1501 pWnd->m_list.SetFixedScrollBar(b);
1502
1503 string512 _path;
1504 strconcat(sizeof(_path), _path, path, ":list_font");
1505 InitFont(xml_doc, _path, index, color, pFont);
1506 pWnd->SetFont(pFont);
1507 pWnd->m_list.SetFont(pFont);
1508 pWnd->m_list.SetTextColor(color);
1509 strconcat(sizeof(_path), _path, path, ":list_font_s");
1510 InitFont(xml_doc, _path, index, color, pFont);
1511 pWnd->m_list.SetTextColorS(color);
1512
1513 strconcat(sizeof(_path), _path, path, ":text_color:e");
1514 if (xml_doc.NavigateToNode(_path, index))
1515 {
1516 color = GetColor(xml_doc, _path, index, 0x00);
1517 pWnd->SetTextColor(color);
1518 }
1519
1520 strconcat(sizeof(_path), _path, path, ":text_color:d");
1521 if (xml_doc.NavigateToNode(_path, index))
1522 {
1523 color = GetColor(xml_doc, _path, index, 0x00);
1524 pWnd->SetTextColorD(color);
1525 }
1526
1527 return true;
1528}
1529
1530u32 CUIXmlInit::GetColor(CUIXml& xml_doc, const char* path, int index, u32 def_clr)
1531{

Callers

nothing calls this directly

Calls 9

GetColorFunction · 0.85
SetListLengthMethod · 0.80
ReadAttribIntMethod · 0.80
SetFixedScrollBarMethod · 0.80
SetTextColorSMethod · 0.80
NavigateToNodeMethod · 0.80
SetFontMethod · 0.45
SetTextColorMethod · 0.45
SetTextColorDMethod · 0.45

Tested by

no test coverage detected