Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 1 and Version 2 of code/doc/ConfigValueIncludes


Ignore:
Timestamp:
Oct 8, 2008, 12:59:24 AM (16 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/ConfigValueIncludes

    v1 v2  
    1313=== SetConfigValue ===
    1414
    15 '''SetConfigValue('''''varname''''', '''''defvalue''''')''' defines a new config-value with a default value. ''varname'' must be a member-variable of a class. ''defvalue'' is the default value that will be initially used until the user configuers another value.
     15'''SetConfigValue('''''varname, defvalue''''')''' defines a new config-value with a default value. ''varname'' must be a member-variable of a class. ''defvalue'' is the default value that will be initially used until the user configures another value. The type of the value can be everything supportet by [wiki:MultiType].
    1616
    1717'''Important''': SetConfigValue '''must''' be used within setConfigValues(). This is a function that gets called to assign the configured values to an object. Additionally setConfigValues() '''must''' be called within the constructor of the class.
     
    2222
    2323You can set a callback function that gets called as soon as the config-value changes by adding '''.callback('''''this, &classname::functionname''''')''' at the end of the macro.
     24
     25
     26=== SetConfigValueVector ===
     27'''SetConfigValueVector('''''varname, defvalue''''')''' defines a new configurable vector with a default value. Value and default value must be a std::vector<type> where type can be everything supportet by [wiki:MultiType].
     28
     29Otherwise SetConfigValueVector is just like SetConfigValue; the same features, the same restrictions.
     30
     31In the config-file a vector is slightly different to a simple config-value. The vector entries are named "varname[index]" where ''index'' goes from zero until the vectors size. If the user adds a new entry with ''index > vector.size()'' the numbers between are added too but without a value.
    2432
    2533=== ResetConfigValue ===
     
    3745  * '''set''', ''index'', ''value'': Does the same like '''set''' for simple config-values but only for a given element of the vector
    3846  * '''tset''', ''index'', ''value'': Does the same like '''tset''' for simple config-values but only for a given element of the vector
    39   * '''add''', ''value'': Adds a new element with a given value to the vector
     47  * '''add''', ''value'': Adds a new element with a given value to the end of the vector
    4048  * '''remove''', ''index'': Removes a given element from the vector
    4149