Class mct_text_input

MCT Text-Input type

Functions

wrapped_type:new (option_obj) Create a new wrapped type within an mct_option.
wrapped_type:check_validity (value) Checks the validity of the value passed.
wrapped_type:set_default () Set a default value for this type, if none is set by the modder.
wrapped_type:ui_select_value (val) Selects a passed value in UI.
wrapped_type:ui_change_state () Changes the state of the option in UI.
wrapped_type:ui_create_option (dummy_parent) Creates the option in UI.
wrapped_type:add_validity_test (callback) add a test for validity with several returns.
wrapped_type:test_text (text) this is the tester function for supplied text into the string.
wrapped_type:ui_create_popup () Create the popup in UI to edit the text.


Functions

Methods
wrapped_type:new (option_obj)
Create a new wrapped type within an mct_option.

Parameters:

  • option_obj mct_option The mctoption this wrappedtype is being passed.
wrapped_type:check_validity (value)
Checks the validity of the value passed.

Parameters:

  • value
wrapped_type:set_default ()
Set a default value for this type, if none is set by the modder. Defaults to ""
wrapped_type:ui_select_value (val)
Selects a passed value in UI.

Parameters:

  • val
wrapped_type:ui_change_state ()
Changes the state of the option in UI. Locks the edit button, changes the tooltip, etc.
wrapped_type:ui_create_option (dummy_parent)
Creates the option in UI.

Parameters:

  • dummy_parent
wrapped_type:add_validity_test (callback)
add a test for validity with several returns.

Parameters:

  • callback function The function to pass. Takes the text as a parameter. Return "true" for valid tests, and return a string for invalid. The text will be displayed in the popup to explain to the user why that text is unallowed.

Usage:

    wrapped_type:add_validity_test(
               function(text)
                     if text == "bloop" then
                         return "Bloop is unallowed."
                     else
                         return true
                     end
                end
            )
wrapped_type:test_text (text)
this is the tester function for supplied text into the string. loops through every validity

Parameters:

  • text
wrapped_type:ui_create_popup ()
Create the popup in UI to edit the text.
generated by LDoc 1.4.6 Last updated 2021-01-03 11:23:43