Expand description
Parser, resolver, and serializer for OpenMW configuration chains.
OpenMW loads one or more openmw.cfg files in a chain: the root config can reference
additional configs via config= entries, and each file can accumulate or override settings
from its parent. This crate walks that chain, resolves token substitutions
(?local?, ?global?, ?userdata?, ?userconfig?), normalises paths, and exposes the composed result as
OpenMWConfiguration.
§Quick start
use openmw_config::OpenMWConfiguration;
// Load from the platform-default location (or OPENMW_CONFIG / OPENMW_CONFIG_DIR env vars)
let config = OpenMWConfiguration::from_env()?;
// Iterate content files in load order
for plugin in config.content_files_iter() {
println!("{}", plugin.value());
}§Configuration sources
See the OpenMW path documentation
for platform-specific default locations. The environment variables OPENMW_CONFIG (path to
an openmw.cfg file) and OPENMW_CONFIG_DIR (directory containing openmw.cfg) override the
platform default.
Macros§
Structs§
- Config
Chain Entry - Directory
Setting - A directory path entry from an
openmw.cfgfile (data=,config=,user-data=, etc.). - Encoding
Setting - A parsed
encoding=entry from anopenmw.cfgfile. - File
Setting - A plain filename entry from an
openmw.cfgfile (content=,fallback-archive=,groundcover=). - Game
Setting Meta - Source-tracking metadata attached to every setting value.
- Generic
Setting - OpenMW
Configuration - A fully-resolved
OpenMWconfiguration chain.
Enums§
- Config
Chain Status - Config
Error - Errors that can arise while loading, mutating, or saving an
OpenMWconfiguration. - Encoding
Type - The text encoding used to interpret byte strings in plugin data.
- Game
Setting Type - A typed
fallback=Key,Valueentry from anopenmw.cfgfile.
Functions§
- default_
config_ path - Path to input bindings and core configuration These functions are not expected to fail and should they fail, indicate either: a severe issue with the system or that an unsupported system is being used.
- default_
data_ local_ path - Path to the
data-localdirectory as defined by the engine’s defaults. - default_
global_ path - Path that backs the
?global?token. - default_
local_ path - Path that backs the
?local?token. - default_
userdata_ path - Path to save storage, screenshots, navmeshdb, and data-local These functions are not expected to fail and should they fail, indicate either: a severe issue with the system or that an unsupported system is being used.
- try_
default_ config_ path - Fallible variant of
default_config_path. - try_
default_ global_ path - Fallible variant of
default_global_path. - try_
default_ local_ path - Fallible variant of
default_local_path. - try_
default_ userdata_ path - Fallible variant of
default_userdata_path.