Version 1 (modified by 16 years ago) ( diff ) | ,
---|
The Javascript API is accessible via the g_ConfigDB global JS object. The three namespaces system, mod and user exist as properties of the g_ConfigDB global object. Config variables can therefore be modified/accessed using eg g_ConfigDB.system["sound.mastergain"]. Each namespace exports a couple of functions.
setFile
- useVFS: true if the path is to be interpreted as a VFS path, false if it's a real FS path
- path: the path
- Returns nothing
Set the file name to be used by the configuration namespace. Note that this doesn't automatically reload configuration values.
reload
- No arguments
- Returns true if successful
Reload configuration from the file last set by setFile. Deletes all config values previously set, when successful. If an error occurs, the configuration is unchanged
writeFile
- useVFS: true if the path is to be interpreted as a VFS path, false if it's a real FS path
- path: the path
- Returns true if successful
Write all configuration values in the config namespace to a file on the disk.