The goal of this is to automatically generate the Client_PresentConfigureUI, Client_SaveConfigureUI and Client_PresentSettingsUI lua files. All files other than __settings.lua are not meant to be edited. __settings.lua is where to define settings.

__settings.lua

The file must have a getSettings function. returns array of setting

setting is a table which is generated from the addSetting and addSettingTemplate functions

addSetting

Arguments:

inputType

Depending on the inputType certain keys on otherProps are forced and some become optional

int

Forced keys: Optional keys:

float

Forced keys: Optional keys:

bool

Optional keys:

text

Optional keys:

addSettingTemplate

In the event of wanting to have infinite groups of settings, setting templates can be used.

Arguments:

Accessing setting values

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:

Examples

Screenshots

Client_PresentConfigureUI.lua

Client_PresentSettingsUI.lua

Other implementations

The following mods implement an old version of this: