The file must have a getSettings
function. returns array of setting
setting
is a table which is generated from the addSetting
and addSettingTemplate
functions
name
- string - name of the setting. all names must be unique to function correctlylabel
- string - summery of what the setting doesinputType
- one of 'int'
, 'float'
, 'bool'
or 'text'
defaultValue
- same type as inputType
- the default value for the setting's value in Client_PresentConfigureUI
otherProps
- table or nil - if table then these keys are optional:
help
- function(parent)
- gives a more detailed explanation of what the setting does when a help button (?) is clicked
labelColor
- string - color of the setting's label textinputType
certain keys on otherProps
are forced and some become optional
minValue
- number - the lowest the setting's value can bemaxValue
- number - the highest the setting's value can be while using the setting sliderabsoluteMax
- number - allows user to enter a higher number than maxValue
dp
- number - the number of decimal places to round the setting's value when saving the settingsminValue
- number - the lowest the setting's value can bemaxValue
- number - the highest the setting's value can be while using the setting sliderabsoluteMax
- number - allows user to enter a higher number than maxValue
subsettings
- table or nil. if table then is an array of setting
placeholder
- string - the placeholder textcharLimit
- number - the maximum number of characters that can be enteredIn the event of wanting to have infinite groups of settings, setting templates can be used.
Arguments:name
- string - name of the setting. all names must be unique to function correctlybtnText
- string - text that goes on a button that user presses to add a new group of settingsoptions
- nil or table with keys:
btnColor
- nil or string - color of the button; nil = #00FF05btnTextColor
- nil or string - color of btnText
; nil = wz defaultbkwrds
- nil or int - for if the mod is public and goes from limited to unlimited amounts of setting groups. bkwrds
number of setting groups will be generated. to avoid nil in Client_PresentSettingsUIget(n)
- function - n
starts at 1. get
must return table with keys:
label
- string - description of the setting grouplabelColor
- nil or string - color of the label; nil = wz defaultsettings
- array of setting
Each setting is written to Mod.Settings[name
]. name
in addSettingTemplate
is altered to only apply to the correct setting group. Use the getSetting(name, template)
function defined in _settings.lua
. Returns the value stored in Mod.Settings
name
string - name of the setting, same as what was used in addSetting
or addSettingTemplate
template
- nil or table - containing the following keys:
n
- number - setting group numbername
- string - the name of the setting template