Expand description
Persistent settings store and config-path helpers.
Settings are kept in a single JSON file under the OS-specific config
directory (resolved through [directories::ProjectDirs]) and exposed as a
per-type Settings map: bool, i32, f32, String, raw bytes,
and Vec<String>. Both the UI and the server side use the same
rpfm_ipc::settings_keys constants when reading and writing, so a typo
becomes a compile error rather than a silently-missed setting.
StructsΒ§
- Settings
- Snapshot of every persisted setting.
ConstantsΒ§
- CONFIG_
REDIRECT_ πFILE_ NAME - File for storing the path to the user-chosen custom config folder.
- DEPENDENCIES_
FOLDER π - SCRIPTS_
FOLDER π - Folder under
config_pathwhere the user drops plugin scripts (.py/.lua). - SETTINGS_
FILE_ πNAME - TABLE_
PATCHES_ πFOLDER - TABLE_
PROFILES_ πFOLDER - TRANSLATIONS_
LOCAL_ πFOLDER - TRANSLATIONS_
REMOTE_ πFOLDER
FunctionsΒ§
- backup_
autosave_ path - This function returns the autosave path.
- clear_
config_ path - Recursively deletes the config folder, then re-runs
init_config_pathto recreate the standard sub-folders. Refuses to delete anything outsideconfig_path. - config_
path - This function returns the active config path: the userβs custom folder if one is set, or the default otherwise.
- custom_
config_ path - This function returns the user-configured custom config folder, or
Noneif RPFM uses the default one. - default_
config_ path - This function returns RPFMβs default config path, ignoring any custom-folder redirect.
- dependencies_
cache_ path - This function returns the dependencies path.
- error_
path - This function returns the path where crash logs are stored.
- init_
config_ path - Function to initialize the config folder, so RPFM can use it to store his stuff.
- lua_
autogen_ base_ path - This function returns the lua autogen path.
- lua_
autogen_ game_ path - This function returns the lua autogen path for a specific game.
- old_
ak_ files_ path - Folder under
config_pathholding archived Empire/Napoleon Assembly Kit definitions (no AK was ever shipped for these games, so RPFM bundles a frozen copy via theold_ak_filessubmodule). - schemas_
path - This function returns the schema path.
- scripts_
path - Folder under
config_pathwhere the user drops plugin scripts shown in the PackFile contents context menu. - set_
custom_ config_ path - This function sets (or clears, when passed
None) the custom config folder and initializes it. - table_
patches_ path - Folder under
config_pathwhere user-side schema patches live. - table_
profiles_ path - Folder under
config_pathwhere saved table view profiles (column orders, filters, hidden columns) are persisted. - translations_
local_ path - Folder under
config_pathwhere the userβs local mod translations are stored (one JSON per pack/language). - translations_
remote_ path - Folder under
config_pathwhere the local clone of the Translation Hub repository is mirrored.