Skip to content

ConfigAgent

Provides access to config values.

Description

The ConfigAgents main purpose is to provide access to config values. It mirrors the exact layout of the actual config. For example, if a config looks like:

{
    "key1" : "value1"
    "sub_category": {
        "key2" : 123,
        "key3" : true
    }
}
Then the values may be accessed and set as follows:
config.key1 = "new_value"
config.sub_category.key2 = 101
config.sub_category.key3 = false
The values are directly retrieved from and stored to the config nodes that make up the config screen.

Methods

void load_cfg ( )
void mark_dirty ( )
void save_cfg ( bool force = false )

Method Descriptions

void save_cfg ( bool force = false ):
Saves the config to its config file. Set force to true to force saving even if the config is unchanged.

void load_cfg ( ):
Loads the config from its config file.

void mark_dirty ( ):
Marks the config as dirty so it will be saved on the next save_cfg call.