collapsible_checkbox_list¶
Source: base/tealdef/gui/main/collapsible_checkbox_list.d.tl
Notes
Lists of checkbox entries under a header button: either collapsible in place
(CollapsibleCheckboxList) or opened as a callout (CheckboxListCallout). Both support
mouse and gamepad.
CheckboxList¶
record global base/tealdef/gui/main/collapsible_checkbox_list.d.tl:3
global record CheckboxList
Load: local checkboxList = ug_require "/gui/main/collapsible_checkbox_list.tl"
Notes
Recipes for checkbox lists with a header.
Fields
| Name | Type | Description |
|---|---|---|
CollapsibleCheckboxList |
Recipe<CollapsibleCheckboxListParam> |
Header button with a checkbox list below it that expands and collapses in place. used 1× in the base game |
CheckboxListCallout |
Recipe<CheckboxListCalloutParam> |
Button that opens a checkbox list in a callout (via CalloutReactUtil.ToggleCalloutButton); supports indeterminate (tri-state) entries. used 1× in the base game |
CheckboxList.CollapsibleCheckboxListParam¶
record base/tealdef/gui/main/collapsible_checkbox_list.d.tl:4
record CollapsibleCheckboxListParam
Notes
Parameters of CollapsibleCheckboxList.
Used in the base game: 1 time in 1 file
base/content/gui/gui/main/collapsible_checkbox_list.tl:134
Fields
| Name | Type | Description |
|---|---|---|
header |
string |
Text of the header button that expands and collapses the list. |
hasArrow |
boolean |
defaults to false if nil |
verticalScrollPolicy |
Builtin.Type.ScrollBarPolicy |
defaults to AlwaysOff if nil |
Functions
onToggle(index : integer) base/tealdef/gui/main/collapsible_checkbox_list.d.tl:5
Notes
Called with the 1-based index of the entry the user toggled.
isToggled(index : integer) : boolean base/tealdef/gui/main/collapsible_checkbox_list.d.tl:6
Notes
Returns whether the entry with the given 1-based index is checked.
Returns boolean
makeEntries() : {{TreeNodeId, integer}} base/tealdef/gui/main/collapsible_checkbox_list.d.tl:9
second param is for level (defaults to 1 if nil)
Returns {{TreeNodeId, integer}}
CheckboxList.CheckboxListCalloutParam¶
record base/tealdef/gui/main/collapsible_checkbox_list.d.tl:15
record CheckboxListCalloutParam
Notes
Parameters of CheckboxListCallout.
Used in the base game: 1 time in 1 file
base/content/gui/gui/main/collapsible_checkbox_list.tl:193
Fields
| Name | Type | Description |
|---|---|---|
calloutContainerRef |
ReactRefWrapApi0<CalloutApi> |
Reference to the callout container in which the list is opened (e.g. gameCtx.calloutContainerRef). |
isToggledDependentSource |
ReactStateT<any> |
React state from which the check states are derived. |
header |
string |
Text of the button that opens the callout. |
hasArrow |
boolean |
defaults to false if nil |
verticalScrollPolicy |
Builtin.Type.ScrollBarPolicy |
defaults to AlwaysOff if nil |
indeterminateToggleToChecked |
boolean |
if true, toggling an indifferent checkbox will set it to checked instead of unchecked |
tooltip |
string |
Tooltip of the button that opens the callout. |
Functions
onToggle(index : integer) base/tealdef/gui/main/collapsible_checkbox_list.d.tl:18
Notes
Called with the 1-based index of the entry the user toggled.
transformDependentSourceFn({integer}, any) : {integer} base/tealdef/gui/main/collapsible_checkbox_list.d.tl:20
Notes
Derives the check state of each entry from isToggledDependentSource, as used by react.useDependentState.
Returns {integer}
Details
The resulting list has one value per entry (1 checked, 0 unchecked, -1 indeterminate).
makeEntries() : {{TreeNodeId, integer}} base/tealdef/gui/main/collapsible_checkbox_list.d.tl:23
second param is for level (defaults to 1 if nil)
Returns {{TreeNodeId, integer}}