Changes between Version 1 and Version 2 of Exposed_ConfigDB_Functions


Ignore:
Timestamp:
Sep 29, 2013, 7:48:37 PM (11 years ago)
Author:
Yves
Comment:

Changes according to #2172

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.
     1The Javascript API is accessible via global functions.
     2You call them like Engine.ConfigDB_FunctionName().
    23
    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
     4For example
     5{{{
     6Engine.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
     15Create 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
     22Gets 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
    728
    829Set the file name to be used by the configuration namespace. Note that this doesn't automatically reload configuration values.
    930
    10 == reload ==
    11  * No arguments
     31== Reload ==
     32 * configNamespace: One of "default", "system", "user" or "mod"
    1233 * Returns true if successful
    1334
    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
     35Reload 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
    1536
    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
     37== !WriteFile ==
     38 * configNamespace: One of "default", "system", "user" or "mod"
     39 * path: the VFS path to the file
    1940 * Returns true if successful
    2041