Configuration Architecture
The configuration system is built around several key components:Config Variables
Each feature exposes configuration variables that store settings. These variables support multiple data types:- Boolean - On/off toggles for features (
trueorfalse) - Unsigned integers - Numeric values for hue sliders, FOV settings, and color modes
- Enums - Predefined choices (e.g., “Enemies”, “All Players”, “Off”)
- Range-constrained values - Numeric values with minimum and maximum bounds
Automatic Saving
When you change a setting in the GUI, Osiris automatically:- Updates the configuration variable in memory
- Schedules an auto-save operation
- Serializes all settings to JSON format
- Writes the configuration file to disk
Configuration Schema
Settings are organized into a hierarchical JSON structure with four main sections:- Combat - Combat-related features like no-scope inaccuracy visualization
- Hud - HUD enhancements including bomb timers, killfeed preservation, and alerts
- Visuals - Visual features like model glow, outline glow, player info displays, and viewmodel modifications
- Sound - Sound visualizations for footsteps, bomb events, and weapon sounds
File Operations
The configuration system performs two types of file operations:Load Operation
- Opens the config file for reading
- Reads up to 4096 bytes into a buffer
- Parses the JSON structure
- Updates all configuration variables
- Refreshes the GUI to reflect loaded values
Save Operation
- Serializes all configuration variables to JSON
- Creates a temporary file (
default.cfg.new) - Writes the configuration data
- Atomically renames the temporary file to
default.cfg
Default Values
Each configuration variable has a default value defined in the source code. You can restore all settings to their defaults using the “Restore Defaults” button in the GUI.Platform Differences
The configuration system works identically on Windows and Linux, with platform-specific implementations for:- File path handling (backslashes on Windows, forward slashes on Linux)
- Directory creation
- File I/O operations