Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Commit 45e3d24

Browse files
committed
[X-CELL] Added new settings for plugins .ini (request dyc)
1 parent ef37f7b commit 45e3d24

5 files changed

Lines changed: 41 additions & 4 deletions

File tree

fomod/info.xml

0 Bytes
Binary file not shown.

source/XCellModuleProfile.cpp

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#include <memory>
1414

15+
#include <f4se/GameSettings.h>
16+
1517
namespace XCell
1618
{
1719
std::map<UInt64, shared_ptr<ParseINI>> _cache_inifiles;
@@ -118,8 +120,8 @@ namespace XCell
118120
if (!DefaultValue)
119121
DefaultValue = "";
120122

121-
/*_MESSAGE("AppName: \"%s\", KeyName: \"%s\", DefaultValue: \"%s\", Size: \"%u\", FileName: \"%s\"",
122-
AppName, KeyName, DefaultValue, Size, FileName);*/
123+
//_MESSAGE("AppName: \"%s\", KeyName: \"%s\", DefaultValue: \"%s\", Size: \"%u\", FileName: \"%s\"",
124+
// AppName, KeyName, DefaultValue, Size, FileName);
123125

124126
ParseINI* Data;
125127
// Enum all sections or error parse file
@@ -210,8 +212,8 @@ namespace XCell
210212

211213
SetLastError(0);
212214

213-
/*_MESSAGE("AppName: \"%s\", KeyName: \"%s\", DefaultValue: \"%i\", FileName: \"%s\"",
214-
AppName, KeyName, DefaultValue, FileName);*/
215+
//_MESSAGE("AppName: \"%s\", KeyName: \"%s\", DefaultValue: \"%i\", FileName: \"%s\"",
216+
// AppName, KeyName, DefaultValue, FileName);
215217

216218
ParseINI* Data;
217219
if (!ParseINIAndStoreCache(&Data, FileName))
@@ -285,6 +287,29 @@ namespace XCell
285287
return TRUE;
286288
}
287289

290+
static bool hk_subC30008()
291+
{
292+
auto iniDef = *(g_iniSettings.GetPtr());
293+
auto iniPref = *(g_iniPrefSettings.GetPtr());
294+
295+
auto pSettingSrc = iniPref->data;
296+
297+
do
298+
{
299+
auto pSettingDst = iniDef->Get(pSettingSrc->data->name);
300+
if (!pSettingDst)
301+
{
302+
auto pNewNode = new SettingCollectionList::Node;
303+
pNewNode->next = iniDef->data;
304+
pNewNode->data = pSettingSrc->data;
305+
iniDef->data = pNewNode;
306+
}
307+
308+
} while (pSettingSrc = pSettingSrc->next);
309+
310+
return false;
311+
}
312+
288313
ModuleProfile::ModuleProfile(void* Context) :
289314
Module(Context, SourceName, CVarProfile)
290315
{}
@@ -315,6 +340,9 @@ namespace XCell
315340
REL::Impl::DetourIAT(base, "kernel32.dll", "GetPrivateProfileStringA", (uintptr_t)&HKGetPrivateProfileStringA);
316341
REL::Impl::DetourIAT(base, "kernel32.dll", "GetPrivateProfileIntA", (uintptr_t)&HKGetPrivateProfileIntA);
317342

343+
// Add new settings for plugins .ini
344+
REL::Impl::DetourCall(REL::ID(300), (UInt64)&hk_subC30008);
345+
318346
return S_OK;
319347
}
320348

source/XCellTableID.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ namespace XCell
129129
{ 267, 0x52A80 },
130130
// 2F3BE2 ??? Keyword?
131131
// 42B380
132+
133+
// PROFILE
134+
{ 300, 0xD3645E },
132135
});
133136

134137
TableID K_984(RUNTIME_VERSION_1_10_984, {
@@ -224,6 +227,9 @@ namespace XCell
224227
{ 288, 0x3F18BB },
225228
{ 289, 0x4AEF51 },
226229

230+
// PROFILE
231+
{ 300, 0xBAA967 },
232+
227233
});
228234

229235
TableID K_191(RUNTIME_VERSION_1_11_191, {
@@ -320,6 +326,9 @@ namespace XCell
320326
{ 289, 0x502E71 },
321327

322328
// 29305E << new need test
329+
330+
// PROFILE
331+
{ 300, 0xC30008 },
323332
});
324333
}
325334
}

version/build_version.txt

0 Bytes
Binary file not shown.

version/resource_version2.h

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)