For working with mod configurations.
require('stdlib/config/config')
delete (path) | Delete a stored config value. |
get (path[, default]) | Get a stored config value. |
is_set (path) | Test the existence of a stored config value. |
new (config_table) | Creates a new Config object to ease the management of a config table. |
set (path, data) | Set a stored config value. |
Config |
Delete a stored config value.
Parameters:
Get a stored config value.
Parameters:
Test the existence of a stored config value.
Parameters:
Creates a new Config object to ease the management of a config table.
Parameters:
--[Use a global table for config that persists across game save/loads]
CONFIG = Config.new(global.testtable)
--[You can also create a temporary scratch pad config]
CONFIG = Config.new({}) -- Temporary scratch pad
--[Setting data in Config]
CONFIG = Config.new(global.testtable)
CONFIG.set("your.path.here", "myvalue")
--[Getting data out of Config]
CONFIG = Config.new(global.testtable)
my_data = CONFIG.get("your.path.here")
--[Getting data out of Config with a default to use if path is not found in Config]
CONFIG = Config.new(global.testtable)
my_data = CONFIG.get("your.path.here", "Your Default here")
--[Deleting a path from Config]
CONFIG = Config.new(global.testtable)
CONFIG.delete("your.path.here")
--[Checking if a path exists in Config]
CONFIG = Config.new(global.testtable)
CONFIG.is_set("your.path.here")