Changes between Version 1 and Version 2 of Exposed_ConfigDB_Functions
- Timestamp:
- Sep 29, 2013, 7:48:37 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Exposed_ConfigDB_Functions
v1 v2 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. 1 The Javascript API is accessible via global functions. 2 You call them like Engine.ConfigDB_FunctionName(). 2 3 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 4 For example 5 {{{ 6 Engine.ConfigDB_CreateValue("user", "sound.mastergain", 0.8); 7 }}} 8 9 == !CreateValue == 10 * configNamespace: One of "default", "system", "user" or "mod" 11 * valueName: The name of the value to create or change 12 * value: The value to set 13 * Returns true if successful 14 15 Create or change a value in the given configuration context. 16 17 == !GetValue == 18 * configNamespace: One of "default", "system", "user" or "mod" 19 * valueName: The name of the value to get 20 * Returns the value 21 22 Gets a value from the given configuration context. 23 24 == !SetFile == 25 * configNamespace: One of "default", "system", "user" or "mod" 26 * path: the VFS path to the file 27 * Returns true if successful 7 28 8 29 Set the file name to be used by the configuration namespace. Note that this doesn't automatically reload configuration values. 9 30 10 == reload ==11 * No arguments31 == Reload == 32 * configNamespace: One of "default", "system", "user" or "mod" 12 33 * Returns true if successful 13 34 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 unchanged35 Reload configuration from the file last set by setFile for the given configuration namespace. Deletes all config values previously set, when successful. If an error occurs, the configuration is unchanged 15 36 16 == writeFile ==17 * useVFS: true if the path is to be interpreted as a VFS path, false if it's a real FS path18 * path: the path37 == !WriteFile == 38 * configNamespace: One of "default", "system", "user" or "mod" 39 * path: the VFS path to the file 19 40 * Returns true if successful 20 41