Skip to content

Commit 546c456

Browse files
revolucasXottab-DUTY
authored andcommitted
+ added the ability to reload system ini through lua script via the namespace function reload_system_ini()
+ added DEBUG Msg for .thm parsing
1 parent 37a70ed commit 546c456

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/Layers/xrRender/TextureDescrManager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ void CTextureDescrMngr::LoadTHM(LPCSTR initial)
3737
string_path fn;
3838
for (; It != It_e; ++It)
3939
{
40+
#ifdef DEBUG
41+
//Alundaio: Print list of *.thm to find bad .thms!
42+
Msg("%s", (*It).name.c_str());
43+
#endif
4044
FS.update_path(fn, initial, (*It).name.c_str());
4145
IReader* F = FS.r_open(fn);
4246
xr_strcpy(fn, (*It).name.c_str());

src/xrServerEntities/script_ini_file_script.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ CScriptIniFile* create_ini_file(LPCSTR ini_string)
4242
}
4343
#pragma warning(pop)
4444

45+
//Alundaio: The extended ability to reload system ini after application launch
46+
CScriptIniFile* reload_system_ini()
47+
{
48+
pSettings->Destroy(const_cast<CInifile*>(pSettings));
49+
string_path fname;
50+
FS.update_path(fname, "$game_config$", "system.ltx");
51+
pSettings = new CInifile(fname);
52+
return (CScriptIniFile*)pSettings;
53+
}
54+
//Alundaio: END
55+
4556
#ifdef XRGAME_EXPORTS
4657
CScriptIniFile* get_game_ini() { return (CScriptIniFile*)pGameIni; }
4758
#endif
@@ -52,6 +63,26 @@ static void CScriptIniFile_Export(lua_State* luaState)
5263
[
5364
class_<CScriptIniFile>("ini_file")
5465
.def(constructor<LPCSTR>())
66+
//Alundaio: Extend script ini file
67+
.def("w_bool", &CScriptIniFile::w_bool)
68+
.def("w_color", &CScriptIniFile::w_color)
69+
.def("w_fcolor", &CScriptIniFile::w_fcolor)
70+
.def("w_float", &CScriptIniFile::w_float)
71+
.def("w_vector2", &CScriptIniFile::w_fvector2)
72+
.def("w_vector", &CScriptIniFile::w_fvector3)
73+
.def("w_s16", &CScriptIniFile::w_s16)
74+
.def("w_s32", &CScriptIniFile::w_s32)
75+
.def("w_s64", &CScriptIniFile::w_s64)
76+
.def("w_s8", &CScriptIniFile::w_s8)
77+
.def("w_string", &CScriptIniFile::w_string)
78+
.def("w_u16", &CScriptIniFile::w_u16)
79+
.def("w_u32", &CScriptIniFile::w_u32)
80+
.def("w_u64", &CScriptIniFile::w_u64)
81+
.def("w_u8", &CScriptIniFile::w_u8)
82+
.def("save_as", (bool (CScriptIniFile::*)(LPCSTR))(&CScriptIniFile::save_as))
83+
.def("save_at_end", &CScriptIniFile::save_at_end)
84+
.def("remove_line", &CScriptIniFile::remove_line)
85+
//Alundaio: END
5586
.def("section_exist", &CScriptIniFile::section_exist)
5687
.def("line_exist", (bool (CScriptIniFile::*)(LPCSTR, LPCSTR) const)&CScriptIniFile::line_exist)
5788
.def("r_clsid", &CScriptIniFile::r_clsid)
@@ -68,6 +99,9 @@ static void CScriptIniFile_Export(lua_State* luaState)
6899
#ifdef XRGAME_EXPORTS
69100
def("game_ini", &get_game_ini),
70101
#endif
102+
//Alundaio: extend
103+
def("reload_system_ini", &reload_system_ini),
104+
//Alundaio:: END
71105
def("system_ini", &get_system_ini), def("create_ini_file", &create_ini_file, adopt<0>())
72106
];
73107
}

0 commit comments

Comments
 (0)