MCPcopy Create free account
hub / github.com/Norbyte/bg3se / SetupScriptExtender

Function SetupScriptExtender

BG3Extender/Extender/Shared/dllmain.cpp:12–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace bg3se;
11
12void SetupScriptExtender(HMODULE hModule)
13{
14 gExtender = std::make_unique<ScriptExtender>();
15 auto & config = gExtender->GetConfig();
16 LoadConfig(L"ScriptExtenderSettings.json", config);
17
18 // Enable console if shift is down when the game is launched
19 if (GetAsyncKeyState(VK_SHIFT) < 0) {
20 config.CreateConsole = true;
21 }
22
23 DisableThreadLibraryCalls(hModule);
24 if (config.CreateConsole) {
25 gCoreLibPlatformInterface.GlobalConsole->Create();
26 }
27
28 if (config.DebugFlags == 0) {
29 // Disabled: DF_FunctionList, DF_NodeList ,DF_LogSuccessfulFacts, DF_LogFailedFacts, DB_LogFactFailures, DF_DumpDatabases, DF_DebugFacts, DF_LogRuleFailures
30 config.DebugFlags = DF_DebugTrace | DF_SuppressInitLog;
31 }
32
33 gExtender->Initialize();
34
35#if 0
36 DEBUG(" ***** ScriptExtender setup completed ***** ");
37#endif
38}
39
40HANDLE ExtenderMutex{ NULL };
41

Callers 1

DllMainFunction · 0.85

Calls 2

CreateMethod · 0.45
InitializeMethod · 0.45

Tested by

no test coverage detected