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

Method FillUpList

ogsr_engine/xrGame/ui/UIDebugFonts.cpp:47–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45#include "../string_table.h"
46
47void CUIDebugFonts::FillUpList()
48{
49 CFontManager::FONTS_VEC& v = UI()->Font()->m_all_fonts;
50 CFontManager::FONTS_VEC_IT it = v.begin();
51 CFontManager::FONTS_VEC_IT it_e = v.end();
52 Fvector2 pos, sz;
53 pos.set(0, 0);
54 sz.set(UI_BASE_WIDTH, UI_BASE_HEIGHT);
55 string256 str;
56 for (; it != it_e; ++it)
57 {
58 CGameFont* F = *(*it);
59 CUIStatic* pItem = xr_new<CUIStatic>();
60 pItem->SetWndPos(pos);
61 pItem->SetWndSize(sz);
62 sprintf_s(str, "%s:%s", *F->m_font_name, *CStringTable().translate("Test_Font_String"));
63 pItem->SetFont(F);
64 pItem->SetText(str);
65 pItem->SetTextComplexMode(false);
66 pItem->SetVTextAlignment(valCenter);
67 pItem->SetTextAlignment(CGameFont::alCenter);
68 pItem->AdjustHeightToText();
69 pos.y += pItem->GetHeight() + 20.0f;
70 pItem->SetAutoDelete(true);
71 AttachChild(pItem);
72 }
73}
74
75#endif

Callers

nothing calls this directly

Calls 15

UIFunction · 0.85
CStringTableClass · 0.85
FontMethod · 0.80
AdjustHeightToTextMethod · 0.80
GetHeightMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
setMethod · 0.45
SetWndPosMethod · 0.45
SetWndSizeMethod · 0.45
translateMethod · 0.45
SetFontMethod · 0.45

Tested by

no test coverage detected