Component Configs¶
Overview¶
The types listed here represent optional configuration data available to components.
Types¶
ui.OpNameFilter¶
Helper type containing information used to filter what ops should be available on a component.
Methods¶
Constructor¶
function ui.OpNameFilter.new() -> ui.OpNameFilter
function ui.OpNameFilter.new(filterString : String, exactMatch : Bool, invertFilter : Bool) -> ui.OpNameFilter
Creates a new op name filter object.
| Parameter | Type | Description |
|---|---|---|
| filterString | String | Filtering string to compare against op names. |
| exactMatch | Bool | Whether the filter string must be an exact match to the op name, otherwise the filter string is a substring. |
| invertFilter | Bool | Inverts the filter results, ie. op names that don't match the filter string return true. |
| Returns | Description |
|---|---|
| ui.OpNameFilter | The newly created filter, default initialized, or setup with the provided filter string and options. |
Test¶
Checks if the provided string passes this filter.
| Parameter | Type | Description |
|---|---|---|
| testString | String | String to test this filter against. |
| Returns | Description |
|---|---|
| Bool | True if the provided string would pass this filter, false otherwise. |
Properties¶
| Name | Type | Description |
|---|---|---|
| filterString | String | Filtering string to compare against op names. |
| exactMatch | Bool | Whether the filter string must be an exact match to the op name, otherwise the filter string is a substring. |
| invertFilter | Bool | Inverts the filter results, ie. op names that don't match the filter string return true. |
ui.ComponentOpConfig¶
Config type containing the ingame actions available for the player to perform when interacting with this config's UI component.
Supports filtering ops based on their ID and/or name, as well as marking visible ops as high priority based on their ID and/or name.
Methods¶
GetOpName¶
Retrieves the name of the op at the specified index.
| Parameter | Type | Description |
|---|---|---|
| opIndex | Int | Index of the op that will be accessed. |
| Returns | Description |
|---|---|
| String | The name of the specified op, or an empty string if missing. |
ClearOpNames¶
Resets the names of all previously defined ops.
Warning
This doesn't affect cursors for the ops, those must be cleared using ClearOpCursors.
GetOpCursor¶
Retrieves the cursor ID of the op at the specified index.
| Parameter | Type | Description |
|---|---|---|
| opIndex | Int | Index of the op that will be accessed. |
| Returns | Description |
|---|---|
| Int | The cursor ID of the specified op, or -1 if missing. |
SetOpCursor¶
Sets the cursor ID of the op at the specified index.
| Parameter | Type | Description |
|---|---|---|
| opIndex | Int | Index of the op that will be accessed. |
| cursorID | Int | ID of the cursor to use for this op. |
ClearOpCursors¶
Resets the cursors of all previously defined ops.
Warning
This doesn't affect names for the ops, those must be cleared using ClearOpNames.
HasHiddenTests¶
Checks whether or not SetOpIDHidden or SetOpNameHidden have been called previously, resulting in active filters for visible ops.
| Returns | Description |
|---|---|
| Bool | True if there are any active visible op filters, false otherwise. |
TestOpIsHidden¶
Tests whether the op at the specified index is hidden or not.
| Parameter | Type | Description |
|---|---|---|
| opIndex | Int | Index of the op that will be accessed. |
| Returns | Description |
|---|---|
| Bool | True if this op exists and is hidden, false otherwise. |
ClearHiddenOps¶
Resets both the op name hidden filters and op ID hidden by default settings.
SetOpIDHidden¶
Controls whether the op at the specified index is hidden or not by default.
| Parameter | Type | Description |
|---|---|---|
| opIndex | Int | Index of the op that will be accessed. |
| hidden | Bool | Whether this op should be hidden by default or not. |
GetOpIDHidden¶
Retrieves whether the op at the specified index is hidden or not by default.
| Parameter | Type | Description |
|---|---|---|
| opIndex | Int | Index of the op that will be accessed. |
| Returns | Description |
|---|---|
| Bool | True if this op exists and is hidden by default, false otherwise. |
SetOpNameHidden¶
Sets the filter used to determine if an op is hidden or not based on its name.
| Parameter | Type | Description |
|---|---|---|
| filter | ui.OpNameFilter | Filter used to determine whether an op should be hidden or not based on its name. |
GetOpNameHidden¶
Gets the filter used to determine if an op is hidden or not based on its name.
| Returns | Description |
|---|---|
| ui.OpNameFilter | Currently active filter used to determine whether an op should be hidden or not based on its name. If not set previously, this will represent an always-pass filter. |
HasHighPriorityTests¶
Checks whether or not SetOpIDHighPriority or SetOpNameHighPriority have been called previously, resulting in active filters for high priority ops.
| Returns | Description |
|---|---|
| Bool | True if there are any active high priority op filters, false otherwise. |
TestOpIsHighPriority¶
Tests whether the op at the specified index is shown higher on the op list or not.
| Parameter | Type | Description |
|---|---|---|
| opIndex | Int | Index of the op that will be accessed. |
| Returns | Description |
|---|---|
| Bool | True if this op exists and is shown higher on the op list, false otherwise. |
ClearHighPriorityOps¶
Resets both the op name high priority filters and op ID high priority by default settings.
SetOpIDHighPriority¶
Controls whether the op at the specified index is shown higher on the op list or not by default.
| Parameter | Type | Description |
|---|---|---|
| opIndex | Int | Index of the op that will be accessed. |
| highPriority | Bool | Whether this op should be shown higher on the op list by default or not. |
GetOpIDHighPriority¶
Retrieves whether the op at the specified index is shown higher on the op list or not by default.
| Parameter | Type | Description |
|---|---|---|
| opIndex | Int | Index of the op that will be accessed. |
| Returns | Description |
|---|---|
| Bool | True if this op exists and is shown higher on the op list by default, false otherwise. |
SetOpNameHighPriority¶
Sets the filter used to determine if an op should be shown higher on the op list or not based on its name.
| Parameter | Type | Description |
|---|---|---|
| filter | ui.OpNameFilter | Filter used to determine whether an op should be shown higher on the op list or not based on its name. |
GetOpNameHighPriority¶
Gets the filter used to determine if an op should be shown higher on the op list or not based on its name.
| Returns | Description |
|---|---|
| ui.OpNameFilter | Currently active filter used to determine whether an op should be shown higher on the op list or not based on its name. If not set previously, this will represent an always-fail filter. |
Properties¶
| Property | Type | Description |
|---|---|---|
| pauseText | String | Text to display for this component when an interface pause is triggered by the server. Only affects text and button components. |
| opWikiText | String | Text to display for this component's Wiki op entry in the right-click menu. |
| numOpNames | Uint | (Read-only) Number of ops defined for this component. |
| numOpCursors | Uint | (Read-only) Number of cursors defined for this component's ops. |
| opNames | [String] |
(Read-only) Names for the ops available for this component. |
| opBaseName | String | (Read-only) Suffix used for ops for this component. Commonly used to identify the target of an op. |
| opCursors | [Int] |
(Read-only) IDs for the cursors available for this component's ops. |
| targetOpVerb | String | (Read-only) Prefix used for ops for this component when in target mode. Commonly used to identify the action to perform with something. |
| targetOpCursor | Int | ID for the cursor to use when in target mode for this component. |
ui.ComponentSwipeConfig¶
Configuration paremeters used for swipe gesture handling on components.
Methods¶
SetDeadZone¶
Sets the minimum travel distance for horizontal and vertical inputs before being treated as a swipe gesture.
Properties¶
| Name | Type | Description |
|---|---|---|
| directionMask | Uint8 | Combination of ui.SwipeDirectionBit, determines the direction used to detect swipe gestures. |
| deadZoneHorizontal | Uint8 | Minimum horizontal travel distance before an input is treated as a swipe gesture. |
| deadZoneVertical | Uint8 | Minimum vertical travel distance before an input is treated as a swipe gesture. |
| deceleration | Uint8 | Determines how far a swipe gesture drifts based on previous motion. Ranges from 1 to 100, representing 1%-100% deceleration.A value of 100 results in no swipe drift being applied. |
| stopExponent | Uint8 | Exponent applied to the threshold value at which we stop drifting. A value of 1 indicates drifting stops at drift speeds below 0.1, while 2 results in stopping below 0.01.Should generally be left at the default value of 8 for consistency. |
ui.ComponentDragConfig¶
Configuration parameters used for drag gestures handling on components.
| Property | Type | Description |
|---|---|---|
| draggedComponent | Component |
The component that's being actively dragged. |
| renderBehaviour | DragRenderBehaviour | Indicates how the component should be rendered while it's being dragged. |
| dragDelayTicks | Uint8 | How long the user must be attempting a drag action for on a component in logic ticks, before the action actually starts. |
| deadZone | Uint8 | Minimum distance in interface units before a drag gesture is triggered, assuming dragDelayTicks has been exceeded. |
ui.ComponentPinchConfig¶
Configuration parameters used for pinch gestures handling on components.
| Property | Type | Description |
|---|---|---|
| directionMask | Uint8 | Combination of ui.SwipeDirectionBit, determines the direction used to detect pinch gestures. |
| threshold | Uint8 | Minimum distance in interface units before a pinch gesture is triggered. |
ui.ComponentCursorConfig¶
Configuration parameters used for cursors associated with this component.
| Name | Type | Description |
|---|---|---|
| mouseOverCursor | Int | The ID of the cursor to display when the mouse is over this component. A value of -1 indicates no cursor is set. |
| targetValidCursor | Int | The ID of the cursor to display when in target mode for this component and the cursor is over a valid target. A value of -1 indicates no cursor is |
| targetInvalidCursor | Int | The ID of the cursor to display when in target mode for this component and the cursor is over an invalid target. A value of -1 indicates no cursor is |
ui.ComponentParamsConfig¶
Contains arbitrary parameter data associated with the component.
Warning
This config type is meant for interop with the game's legacy scripting system and should generally be avoided as it may be removed in the future.
Methods¶
Get¶
Retrieves the value for the parameter associated with the provided ID.
| Name | Type | Description |
|---|---|---|
| paramID | Int | Numeric ID associated with the parameter to retrieve. |
| Returns | Description |
|---|---|
| Int? | String? |
CheckExists¶
Checks if there's a parameter associated with the provided ID.
| Name | Type | Description |
|---|---|---|
| paramID | Int | Numeric ID associated with the parameter to check. |
| Returns | Description |
|---|---|
| Bool | True if a parameter with the specified ID exists, false otherwise. |
Properties¶
| Name | Type | Description |
|---|---|---|
| valid | Bool | (Read-only) True if there are any parameters set on this component. |
Enumerations¶
ui.DragRenderBehaviour¶
Enumeration identifying how a component that is actively being dragged by the user should be rendered.
| Value | Description |
|---|---|
| TRANSPARENT_OVERLAY | The dragged component will be rendered as semi-translucent and over other components. |
| OPAQUE | The dragged component will be drawn as normal. |
| OPAQUE_OVERLAY | The dragged component will be drawn as normal and over other components. |
| INVISIBLE | The dragged component won't be drawn. |
ui.PlayerOpType¶
Identifies the type of player that's been associated with a component.
| Value | Description |
|---|---|
| NONE | No player is currently associated with this component. |
| FRIEND | A player in the local player's friend list is currently associated with this component. |
| GROUP_MEMBER | A player in the local player's group list is currently associated with this component. |
| GROUP_BANNED | A player in the local player's group ban list is currently associated with this component. |
| CLAN_MEMBER | A player in the local player's clan is currently associated with this component. |
| CLAN_GUEST | A guest player in the local player's clan is currently associated with this component. |
| FRIEND_CHAT | A player in the local player's friend chat is currently associated with this component. |
ui.PinchAxisBit¶
Bitmasks for the available pinch axii, can be added together to combine them.
| Value | Description |
|---|---|
| HORIZONTAL | Allows horizontal pinch gestures. |
| VERTICAL | Allows vertical pinch gestures. |
ui.SwipeDirectionBit¶
Bitmasks for the available swipe directions, can be added together to combine them.
| Value | Description |
|---|---|
| LEFT | Allows swipe left gestures. |
| RIGHT | Allows swipe right gestures. |
| UP | Allows swipe up gestures. |
| DOWN | Allows swipe down gestures. |