control
This type represents an abstract GUI control.
id
FieldRead only
Type: int
Control ID.
id_string
FieldRead only
Type: string
String representation of control's ID. This may be empty for some controls.
is_visible
FieldRead only
Type: bool
Control's visibility state.
parent
FieldRead only
Type: control?
Parent control. Might be nil on some controls.
type
FieldRead only
Type: control_type
Control's type.
inactive
Field
Type: bool
If set to true, will mark this control to the inactive state.
inactive_text
Field
Type: string
Tooltip replacement to show when control is inactive.
inactive_color
Field
Type: color
Label color override for inactive controls.
tooltip
Field
Type: string
Tooltip text.
aliases
Field
Type: table[string]
Alias list for this control. Used in search box to support different naming (e.g. if a user searches for "Double tap", will find "Rapid fire" instead).
get_hotkey_state
Method
Returns true if any of the control's hotkeys are active.
Arguments
None.
Returns
Type
Description
bool
true if any hotkey is active.
Example
set_visible
Method
Changes visibility state for this control.
Calling this method on controls that are located in layouts with large amount of other controls will inevitably cause performance issues due to auto-stacking.
Arguments
Name
Type
Description
val
bool
Visibility state.
Returns
Nothing.
Example
add_callback
Method
Adds a callback to this control.
Arguments
Name
Type
Description
cbk
function
Callback.
Returns
Nothing.
Example
cast
Method
Attempts to downcast the control to the correct type.
Due to Lua engine's limitations, it is impossible to automatically downcast variables. Usually there is no need to call this method, unless you found some control that wasn't somehow already cast to the desired type. find() methods automatically perform the cast to the correct type.
Arguments
None.
Returns
Type
Description
<control>
New type, if any.
Example
reset
Method
Resets control's state. This action is usually required if you change control's value directly by interacting with value_param.
You also should call this method on layouts if you add multiple controls into them.
Arguments
None.
Returns
Nothing.
Example
Last updated