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:

  • section is the UI section that the TextField should be added to.

  • key is a unique identifier for the TextField.

  • title is the title that will be displayed for the TextField.

  • defaultValue The default value of the TextField (optional).

  • descriptio A description of the textField (optional).

  • placeholder place 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