ix.config
Helper library for creating/setting config options.
Functions
ix.config.Add(key, value, description, callback, data, bNoNetworking, bSchemaOnly)
View source »Creates a config option with the given information.
Parameters
-
key
string
Unique ID of the config
-
value
Default value that this config will have
-
description
string
Description of the config
-
callback
function
default: nil
Function to call when config is changed
-
data
table
default: nil
Additional settings for this config option
-
bNoNetworking
boolean
default: false
Whether or not to prevent networking the config
-
bSchemaOnly
boolean
default: false
Whether or not the config is for the schema only
ix.config.Get(key, default)
View source »Retrieves a value of a config option. If it is not set, it'll return the default that you've specified.
Parameters
-
key
string
Unique ID of the config
-
default
Default value to return if the config is not set
Returns
-
any
Value associated with the key, or the default that was given if it doesn't exist
ix.config.Load()
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Loads all saved config options from disk.
ix.config.Save()
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Saves all config options to disk.
ix.config.Set(key, value)
View source »Sets the value of a config option.
Parameters
-
key
string
Unique ID of the config
-
value
New value to assign to the config
ix.config.SetDefault(key, value)
View source »Sets the default value for a config option.
Parameters
-
key
string
Unique ID of the config
-
value
Default value for the config option