TextField
A TextField UI element allows users to input text into a text box.
To add a textField UI element to your mod, use the utils.addTextField function. This function takes the following parameters:
utils.addTextField(section, key, title, defaultValue, description, placeholder)The utils.addTextField function takes several parameters:
sectionis the UI section that the TextField should be added to.keyis a unique identifier for the TextField.title is the title that will be displayed for the TextField.
defaultValueThe default value of the TextField (optional).descriptioA description of the textField (optional).placeholderplace holder text of the textField.
utils.addTextField(section, "textValKey", "TextField", "", "This is a text field", "Enter some text here")You can access the current value of a TextField using the getValueForKey function:
local textFieldValue = getValueForKey("textValKey")This will return the current value of the TextField with the textValKey identifier.
Last updated