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

Method Init

ogsr_engine/xrGame/string_table.cpp:18–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16shared_str CStringTable::GetLanguage() { return pData->m_sLanguage; }
17
18void CStringTable::Init()
19{
20 if (pData)
21 return;
22
23 pData = xr_new<STRING_TABLE_DATA>();
24
25 //имя языка, если не задано (NULL), то первый <text> в <string> в XML
26 SetLanguage();
27
28 LPCSTR S = pSettings->r_string("string_table", "files");
29 if (S && S[0])
30 {
31 string128 xml_file;
32 int count = _GetItemCount(S);
33 for (int it = 0; it < count; ++it)
34 {
35 _GetItem(S, it, xml_file);
36 Load(xml_file);
37 }
38 }
39
40 if (pSettings->section_exist("string_table_files"))
41 {
42 CInifile::Sect& files = pSettings->r_section("string_table_files");
43 for (const auto& i : files.Ordered_Data)
44 Load(i.first.c_str());
45 }
46}
47
48void CStringTable::Load(LPCSTR xml_file)
49{

Callers 1

LoadMethod · 0.45

Calls 6

_GetItemCountFunction · 0.85
_GetItemFunction · 0.85
LoadFunction · 0.85
section_existMethod · 0.80
r_stringMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected