| 10 | using namespace bg3se; |
| 11 | |
| 12 | void 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 | |
| 40 | HANDLE ExtenderMutex{ NULL }; |
| 41 |
no test coverage detected