Don't Starve Together

Don't Starve Together

Configs Extended
 Este tema se ha marcado como fijo, por lo que probablemente sea importante
Remi  [desarrollador] 22 MAR a las 1:02 a. m.
Color config example
Since the version 0.4 the mod now supports color config options.
Here's a quick example:

In modinfo.lua:
configuration_options = { -- some other options... { name = "internal_name_here", -- this is passed to GetModConfigData label = "Display Name", -- this is shown to the player options = { {description = "Enable the mod!", data = {0.1,0.2,0.3,1}}, -- make sure... }, default = {0.1,0.2,0.3,1}, -- ...that the 2 color tables are the same is_rgb_config = true, -- or "is_rgba_config = true" if you want opacity to be changeable hover = "Shown when the player hovers their cursor over the option, optional.", }, -- some other options... }

Without comments or any extra fluff:
{ name = "name", label = "label", options = { {description = "desc", data = {0.1,0.2,0.3,1}}, }, default = {0.1,0.2,0.3,1}, is_rgb_config = true, hover = "hover", },

To obtain the value, call GetModConfigData in modmain.lua (or any modimport-ed script) and pass the internal config name as a parameter. The value will always be a table consisting of 4 numbers ranging from 0 to 1, each one representing a color component: red, green, blue, alpha (opacity).