| 1 | 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. |
| 2 | |
| 3 | == setFile == |
| 4 | * useVFS: true if the path is to be interpreted as a VFS path, false if it's a real FS path |
| 5 | * path: the path |
| 6 | * Returns nothing |
| 7 | |
| 8 | Set the file name to be used by the configuration namespace. Note that this doesn't automatically reload configuration values. |
| 9 | |
| 10 | == reload == |
| 11 | * No arguments |
| 12 | * Returns true if successful |
| 13 | |
| 14 | 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 |
| 15 | |
| 16 | == writeFile == |
| 17 | * useVFS: true if the path is to be interpreted as a VFS path, false if it's a real FS path |
| 18 | * path: the path |
| 19 | * Returns true if successful |
| 20 | |
| 21 | Write all configuration values in the config namespace to a file on the disk. |