### void PreInit() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/bugs-module.md Hooks globally uncaught exceptions before Kenshi initializes by installing a vectored exception handler. ```APIDOC ## void PreInit() ### Description First initialization stage—hooks globally uncaught exceptions before Kenshi initializes. Installs a vectored exception handler (VEH) to catch unhandled exceptions. ### Signature void PreInit(); ``` -------------------------------- ### Integration Example Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/miscellaneous-hooks.md Demonstrates full initialization and dynamic settings updates for RNG and camera distance hooks. ```cpp #include "MiscHooks.h" #include "Settings.h" void InitializeMiscHooks() { // Initialize hooks MiscHooks::Init(); // Apply settings if (Settings::GetFixRNG()) { MiscHooks::SetFixRNG(true); } if (Settings::GetIncreaseMaxCameraDistance()) { float maxDist = 300.0f; MiscHooks::SetMaxCameraDistance(maxDist); } } // In settings UI change handler void OnSettingsChanged() { // Apply RNG fix bool fixRNG = GetCheckboxValue("FixRNG"); MiscHooks::SetFixRNG(fixRNG); Settings::SetFixRNG(fixRNG); // Apply camera distance bool increaseCamera = GetCheckboxValue("IncreaseMaxCameraDistance"); if (increaseCamera) { float maxDist = GetSliderValue("MaxCameraDistance"); MiscHooks::SetMaxCameraDistance(maxDist); } } ``` -------------------------------- ### Install Push-Return Hook Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/escort.md Installs a hook that pushes the return address to the stack before jumping to the target, allowing for function chaining. ```cpp void PushRetHook(void* sourceAddr, void* targetAddr, size_t replacedBytes); ``` -------------------------------- ### Drive Type Usage Example Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/io-module.md Demonstrates adjusting application settings based on the detected storage medium. ```cpp IO::Init(); // Check if game folder is on an SSD IO::DriveType gameType = IO::GetDriveStorageType("C:\\Games\\Kenshi"); if (gameType == IO::SSD || gameType == IO::SCM) { // Enable aggressive streaming Settings::SetPreloadHeightmap(true); } else if (gameType == IO::HDD) { // Use conservative loading to avoid stalls Settings::SetProfileLoads(true); } else { // Unknown or query failed Settings::SetProfileLoads(true); } ``` -------------------------------- ### Install Basic Hook Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/escort.md Installs a hook that overwrites bytes at the source address with a call to the target function. The original code is lost. ```cpp void Hook(void* sourceAddr, void* targetAddr, size_t replacedBytes); ``` ```cpp void MyHook() { /* handle hook */ } Escort::Init(); Escort::Hook((void*)0x140000000, (void*)&MyHook, 5); ``` -------------------------------- ### ReportUserBug Usage Examples Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/bugs-module.md Demonstrates standard bug reporting and reporting with a pre-fetched UUID. ```cpp // Called from in-game "Report Bug" dialog std::string userDescription = "Mod list scroll is janky when scrolling fast"; bool success = Bugs::ReportUserBug(userDescription); if (success) { ShowMessage("Bug reported! Thank you for helping improve RE_Kenshi"); } else { ShowMessage("Could not send bug report - check internet connection"); } ``` ```cpp std::string uuid = Bugs::GetUUIDHash(); bool success = Bugs::ReportUserBug( "Heightmap flickers during camera pan", uuid ); ``` -------------------------------- ### RE_Kenshi.json example Source: https://github.com/bfrizzlefoshizzle/re_kenshi/wiki/Using-RE_Kenshi-to-mod-hard-coded-file-paths Example of a RE_Kenshi.json file demonstrating how to map file paths for replacement. ```json { "FileRebinds" : { "file/to/replace.png": "path/of/replacement.png", "file\\to/replace2.png": "paths\\must/be/json/string\\escaped.png", "file/to/replace3.png": "$(modroot \"Your mod name here\")/this_path_is_from_the_root_of_your_mod/replacement.png", "file/to/replace4.png": "if_you_put_a_comma_after_the_last_file_everything_breaks.png" } } ``` -------------------------------- ### Install 32-bit Relative Jump Hook with Auto-Prologue Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/escort.md Automatically determines the prologue size using SEH metadata. Returns nullptr if the prologue is shorter than 5 bytes. ```cpp template T* JmpReplaceHook32(void* sourceAddr, void* targetAddr); ``` ```cpp auto original = Escort::JmpReplaceHook32( (void*)0x140000000, (void*)&MyReplacement ); ``` -------------------------------- ### void PushRetHook(void* sourceAddr, void* targetAddr, size_t replacedBytes) Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/escort.md Installs a hook that pushes the return address onto the stack before jumping to the target function, enabling hook chaining. ```APIDOC ## void PushRetHook(void* sourceAddr, void* targetAddr, size_t replacedBytes) ### Description Installs a hook that pushes the return address and calls the target function, allowing the hook to be chained. The hook can call the original code or return directly. ### Parameters - **sourceAddr** (void*) - Address of the code to be hooked - **targetAddr** (void*) - Address of the hook handler function - **replacedBytes** (size_t) - Number of bytes to replace ``` -------------------------------- ### Sound Bank Configuration Format Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/sound-module.md Example JSON structure for defining sound banks in the mod configuration. ```json { "SoundBanks": [ "Custom_Audio.bnk", "Music_Overrides.bnk", "Ambient_Sounds.bnk" ] } ``` -------------------------------- ### Implement and Use TLS::GCTLSObj Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/types.md Example of inheriting from GCTLSObj to manage thread-local data and accessing it via TLSSlot. ```cpp class MyThreadLocalData : public TLS::GCTLSObj { public: int counter = 0; std::string name; ~MyThreadLocalData() { /* cleanup */ } }; typedef TLS::TLSSlot MyDataSlot; DWORD MyDataSlot::TLSSlotIndex = TLS_OUT_OF_INDEXES; // Usage: MyThreadLocalData* data = new MyThreadLocalData(); MyDataSlot::SetPtr(data); auto ptr = MyDataSlot::GetPtr(); // Retrieved per-thread ``` -------------------------------- ### RE_Kenshi.json example Source: https://github.com/bfrizzlefoshizzle/re_kenshi/wiki/Using-RE_Kenshi-to-mod-sound-banks This is an example of the RE_Kenshi.json file used to specify sound banks for a Kenshi mod. ```json { "SoundBanks": [ "$(modroot \"sound_test\")/New_SoundBank.bnk" ] } ``` -------------------------------- ### Audio Log Output Format Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/sound-module.md Example of the verbose output generated in the debug log when logging is enabled. ```text [Audio] Loading bank: Custom_Audio.bnk [Audio] Bank loaded, ID: 0x12345678 [Audio] Queuing event: Play_Footstep_Concrete [Audio] Event queued with 3 instances ``` -------------------------------- ### Retrieve display version string in C++ Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/version-module.md Gets a user-friendly version string suitable for UI elements, potentially including status indicators. ```cpp std::string GetDisplayVersion(); ``` ```cpp // In game menu initialization std::string displayVersion = Version::GetDisplayVersion(); menuLabel->setCaption("RE_Kenshi " + displayVersion); // Possible outputs: // "1.2.3" // "1.2.3 (Beta)" // "1.2.3 (Update Available)" ``` -------------------------------- ### Mod Configuration Schema Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/README.md Example structure for the mod-config.json file used to rebind file paths and define sound banks. ```json { "FileRebinds": { "data/path": "mods/custom" }, "SoundBanks": [ "mods/audio/bank.bnk" ] } ``` -------------------------------- ### Adaptive Resource Loading Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/io-module.md Configures resource loading strategies based on whether the game is installed on fast or slow storage. ```cpp void InitializeResourceLoading() { IO::Init(); // Get storage type for game install IO::DriveType driveType = IO::GetDriveStorageType("."); bool isFast = (driveType == IO::SSD || driveType == IO::SCM); // Enable heightmap preloading on fast drives if (isFast) { Settings::SetHeightmapMode(HeightmapHook::COMPRESSED); Settings::SetPreloadHeightmap(true); } else { // Use vanilla or fast uncompressed mode on HDD Settings::SetHeightmapMode(HeightmapHook::FAST_UNCOMPRESSED); Settings::SetPreloadHeightmap(false); } } ``` -------------------------------- ### Install 32-bit Relative Jump Hook Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/escort.md Replaces a function with a 32-bit relative jump while preserving the original prologue. Requires at least 5 bytes and a target within ±2GB. ```cpp template T* JmpReplaceHook32(void* sourceAddr, void* targetAddr, size_t replacedBytes); ``` ```cpp typedef void (*OriginalFunc)(); OriginalFunc original = Escort::JmpReplaceHook32( (void*)0x140000000, (void*)&MyReplacement, 5 ); if (original) { original(); // Call the original function } ``` -------------------------------- ### Get Recommended Heightmap Mode Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/heightmap-hook.md Determines the optimal heightmap mode based on hardware, memory, and file availability. ```cpp HeightmapMode GetRecommendedHeightmapMode(); ``` ```cpp auto recommended = HeightmapHook::GetRecommendedHeightmapMode(); if (recommended != HeightmapHook::AUTO) { Settings::SetHeightmapMode(recommended); } ``` -------------------------------- ### void Hook(void* sourceAddr, void* targetAddr, size_t replacedBytes) Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/escort.md Installs a basic hook that redirects execution to the target function without returning to the original code. ```APIDOC ## void Hook(void* sourceAddr, void* targetAddr, size_t replacedBytes) ### Description Installs a basic hook that calls the target function without returning to the original code. Overwrites the specified number of bytes at sourceAddr with a call to targetAddr. ### Parameters - **sourceAddr** (void*) - Address of the code to be hooked - **targetAddr** (void*) - Address of the hook handler function - **replacedBytes** (size_t) - Number of bytes to replace at the source address ``` -------------------------------- ### Undo PreInit Exception Handler Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/bugs-module.md Uninstalls the VEH hook installed by PreInit. Use this for rollback if version validation fails. ```cpp void UndoPreInit(); ``` ```cpp Bugs::PreInit(); if (!Version::IsCurrentVersion()) { Bugs::UndoPreInit(); // Remove hook and abort return false; } // Kenshi version is compatible, continue Bugs::Init(); ``` -------------------------------- ### Example RE_Kenshi.json File Rebind Source: https://github.com/bfrizzlefoshizzle/re_kenshi/wiki/Finding-file-paths-for-rebinding This JSON snippet demonstrates how to configure a file rebind within the RE_Kenshi.json file, showing the original file path and its replacement path. ```json { "FileRebinds" : { "data\newland/land\fullmap.tif" : "$(modroot \"Your mod name here\")/fullmap.tif" } } ``` -------------------------------- ### Preload heightmap setting Source: https://github.com/bfrizzlefoshizzle/re_kenshi/wiki/RE_Kenshi-Features To enable preloading the entire heightmap into RAM when the game starts, set 'PreloadHeightmap' to true in RE_Kenshi.ini. ```ini "PreloadHeightmap": true ``` -------------------------------- ### void Init() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/sound-module.md Initializes the sound system and loads initial sound banks. This should be called during RE_Kenshi initialization after settings have been loaded. ```APIDOC ## void Init() ### Description Initializes the sound system and loads initial sound banks. Sets up Wwise integration hooks and initializes audio logging if enabled. ### Signature `void Init();` ### Usage Call during RE_Kenshi initialization after Settings::Init() and Settings::LoadModOverrides(). ``` -------------------------------- ### Initialize Version and Display Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/version-module.md Demonstrates initializing the version system, performing background update checks, and displaying the version in the game menu. ```cpp #include "Version.h" #include "Settings.h" #include "Bugs.h" void InitializeVersion() { // Stage 1: Initialize local version info Version::Init(); // Stage 2: Check for updates in background std::thread versionThread([] { Version::SyncInit(); }); // Stage 3: Check version compatibility if (!Version::IsCurrentVersion()) { std::string current = Version::GetCurrentVersion(); std::cout << "RE_Kenshi " << current << " available for update" << std::endl; if (Settings::GetCheckUpdates()) { NotifyUserOfUpdate(current); } } // Stage 4: Adjust settings if prerelease if (Version::IsPrerelease()) { Settings::SetAlwaysReportCrashes(true); Settings::SetLogFileIO(true); } versionThread.join(); } // In game menu init void SetupVersionDisplay() { std::string display = Version::GetDisplayVersion(); MenuLabel* versionLabel = CreateMenuLabel(); versionLabel->setText("RE_Kenshi " + display); } ``` -------------------------------- ### void InitMenu() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/bugs-module.md Sets up UI elements in the game menu for manual bug reporting. ```APIDOC ## void InitMenu() ### Description Finds or creates a "Report Bug" button/dialog in the main menu and hooks the button to open the manual bug reporting dialog. ### Signature void InitMenu(); ``` -------------------------------- ### void Init() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/version-module.md Initializes the Version module with local version information. This should be called early during startup before any version-dependent code paths are executed. ```APIDOC ## void Init() ### Description Initializes the Version module with local version information. Loads the local RE_Kenshi version string and initializes version comparison structures. ### Signature `void Init();` ### Usage Call during RE_Kenshi initialization, before version-dependent code paths. ``` -------------------------------- ### JmpReplaceHook (Absolute Jump) Usage Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/escort.md Example of using JmpReplaceHook to redirect a function at a specific memory address. ```cpp auto original = Escort::JmpReplaceHook( (void*)0x140000000, (void*)&MyReplacement, 6 ); ``` -------------------------------- ### void Init() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/io-module.md Initializes the IO module by setting up the COM infrastructure required for hardware queries. This must be called early in the application lifecycle before any other IO module functions. ```APIDOC ## void Init() ### Description Initializes the IO module by setting up COM (Component Object Model) infrastructure. This must be called early in the application lifecycle, before any calls to GetDriveStorageType(). ### Signature `void Init();` ``` -------------------------------- ### Initialize Sound System Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/sound-module.md Initializes Wwise integration and loads pre-queued sound banks. Must be called after Settings::Init() and Settings::LoadModOverrides(). ```cpp void Init(); ``` ```cpp Settings::Init(); Settings::LoadModOverrides(); Sound::Init(); // Load SoundBanks from mod config ``` -------------------------------- ### void Init() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/bugs-module.md Hooks Kenshi's crash handler after core initialization. ```APIDOC ## void Init() ### Description Second initialization stage—hooks Kenshi's built-in crash reporting function. Enables enhanced crash reports with RE_Kenshi diagnostic data. ### Signature void Init(); ``` -------------------------------- ### void SyncInit() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/version-module.md Performs a synchronous version check against the remote server. This method performs blocking network I/O and must be called from a background thread. ```APIDOC ## void SyncInit() ### Description Performs synchronous version checking against the remote server. Makes a blocking HTTP request to check for updates and updates internal version state. ### Signature `void SyncInit();` ### Usage Call in a background thread during startup. Never call from the main game thread or UI thread as it may block for 2-10 seconds. ### Example ```cpp // In a background thread void VersionCheckThread() { Version::SyncInit(); // May take several seconds // Version is now up-to-date } std::thread versionThread(VersionCheckThread); // ... continue main game initialization ... versionThread.join(); ``` ``` -------------------------------- ### CallRAXHook Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/escort.md Installs a hook using an indirect call via the RAX register, intended for naked or assembler functions. ```APIDOC ## CallRAXHook(void* sourceAddr, void* targetAddr, size_t replacedBytes) ### Description Installs a hook using an indirect call via RAX register. Used for naked/assembler functions. Note: This hook pattern corrupts the RAX register. ### Parameters - **sourceAddr** (void*) - Required - Address to hook - **targetAddr** (void*) - Required - Address of handler - **replacedBytes** (size_t) - Required - Bytes to replace ``` -------------------------------- ### void Init() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/heightmap-hook.md Initializes the heightmap hooking system after the game core has loaded. ```APIDOC ## void Init() ### Description Installs hooks into Kenshi's heightmap loading code, sets up the block-based LOD system, and applies the selected heightmap mode. Must be called after Preload(). ### Signature `void Init();` ``` -------------------------------- ### void Init() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/escort.md Initializes the Escort hooking system. This function must be called before any other hooking operations are performed. ```APIDOC ## void Init() ### Description Initializes the Escort hooking system. Must be called before any hooking operations. ### Signature `void Init();` ``` -------------------------------- ### Initialize Bug Reporting and Crash Handling Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/bugs-module.md Shows the multi-stage initialization process and how to trigger a crash report from an exception handler. ```cpp #include "Bugs.h" #include "Version.h" void InitializeBugReporting() { // Stage 1: Pre-initialization (very early) Bugs::PreInit(); // Check version compatibility if (!Version::IsCurrentVersion()) { Bugs::UndoPreInit(); // Rollback if incompatible return; } // Stage 2: Post core-init Bugs::Init(); // Stage 3: After menu is ready Bugs::InitMenu(); // System is now crash-protected with bug reporting } // Called from exception handler void HandleFatalError(const std::string& details) { // Create crash dump std::string dumpPath = CreateCrashDump(); // Report it Bugs::ReportCrash(details, dumpPath); } ``` -------------------------------- ### void Init() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/miscellaneous-hooks.md Initializes all miscellaneous hooks, including RNG fixes and camera distance expansion. This should be called during the main initialization phase. ```APIDOC ## void Init() ### Description Initializes all miscellaneous hooks. This function installs engine hooks and applies configured fixes for RNG and camera distance. ### Usage Call this function during the main RE_Kenshi initialization, after Escort initialization but before the game engine is fully running. ``` -------------------------------- ### Perform Pre-Kenshi Initialization Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/initialization-guide.md Execute these calls before the Kenshi core loads to establish exception handling and verify version compatibility. ```cpp // Very first calls in RE_Kenshi initialization IO::Init(); // Hardware detection (setup COM) Escort::Init(); // Code hooking system Bugs::PreInit(); // Pre-Kenshi exception handler Version::Init(); // Version information // At this point, if Kenshi version is not supported: if (!Version::IsCurrentVersion()) { Bugs::UndoPreInit(); // Rollback pre-init return false; // Abort mod loading } ``` -------------------------------- ### Initialize Audio System Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/sound-module.md Shows the standard initialization sequence and periodic bank loading check for the sound system. ```cpp #include "Sound.h" #include "Settings.h" void InitializeAudio() { // Load configuration Settings::Init(); Settings::LoadModOverrides(); // Initialize sound system Sound::Init(); // Enable logging if configured if (Settings::GetLogAudio()) { Sound::SetAlwaysLog(true); } } // Periodic check for deferred bank loading void UpdateAudio() { static bool banksLoaded = false; if (!banksLoaded) { Sound::TryLoadQueuedBanks(); // Check if all banks were loaded... // banksLoaded = true; // when ready } } // Example mod configuration // mod-config.json: // { // "SoundBanks": [ // "mods/custom_sfx/Master.bnk", // "mods/custom_sfx/Music.bnk" // ] // } ``` -------------------------------- ### SIC File Header Hexadecimal Representation Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/sic-codec.md Example of a 16-byte SIC header showing magic bytes, dimensions, and format flags. ```text 53 68 49 74 00 04 00 00 00 04 00 00 01 04 01 00 S h I t width=1024 height=1024 BGRA|PAETH|SEP|reserved ``` -------------------------------- ### void TryLoadQueuedBanks() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/sound-module.md Attempts to load any sound banks that have been queued for loading. This method is safe to call multiple times and checks if the Wwise system is ready. ```APIDOC ## void TryLoadQueuedBanks() ### Description Loads any sound banks that have been queued for loading. It checks if Kenshi's Wwise system is fully initialized before attempting to load. ### Signature `void TryLoadQueuedBanks();` ### Usage Call periodically during game initialization if the Wwise readiness state is uncertain, typically after the main menu is loaded. ``` -------------------------------- ### Minimal Configuration Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/configuration.md Loads RE_Kenshi with all default settings. ```json {} ``` -------------------------------- ### Perform Engine-Ready Initialization Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/initialization-guide.md Execute these calls once the Kenshi engine is fully initialized but before gameplay begins. ```cpp // After Kenshi engine is fully initialized HeightmapHook::Init(); // Install heightmap hooks MiscHooks::Init(); // Apply engine fixes ShaderCache::Init(); // Cache compilation OgreSICCodec::startup(); // Register SIC codec OgreDDSCodec2::startup(); // Register DDS codec Sound::Init(); // Initialize audio Sound::TryLoadQueuedBanks(); // Load sound banks Bugs::InitMenu(); // Setup reporting UI ``` -------------------------------- ### Manage UI Startup Settings Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/settings.md Functions to control whether the settings dialog appears automatically on game launch. ```cpp bool GetOpenSettingsOnStart(); void SetOpenSettingsOnStart(bool value); ``` -------------------------------- ### Perform Post-Kenshi Initialization Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/initialization-guide.md Execute these calls after the Kenshi core is initialized to hook systems and load configurations. ```cpp // After Kenshi::Init() or equivalent Bugs::Init(); // Hook Kenshi's crash reporter Settings::Init(); // Load saved settings Settings::LoadModOverrides(); // Load mod-config.json HeightmapHook::Preload(); // Begin heightmap preload // Continue Kenshi initialization... ``` -------------------------------- ### GetOpenSettingsOnStart / SetOpenSettingsOnStart Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/settings.md Methods to manage whether the RE_Kenshi settings dialog opens automatically on game startup. ```APIDOC ## bool GetOpenSettingsOnStart() ## void SetOpenSettingsOnStart(bool value) ### Description Controls whether the RE_Kenshi settings dialog is displayed automatically when the game starts. ### Parameters - **value** (bool) - Required for SetOpenSettingsOnStart - The boolean state to set. ``` -------------------------------- ### Perform Background/Async Initialization Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/initialization-guide.md Execute non-critical operations in a dedicated thread to avoid blocking the main game startup. ```cpp // In a dedicated thread std::thread versionThread([] { Version::SyncInit(); // Check for updates (blocking network I/O) // Process update notification if new version available }); // Main thread continues, version thread runs in background // Join before game shuts down ``` -------------------------------- ### Graceful Error Handling in Initialization Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/initialization-guide.md Demonstrates how to wrap initialization stages in try-catch blocks to distinguish between critical and non-critical failures. ```cpp bool InitializeStage2() { try { Bugs::Init(); } catch (const std::exception& e) { ErrorLog("Bugs::Init failed: " + std::string(e.what())); return false; // Abort } try { Settings::Init(); } catch (const std::exception& e) { ErrorLog("Settings::Init failed: " + std::string(e.what())); // Settings are not critical, continue with defaults } try { Settings::LoadModOverrides(); } catch (const std::exception& e) { ErrorLog("Settings::LoadModOverrides failed: " + std::string(e.what())); // Config errors not critical, continue } try { HeightmapHook::Preload(); } catch (const std::exception& e) { ErrorLog("HeightmapHook::Preload failed: " + std::string(e.what())); // Non-critical, heightmap will load normally } return true; // At least Bugs::Init succeeded } ``` -------------------------------- ### Initialization Dependency Graph Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/initialization-guide.md Visual representation of the order of operations for system initialization. ```text IO::Init() ↓ Escort::Init() ↓ Bugs::PreInit() ↓ Version::Init() ↓ [Check version] ↓ [Load Kenshi core] ↓ Bugs::Init() ↓ (parallel) Settings::Init() ────→ Settings::LoadModOverrides() ↓ HeightmapHook::Preload() ↓ [Kenshi engine init] ↓ HeightmapHook::Init() ↓ (parallel) MiscHooks::Init() ShaderCache::Init() OgreSICCodec::startup() OgreDDSCodec2::startup() ↓ Sound::Init() ────→ Sound::TryLoadQueuedBanks() ↓ Bugs::InitMenu() ↓ [Version::SyncInit() - async thread] ``` -------------------------------- ### Initialization Dependency Flow Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/INDEX.md Visual representation of the initialization sequence for IO, heightmap, and settings modules. ```text IO::Init() ↓ (uses) IO::GetDriveStorageType() ↓ (informs) HeightmapHook::GetRecommendedHeightmapMode() ↓ (sets) Settings::SetHeightmapMode() ``` -------------------------------- ### Initialize Menu UI Hooks Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/bugs-module.md Sets up UI elements for manual bug reporting in the game menu. Call after the game menu is constructed. ```cpp void InitMenu(); ``` ```cpp Bugs::Init(); // Core exception handling Bugs::InitMenu(); // Menu UI hooks ``` -------------------------------- ### Initialize REKenshi Mod Loader Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/initialization-guide.md Implements a three-stage initialization sequence within a DLL entry point. Requires careful handling of thread joining during shutdown to prevent crashes. ```cpp #include "Escort.h" #include "IO.h" #include "Bugs.h" #include "Version.h" #include "Settings.h" #include "HeightmapHook.h" #include "MiscHooks.h" #include "Sound.h" #include "ShaderCache.h" #include "OgreSICCodec.h" #include "OgreDDSCodec2.h" class REKenshiModLoader { private: std::thread versionThread; public: // Stage 1: Pre-Kenshi bool PreInitialize() { try { IO::Init(); Escort::Init(); Bugs::PreInit(); Version::Init(); // Version check if (!Version::IsCurrentVersion()) { Bugs::UndoPreInit(); return false; } return true; } catch (const std::exception& e) { ErrorLog("PreInit failed: " + std::string(e.what())); Bugs::UndoPreInit(); return false; } } // Stage 2: Post-Kenshi bool Initialize() { try { Bugs::Init(); Settings::Init(); Settings::LoadModOverrides(); HeightmapHook::Preload(); return true; } catch (const std::exception& e) { ErrorLog("Init failed: " + std::string(e.what())); return false; } } // Stage 3: Engine-ready bool PostInitialize() { try { HeightmapHook::Init(); MiscHooks::Init(); ShaderCache::Init(); OgreSICCodec::startup(); OgreDDSCodec2::startup(); Sound::Init(); Sound::TryLoadQueuedBanks(); Bugs::InitMenu(); // Start async version check versionThread = std::thread([] { Version::SyncInit(); }); return true; } catch (const std::exception& e) { ErrorLog("PostInit failed: " + std::string(e.what())); return false; } } // Cleanup void Shutdown() { if (versionThread.joinable()) { versionThread.join(); // Wait for version check to finish } // Modules auto-cleanup on DLL unload } }; // In DLL entry point REKenshiModLoader g_modLoader; BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { if (ul_reason_for_call == DLL_PROCESS_ATTACH) { if (!g_modLoader.PreInitialize()) { return FALSE; } // Hook into Kenshi's initialization... // Then call g_modLoader.Initialize() and g_modLoader.PostInitialize() } return TRUE; } ``` -------------------------------- ### void Preload() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/heightmap-hook.md Preloads heightmap data into memory before Kenshi's full initialization to prevent latency spikes. ```APIDOC ## void Preload() ### Description Reads heightmap files into memory and decompresses them if needed. Should be called very early during Kenshi's pre-initialization phase. ### Signature `void Preload();` ``` -------------------------------- ### Enable Sound Debug Logging Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/initialization-guide.md Activate verbose logging for sound bank loading to diagnose initialization failures. ```cpp Sound::SetAlwaysLog(true) ``` -------------------------------- ### Check current version status in C++ Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/version-module.md Verifies if the local version matches the server version. Requires SyncInit() to have completed for accurate results. ```cpp bool IsCurrentVersion(); ``` ```cpp // After SyncInit() has run if (!Version::IsCurrentVersion()) { std::cout << "Update available: " << Version::GetCurrentVersion() << std::endl; } else { std::cout << "RE_Kenshi is up-to-date" << std::endl; } ``` -------------------------------- ### Configure SoundBanks in mod-config.json Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/configuration.md Define the list of Wwise .bnk files to load. Paths are relative to the mod directory and order matters for dependencies. ```json { "SoundBanks": [ "mods/audio/Init.bnk", "mods/audio/Master.bnk", "mods/audio/Custom_Music.bnk", "mods/audio/Custom_SFX.bnk" ] } ``` ```json { "SoundBanks": [ "audio/Init.bnk", "audio/Master.bnk", "audio/SFX.bnk" ] } ``` -------------------------------- ### Initialize PreInit Exception Handler Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/bugs-module.md Hooks globally uncaught exceptions before Kenshi initializes. Must be called during the pre-initialization phase. ```cpp void PreInit(); ``` ```cpp Bugs::PreInit(); // Very first thing during mod init // ... then load Kenshi core ... Bugs::Init(); // After Kenshi core is ready ``` -------------------------------- ### Initialize Miscellaneous Hooks Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/miscellaneous-hooks.md Initializes all engine hooks. Call this after Escort initialization but before the game engine is fully running. ```cpp void Init(); ``` -------------------------------- ### Module Initialization Sequence Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-overview.md Modules must be initialized in this specific order to ensure all dependencies are satisfied. ```text 1. IO::Init() // Hardware detection (ASAP) 2. Escort::Init() // Code hooking infrastructure 3. Bugs::PreInit() // Exception handling (pre-Kenshi) 4. Version::Init() // Version information 5. [Load Kenshi core] 6. Bugs::Init() // Hook Kenshi's crash handler 7. Settings::Init() // Load configuration 8. Settings::LoadModOverrides() // Load mod-specific config 9. HeightmapHook::Preload() // Pre-load heightmaps 10. [Kenshi initialization continues] 11. HeightmapHook::Init() // Install heightmap hooks 12. MiscHooks::Init() // Install misc engine fixes 13. Sound::Init() // Initialize Wwise integration 14. Sound::TryLoadQueuedBanks() // Load sound banks 15. Bugs::InitMenu() // Setup crash reporting UI 16. Version::SyncInit() // Check for updates (async/thread) ``` -------------------------------- ### Enable Audio Logging Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/sound-module.md Demonstrates how to conditionally enable verbose logging based on application settings. ```cpp if (Settings::GetLogAudio()) { Sound::SetAlwaysLog(true); } // Enable logging when debugging audio issues Sound::SetAlwaysLog(true); std::cout << "Audio logging enabled - check debug log" << std::endl; ``` -------------------------------- ### Adapting Settings to Hardware Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/README.md Detect storage type to optimize heightmap loading modes. SSDs benefit from compression, while HDDs may prefer uncompressed modes. ```cpp IO::Init(); auto driveType = IO::GetDriveStorageType("."); if (driveType == IO::SSD) { Settings::SetHeightmapMode(HeightmapHook::COMPRESSED); Settings::SetPreloadHeightmap(true); } else if (driveType == IO::HDD) { Settings::SetHeightmapMode(HeightmapHook::FAST_UNCOMPRESSED); } ``` -------------------------------- ### Initialize HeightmapHook Integration Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/heightmap-hook.md Performs early and late initialization of the heightmap system and applies current settings. ```cpp #include "HeightmapHook.h" #include "Settings.h" #include "IO.h" void InitializeHeightmaps() { // Early initialization HeightmapHook::Preload(); // Determine best mode auto mode = HeightmapHook::GetRecommendedHeightmapMode(); Settings::SetHeightmapMode(mode); // Late initialization (after Kenshi core is ready) HeightmapHook::Init(); // Apply settings HeightmapHook::UpdateHeightmapSettings(); // Debug output std::cout << "Heightmap blocks: " << HeightmapHook::GetBlocksWidth() << "x" << HeightmapHook::GetBlocksHeight() << std::endl; } ``` -------------------------------- ### Programmatic Settings Management Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/configuration.md Initializes settings and modifies them at runtime; changes are persisted automatically on shutdown. ```cpp Settings::Init(); // Load saved settings // Modify at runtime Settings::SetHeightmapMode(HeightmapHook::COMPRESSED); Settings::SetMaxFactionSize(500); // Changes are saved automatically on shutdown ``` -------------------------------- ### Synchronous Version Initialization Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/version-module.md Performs a blocking HTTP request to check for updates. Must be executed on a non-UI thread to avoid blocking the main game loop. ```cpp void SyncInit(); ``` ```cpp // In a background thread void VersionCheckThread() { Version::SyncInit(); // May take several seconds // Version is now up-to-date } std::thread versionThread(VersionCheckThread); // ... continue main game initialization ... versionThread.join(); ``` -------------------------------- ### Conditional Module Initialization in C++ Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/initialization-guide.md Initializes core hooks and conditionally loads shaders and sound banks based on user settings. ```cpp bool PostInitialize() { // Always init these HeightmapHook::Init(); MiscHooks::Init(); // Conditional based on settings if (Settings::GetCacheShaders()) { ShaderCache::Init(); } // Always init codecs (lightweight) OgreSICCodec::startup(); OgreDDSCodec2::startup(); // Audio (requires Wwise) Sound::Init(); if (Settings::GetModSoundBanks() && !Settings::GetModSoundBanks()->empty()) { Sound::TryLoadQueuedBanks(); } // UI (needs game menu) Bugs::InitMenu(); return true; } ``` -------------------------------- ### Retrieve current version string in C++ Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/version-module.md Fetches the semantic version string in x.x.x format. ```cpp std::string GetCurrentVersion(); ``` ```cpp std::string version = Version::GetCurrentVersion(); std::cout << "RE_Kenshi version: " << version << std::endl; // Output: "1.2.3" ``` -------------------------------- ### void UndoPreInit() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/bugs-module.md Removes the PreInit exception handler if the Kenshi version is not supported. ```APIDOC ## void UndoPreInit() ### Description Uninstalls the VEH hook that was installed by PreInit(). Called if version validation fails and RE_Kenshi cannot safely continue. ### Signature void UndoPreInit(); ``` -------------------------------- ### Settings::GetCacheShaders / Settings::SetCacheShaders Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/settings.md Methods to manage shader binary caching. ```APIDOC ## bool GetCacheShaders() ## void SetCacheShaders(bool value) ### Description Enables or checks caching of compiled shader binaries to improve load times. ### Parameters - **value** (bool) - Required - The state to set for shader caching. ``` -------------------------------- ### Loading Custom Audio Banks Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/README.md Load sound banks defined in mod-config.json. Sound::Init must be called to process the queued banks. ```cpp // In mod-config.json: // "SoundBanks": ["audio/Custom.bnk"] Settings::LoadModOverrides(); auto banks = Settings::GetModSoundBanks(); Sound::Init(); // Loads queued banks ``` -------------------------------- ### Settings::GetSkipSplashScreens / Settings::SetSkipSplashScreens Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/settings.md Methods to manage splash screen display. ```APIDOC ## bool GetSkipSplashScreens() ## void SetSkipSplashScreens(bool value) ### Description Enables or checks the option to skip splash screens during startup. ### Parameters - **value** (bool) - Required - The state to set for skipping splash screens. ``` -------------------------------- ### Configure Heightmap Preloading Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/settings.md Enables or checks whether heightmaps are preloaded at startup. ```cpp void SetPreloadHeightmap(bool value); bool PreloadHeightmap(); ``` ```cpp Settings::SetPreloadHeightmap(true); if (Settings::PreloadHeightmap()) { // Heightmap preloading is enabled } ``` -------------------------------- ### Initialization Sequence Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/README.md Defines the required order of operations for initializing various game systems and hooks. ```text IO::Init() Escort::Init() Bugs::PreInit() Version::Init() [Load Kenshi] Bugs::Init() Settings::Init() Settings::LoadModOverrides() HeightmapHook::Preload() HeightmapHook::Init() MiscHooks::Init() Sound::Init() Bugs::InitMenu() Version::SyncInit() [async] ``` -------------------------------- ### void UpdateHeightmapSettings() Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/heightmap-hook.md Applies current heightmap mode settings to the running instance. ```APIDOC ## void UpdateHeightmapSettings() ### Description Reads the current mode from Settings::GetHeightmapMode() and applies runtime changes. Call this after modifying settings. ### Signature `void UpdateHeightmapSettings();` ``` -------------------------------- ### Access settings via C++ API Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/configuration.md Retrieve file overrides and resolve paths programmatically using the Settings API. ```cpp const auto* overrides = Settings::GetFileOverrides(); for (const auto& pair : *overrides) { std::string original = pair.first; std::string mapped = pair.second; } // Resolve a path std::string resolved = Settings::ResolvePath("data/heightmap.mesh"); ``` -------------------------------- ### Static Configuration Schema Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-overview.md Defines file rebinds and sound bank paths for mod overrides. Loaded via Settings::LoadModOverrides(). ```json { "FileRebinds": { "data/original.mesh": "mods/custom.mesh" }, "SoundBanks": [ "mods/audio/Custom.bnk" ] } ``` -------------------------------- ### Configure FileRebinds Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/configuration.md Use FileRebinds to map original file paths to custom modded assets. Paths are case-sensitive and use forward slashes. ```json { "FileRebinds": { "data/heightmap.mesh": "mods/my_heightmap.mesh", "data/textures/grass.dds": "mods/textures/grass_hd.dds", "data/sounds/ambient.bnk": "mods/audio/ambient.bnk" } } ``` ```json { "FileRebinds": { "data/terrain/heightmap": "mods/my_heightmap.mesh", "data/models/character.mesh": "mods/character_custom.mesh", "kenshi.cfg": "mods/kenshi_custom.cfg" } } ``` -------------------------------- ### Configure Heightmap Load Profiling Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/settings.md Enables profiling of load times for heightmaps and related resources. ```cpp void SetProfileLoads(bool value); bool GetProfileLoads(); ``` ```cpp Settings::SetProfileLoads(true); ``` -------------------------------- ### Manage Audio Logging Settings Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/settings.md Controls verbose logging for audio and sound operations. ```cpp bool GetLogAudio(); void SetLogAudio(bool value); ``` -------------------------------- ### Settings::GetLogFileIO / Settings::SetLogFileIO Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/settings.md Methods to manage file I/O logging. ```APIDOC ## bool GetLogFileIO() ## void SetLogFileIO(bool value) ### Description Enables or checks detailed logging of file I/O operations for debugging purposes. ### Parameters - **value** (bool) - Required - The state to set for file I/O logging. ``` -------------------------------- ### Access SoundBanks Programmatically Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/configuration.md Retrieve and iterate through the configured SoundBanks using the Settings module. ```cpp auto* banks = Settings::GetModSoundBanks(); if (banks) { for (const auto& bankPath : *banks) { std::cout << "Loading: " << bankPath << std::endl; } } ``` -------------------------------- ### Comprehensive Modding Configuration Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/configuration.md Combines multiple file rebinds and custom audio banks into a single configuration file. ```json { "FileRebinds": { "data/terrain/heightmap.mesh": "mods/terrain/heightmap_enhanced.mesh", "data/models/character.mesh": "mods/models/character_custom.mesh", "data/textures/grass.dds": "mods/textures/grass_ultra.dds", "data/textures/sand.dds": "mods/textures/sand_ultra.dds" }, "SoundBanks": [ "mods/audio/Init.bnk", "mods/audio/Master.bnk", "mods/music/Custom.bnk", "mods/sfx/Ambience.bnk" ] } ``` -------------------------------- ### WinHttpClient::SendHttpRequest Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/types.md Sends a synchronous HTTP request to the initialized URL. ```APIDOC ## WinHttpClient::SendHttpRequest ### Description Sends a synchronous HTTP request using the specified verb, headers, and body data. ### Parameters - **httpVerb** (wstring) - Optional - The HTTP method to use (default: L"GET"). - **httpRequestHeader** (wstring) - Optional - Custom HTTP headers to include in the request. - **httpRequestData** (string) - Optional - The body data to send with the request. ### Returns - **bool** - Returns true if the request was successful, false otherwise. ``` -------------------------------- ### Audio Settings Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/settings.md Methods to manage verbose logging for audio and sound operations. ```APIDOC ## bool GetLogAudio() ## void SetLogAudio(bool value) ### Description Enables or retrieves the status of verbose logging for audio/sound operations. ### Parameters - **value** (bool) - Required - The boolean state to set for audio logging. ``` -------------------------------- ### Compress image data with simple settings Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/sic-codec.md Uses default filtering and rearrangement. Returns the number of bytes written or 0 on error. ```cpp size_t Compress(void* outData, size_t outSize, const void* inData, size_t width, size_t height, EncodeType encodeType, int compressionLevel = 1); ``` ```cpp uint8_t pixels[512 * 512 * 3]; // RGB data uint8_t compressed[256 * 1024]; // Output buffer size_t compressedSize = SIC::Compress( compressed, sizeof(compressed), pixels, 512, 512, SIC::BGR, 6 // compression level ); ``` -------------------------------- ### Runtime Settings API Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/configuration.md The Settings module provides programmatic access to modify various game parameters at runtime. Each setting includes a getter and setter method. ```APIDOC ## Runtime Settings API ### Description Access and modify game settings programmatically using the Settings module. ### Methods - **Heightmap**: GetHeightmapMode(), SetHeightmapMode(), PreloadHeightmap(), SetPreloadHeightmap(), GetProfileLoads(), SetProfileLoads(), GetIgnoreHashCheck(), SetIgnoreHashCheck() - **Combat**: GetAttackSlots(), SetAttackSlots(), GetOverrideAttackSlots(), SetOverrideAttackSlots(), GetMaxFactionSize(), SetMaxFactionSize(), GetOverrideMaxFactionSize(), SetOverrideMaxFactionSize(), GetMaxSquadSize(), SetMaxSquadSize(), GetOverrideMaxSquadSize(), SetOverrideMaxSquadSize(), GetMaxSquads(), SetMaxSquads(), GetOverrideMaxSquads(), SetOverrideMaxSquads() - **Feature Toggles**: GetCacheShaders(), SetCacheShaders(), GetCachePhysXColliders(), SetCachePhysXColliders(), GetSkipUnusedMipmapReads(), SetSkipUnusedMipmapReads(), GetSkipSplashScreens(), SetSkipSplashScreens(), GetLogFileIO(), SetLogFileIO(), GetLogAudio(), SetLogAudio() - **Bugfixes**: GetFixRNG(), SetFixRNG(), GetFixModListScroll(), SetFixModListScroll() - **Crash/Update**: GetCheckUpdates(), SetCheckUpdates(), GetSkippedVersion(), SetSkippedVersion(), GetEnableEmergencySaves(), SetEnableEmergencySaves(), GetAlwaysReportCrashes(), SetAlwaysReportCrashes() - **UI**: GetOpenSettingsOnStart(), SetOpenSettingsOnStart(), GetIncreaseMaxCameraDistance(), SetIncreaseMaxCameraDistance() - **Game Speed**: GetUseCustomGameSpeeds(), SetUseCustomGameSpeeds(), GetGameSpeeds(), SetGameSpeeds() ``` -------------------------------- ### GetDisplayVersion Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/version-module.md Retrieves the version string formatted for display in the game's main menu. ```APIDOC ## std::string GetDisplayVersion() ### Description Retrieves a user-friendly version string intended for display in the main menu, mod list, or settings dialog. May include additional status information like "(Prerelease)" or "(Update Available)". ### Returns - **std::string**: The formatted display version string. ``` -------------------------------- ### Manage Splash Screen Skipping Source: https://github.com/bfrizzlefoshizzle/re_kenshi/blob/master/_autodocs/api-reference/settings.md Functions to enable or check the skipping of splash screens during startup. ```cpp void SetSkipSplashScreens(bool value); bool GetSkipSplashScreens(); ``` ```cpp Settings::SetSkipSplashScreens(true); ```