builtin¶
Source: base/tealdef/scripts/builtin.d.tl
marker interface for emitter shapes
Example
-- from base/content/gui/gui/main/main_mod_button_area.tl
local builtin = ug_require "::/gui/main/builtin.lua" as Builtin
return builtin.FloatingLayout {
children = {
builtin.ScrollArea {
horizontalPolicy = builtin.type.ScrollBarPolicy.Simple,
verticalPolicy = builtin.type.ScrollBarPolicy.AlwaysOff,
content = builtin.Component {
meta = { class = "scroll-area-content" },
layout = builtin.BoxLayout {
orientation = builtin.type.Orientation.Horizontal,
children = children,
},
},
},
},
}
Contents¶
| Page | Description |
|---|---|
| Builtin.Type | Enumerations and helper classes of the built-in widgets, reached as builtin.type (lower case). |
| Builtin.ShaderQuadParam | Parameters of a shader quad, an image drawn with lighting and mouse effects. |
Builtin¶
record global base/tealdef/scripts/builtin.d.tl:3
global record Builtin
Notes
The built-in widget library returned by ug_require "::/gui/main/builtin.lua": recipes for layouts,
text, images, buttons, inputs, windows, charts and the game's tool and renderer components. Most widget
parameters are engine classes, so a parameter table may only contain the declared fields (an unknown key
raises an error). Enumerations are in builtin.type.
Fields
| Name | Type | Description |
|---|---|---|
type |
Type |
The enumerations and helper classes (builtin.type.Orientation, builtin.type.ScrollBarPolicy, ...). |
FloatingLayout |
Recipe<FloatingLayoutParam> |
Layout that stacks its children on top of each other and positions each one inside the layout. |
FloatingLayoutChild |
Recipe<FloatingLayoutChildParam> |
Wrapper that places one child in a floating layout. |
AbsoluteLayoutChild |
Recipe<AbsoluteLayoutChildParam> |
Wrapper for one child of an absolute layout. |
BoxLayout |
Recipe<BoxLayoutParam> |
Layout that arranges its children in a row or a column. |
FlowLayout |
Recipe<FlowLayoutParam> |
Layout that places children in a row and wraps to the next line when the space runs out. |
Chart |
Recipe<ChartParam> |
Note: Chart uses tooltips internally and thus ignores tooltips passed via 'meta' |
Series |
Recipe<SeriesParam> |
Data series of a chart. |
List |
Recipe<ListParam> |
List of selectable items. |
ScrollArea |
Recipe<ScrollAreaParam> |
Scrollable area around one content node. |
Component |
Recipe<ComponentParam> |
Container node around one layout; styled through its style classes. |
TextView |
Recipe<TextViewParam> |
Plain text label. |
RichTextView |
Recipe<RichTextViewParam> |
Formatted text (HTML or Markdown). |
KeybindingHintDisplay |
Recipe<KeybindingHintDisplayParam> |
Shows the key or gamepad button of an input action. |
ParticleSystem2d |
Recipe<ParticleSystem2dParam> |
2D particle effect in the GUI. |
ImageView |
Recipe<ImageViewParam> |
Image, optionally an animated sprite sheet. |
ShaderQuad |
Recipe<ShaderQuadParam> |
Image drawn with a GUI shader (lighting, ripple and shine effects). |
Button |
Recipe<ButtonParam> |
Push button. |
ToggleButton |
Recipe<ToggleButtonParam> |
Button with an on and an off state. |
ToggleButtonGroup |
Recipe<ToggleButtonGroupParam> |
Group of toggle buttons of which one can be selected. |
ToolButton |
Recipe<ToolButtonParam> |
Button that opens and closes a tool (window or building mode). |
DoubleSpinBox |
RecipeWithApi<DoubleSpinBoxParam, DoubleSpinBoxApi> |
Number input with steps; offers DoubleSpinBoxApi. |
TextInputField |
Recipe<TextInputFieldParam> |
Single-line text input. |
Slider |
Recipe<SliderParam> |
Integer slider. |
ColorPicker |
Recipe<ColorPickerParam> |
Colour picker. |
ColorChooser |
Recipe<ColorChooserParam> |
Colour swatches. |
ColorChooserButton |
Recipe<ColorChooserButtonParam> |
Button that opens colour swatches. |
GradientLegend |
Recipe<GradientLegendParam> |
Colour legend, e.g. of map layers. |
ProgressBar |
Recipe<ProgressBarParam> |
Progress bar. |
CheckBox |
Recipe<CheckBoxParam> |
Check box with optional label; values are 0, 1 and -1 (indeterminate). |
ComboBox |
Recipe<ComboBoxParam> |
Drop-down list. |
ComboBoxItem |
Recipe<ComboBoxItemParam> |
Entry of a combo box. |
NativeFileDialogButton |
Recipe<NativeFileDialogButtonParam> |
Button that opens a file dialog. |
DropComponent |
Recipe<DropComponentParam> |
Area that accepts files dropped from outside the game. |
RadialMenuChild |
Recipe<RadialMenuChildParam> |
Entry of a radial menu. used 1× in the base game |
RadialMenu |
Recipe<RadialMenuParam> |
Circular menu (gamepad). |
TabWidget |
Recipe<TabWidgetParam> |
Widget with tabs; the steps of hidden tabs are paused. |
TabWidgetChild |
Recipe<TabWidgetChildParam> |
One tab of a tab widget. |
Row |
Recipe<RowParam> |
Row of a table layout. |
TableLayout |
Recipe<TableLayoutParam> |
Layout that aligns rows of cells in columns. |
ColumnDesc |
Recipe<ColumnDescParam> |
Column description of a data table. |
DataTable |
RecipeWithApi<DataTableParam, DataTableApi> |
Sortable table with one cell recipe per column; offers DataTableApi. |
Window |
Recipe<WindowParam> |
Window with title bar; usually opened through the window container API or a tool. |
WindowContainerDelegate |
RecipeWithApi<WindowContainerDelegateParam, WindowAPI> |
The container that holds the game's windows; offers WindowAPI. |
ToolStack |
RecipeWithApi<ToolStackParam, ToolStackAPI> |
Stack of tools (windows, building modes); only the top tool is active, the others are shelved. Offers ToolStackAPI. |
HudIconManagerConfig |
Recipe<HudIconManagerConfigParam<any>> |
Configures the HUD icons of a map layer. |
UseDefaultHudIcon |
Recipe<HudIconParam> |
Shows the game's default HUD icon for the entity. |
HudIconChildConfig |
Recipe<HudIconChildConfigParam> |
Wraps one HUD icon node. |
RendererComponent |
RecipeWithApi<RendererComponentParam, RenderComponentAPI> |
The 3D game view; offers RenderComponentAPI. |
EntityRendererComponent |
Recipe<EntityRendererComponentParams> |
View that renders a single entity. |
EdgeRenderable |
Recipe<EdgeRenderableParam> |
Draws coloured lines along edges in the 3D view. |
MissionArrowRenderable |
Recipe<MissionArrowRenderableParam> |
Draws mission arrows in the 3D view. |
ActionDescriptor |
Recipe<ActionDescriptorParam> |
Describes the current action of the 3D view. |
ConstructionAction |
Recipe<ConstructionActionParam> |
Building action in the 3D view (placing, modifying or bulldozing). |
SimpleInputActions |
Recipe<SimpleInputActionsParam> |
Registers simple input actions. |
Selector |
Recipe<SelectorParam> |
Entity selector in the 3D view. |
NodeViewer |
Recipe<NodeViewerParam> |
|
LineViewer |
Recipe<LineViewerParam> |
Draws lines and stops in the 3D view. |
ProposalViewer |
Recipe<ProposalViewerParam> |
Previews a building proposal in the 3D view. |
MapPreviewComp |
Recipe<MapPreviewCompParam> |
Map preview. |
LayerConfig |
Recipe<LayerConfig> |
Configures the active map layer. |
RailroadCrossingComp |
Recipe<RailroadCrossingCompParam> |
|
SignalComp |
Recipe<SignalCompParam> |
|
ReactAdapterGuestContainer |
RecipeWithApi0<ReactAdapterGuestContainerAPI> |
Functions
WithComponentParams(WithComponentParamsParam, ?any) : TreeNodeId base/tealdef/scripts/builtin.d.tl:646
Notes
Wraps a node with the settings above; used internally for meta fields.
Returns TreeNodeId
AbsoluteLayout({TreeNodeId}) : TreeNodeId base/tealdef/scripts/builtin.d.tl:671
No description in the game files yet.
Returns TreeNodeId
ActionTooltip<T>(ActionTooltipParam<T>) : TreeNodeId base/tealdef/scripts/builtin.d.tl:1383
Notes
Creates a tooltip shown at the cursor during an action.
Returns TreeNodeId
FullScreenComponent<T>(FullScreenComponentParam<T>) : TreeNodeId base/tealdef/scripts/builtin.d.tl:1422
Notes
Creates a full-screen overlay from a recipe and its parameter.
Returns TreeNodeId
Nested records on their own pages: Type, ShaderQuadParam
Builtin.WithComponentParamsParam¶
record base/tealdef/scripts/builtin.d.tl:634
record WithComponentParamsParam
Notes
Settings applied to a node by wrapping it. React creates this wrapper from meta fields such as
tooltip, tag or enabled; set them in meta; the recipe is not meant to be called directly.
Fields
| Name | Type | Description |
|---|---|---|
id |
string |
Element id, as used by api.gui.byId. |
tag |
string |
Tag; the context help looks up its help page by tag. |
tooltip |
string |
Tooltip text. |
tooltipModifierInputAction |
string |
append this IA's key to the tooltip (regardless of what the key currently does) |
forceFocusable |
boolean |
Makes the node focusable. |
disableFocusableRecursive |
boolean |
Makes the node and its children non-focusable. |
enabled |
boolean |
False disables the node. |
item |
TreeNodeId |
The wrapped node. |
styleSheet |
StyleSheet |
Style sheet for the node. |
Builtin.FloatingLayoutParam¶
record base/tealdef/scripts/builtin.d.tl:648
record FloatingLayoutParam
Notes
Parameters of a floating layout, in which children are placed on top of each other.
Fields
| Name | Type | Description |
|---|---|---|
id |
string |
Element id. |
focusTraversalOrientation |
Type.Orientation |
Direction for gamepad focus movement between the children. |
children |
{TreeNodeId} |
Children; wrap them in FloatingLayoutChild to set their position. |
Builtin.FloatingLayoutChildParam¶
record base/tealdef/scripts/builtin.d.tl:654
record FloatingLayoutChildParam
Notes
Placement of one child of a floating layout.
Fields
| Name | Type | Description |
|---|---|---|
h |
number |
Horizontal position as a fraction of the free space (0 left, 0.5 centre, 1 right); -1 makes the child fill the width. |
v |
number |
Vertical position as a fraction of the free space (0 top, 0.5 centre, 1 bottom); -1 makes the child fill the height. |
overflowMode |
boolean |
Whether the child may leave the parent; the base game passes a builtin.type.FloatingLayoutOverflowMode value here although the field is declared boolean. |
localKey |
string |
Key that keeps the child's identity between renders. |
item |
TreeNodeId |
The child node (required). |
Builtin.AbsoluteLayoutChildParam¶
record base/tealdef/scripts/builtin.d.tl:666
record AbsoluteLayoutChildParam
Notes
One child of an absolute layout.
Fields
| Name | Type | Description |
|---|---|---|
localKey |
string |
Key that keeps the child's identity between renders. |
item |
TreeNodeId |
The child node (required). |
Builtin.BoxLayoutParam¶
record base/tealdef/scripts/builtin.d.tl:674
record BoxLayoutParam
Notes
Parameters of a box layout.
Fields
| Name | Type | Description |
|---|---|---|
id |
string |
Element id. |
children |
{TreeNodeId} |
Children in order. |
child |
TreeNodeId |
shortcut to setting children = |
orientation |
Type.Orientation |
Horizontal or vertical arrangement. |
Builtin.FlowLayoutParam¶
record base/tealdef/scripts/builtin.d.tl:683
record FlowLayoutParam
Notes
Parameters of a flow layout.
Fields
| Name | Type | Description |
|---|---|---|
children |
{TreeNodeId} |
Children in order. |
Builtin.ChartParam¶
record base/tealdef/scripts/builtin.d.tl:689
record ChartParam
Notes
Parameters of a chart.
Fields
Functions
xAxisLabelFormatter(number) : string base/tealdef/scripts/builtin.d.tl:690
Notes
Returns the label text for an X axis value.
Returns string
yAxisLabelFormatter(number) : string base/tealdef/scripts/builtin.d.tl:691
Notes
Returns the label text for a Y axis value.
Returns string
Builtin.SeriesParam¶
record base/tealdef/scripts/builtin.d.tl:700
record SeriesParam
Notes
One data series of a chart.
Fields
| Name | Type | Description |
|---|---|---|
label |
string |
Name of the series. |
type |
Type |
Chart type. |
color |
{Vec4f} |
Colour(s) of the series. |
lineWidth |
number |
Line width. |
xValues |
{number} |
X values. |
yValues |
{number} |
Y values, one per X value. |
gradientFill |
boolean |
adds a color gradient below the line (only available for Type LINE at the moment) |
Builtin.SeriesParam.Type¶
enum base/tealdef/scripts/builtin.d.tl:701
enum Type
Notes
Chart type of a series.
Used in the base game: 2 times in 2 files
base/content/gui/gui/entity_window/maintenance_station/maintenance_station_eow.script.tl:37
base/content/game_mechanics/game_mechanics/finance/finances_charts.tl:21
| Value | Description |
|---|---|
"LINE" |
Line. |
"LINE_STEP" |
Stepped line. |
"STACKED_LINE" |
Line stacked on the previous series. |
"BAR" |
Bars. |
"STACKED_BAR" |
Bars stacked on the previous series. |
Builtin.ListParam¶
record base/tealdef/scripts/builtin.d.tl:722
record ListParam
Notes
Parameters of a list of selectable items.
Fields
| Name | Type | Description |
|---|---|---|
drawBackground |
boolean |
Draw the list background. |
orientation |
Type.Orientation |
Horizontal or vertical list. |
behavior |
Type.ListBehavior |
Selection behaviour. |
cycle |
boolean |
Wrap around from the last item to the first when navigating. |
deselectAllowed |
boolean |
Allow deselecting the selected item. |
emitSignalOnReselect |
boolean |
Call onSelect again when the selected item is selected again. |
horizontalScrollBarPolicy |
Type.ScrollBarPolicy |
When to show the horizontal scroll bar. |
verticalScrollBarPolicy |
Type.ScrollBarPolicy |
When to show the vertical scroll bar. |
disableGamepadNavigation |
boolean |
Do not navigate the list with the gamepad. |
disableMouseScrolling |
boolean |
Do not scroll with the mouse wheel. |
children |
{TreeNodeId} |
The items. |
selectionIndex |
integer |
Index of the selected item. |
keepSelectedVisible |
boolean |
Scroll so that the selected item stays visible. |
Functions
onHover(integer) base/tealdef/scripts/builtin.d.tl:731
Notes
Called with the index of the hovered item.
onSelect(integer) base/tealdef/scripts/builtin.d.tl:732
Notes
Called with the index of the selected item.
onActivate(integer) base/tealdef/scripts/builtin.d.tl:733
Notes
Called with the index of the activated item.
Builtin.ScrollAreaParam¶
record base/tealdef/scripts/builtin.d.tl:749
record ScrollAreaParam
Notes
Parameters of a scroll area.
Fields
| Name | Type | Description |
|---|---|---|
content |
TreeNodeId |
The scrolled node. |
horizontalPolicy |
Type.ScrollBarPolicy |
When to show the horizontal scroll bar. |
verticalPolicy |
Type.ScrollBarPolicy |
When to show the vertical scroll bar. |
disableGamepadNavigation |
boolean |
Do not scroll with the gamepad. |
disableMouseScrolling |
boolean |
Do not scroll with the mouse wheel. |
Functions
onScroll(Vec2i, Vec2i) base/tealdef/scripts/builtin.d.tl:755
Notes
Called when the scroll position changes.
Builtin.ComponentParam¶
record base/tealdef/scripts/builtin.d.tl:760
record ComponentParam
Notes
Parameters of a component, the basic styled container.
Fields
| Name | Type | Description |
|---|---|---|
layout |
TreeNodeId |
Layout node with the component's content. |
name |
string |
Name of the component. |
mouseTransparent |
boolean |
Let mouse events pass through. |
Builtin.TextViewParam¶
record base/tealdef/scripts/builtin.d.tl:768
record TextViewParam
Notes
Parameters of a text view.
Fields
Builtin.RichTextViewParam¶
record base/tealdef/scripts/builtin.d.tl:777
record RichTextViewParam
Notes
Parameters of a rich text view.
Fields
| Name | Type | Description |
|---|---|---|
text |
string |
The text. |
isHtml |
boolean |
The text is HTML. |
isMarkdown |
boolean |
The text is Markdown. |
Builtin.KeybindingHintDisplayParam¶
record base/tealdef/scripts/builtin.d.tl:785
record KeybindingHintDisplayParam
Notes
Parameters of a key binding hint.
Fields
| Name | Type | Description |
|---|---|---|
inputAction |
string |
Input action whose key is shown, e.g. "IA_SELECT". |
source |
ReactRefWrap |
Node the hint belongs to. |
sourceId |
string |
Element id of the node the hint belongs to. |
Builtin.ParticleSystem2dParam¶
record base/tealdef/scripts/builtin.d.tl:793
record ParticleSystem2dParam
Notes
Parameters of a 2D particle system widget.
Fields
| Name | Type | Description |
|---|---|---|
emitters |
{Builtin.Type.ParticleSystem2dEmitter} |
The emitters; sub-emitters refer to them by index. |
Builtin.ImageViewParam¶
record base/tealdef/scripts/builtin.d.tl:799
record ImageViewParam
Notes
Parameters of an image view.
Used in the base game: 3 times in 2 files
base/content/gui/gui/menu/menu_icon_react_util.tl:141
base/content/gui/gui/menu/main_page.tl:412
Fields
| Name | Type | Description |
|---|---|---|
meta |
Meta |
Common node settings. |
path |
string |
Image file, e.g. "::/gui/builtin/checkbox/checked_16.tga". |
scaling |
Type.ImageViewScaling |
How the image is scaled. |
data |
{integer} |
|
data_native |
Vector<integer> |
|
flippedHorizontally |
boolean |
Mirror the image. |
size |
Vec2i |
|
coord |
Vec2i |
Grid of frames in a sprite sheet, columns and rows (e.g. 6, 6 for 36 frames). |
numFrames |
integer |
Number of frames in the sprite sheet. |
frame |
integer |
Frame to show. |
reverseAnimation |
boolean |
Play the frames backwards. |
animationSpeed |
integer |
Animation speed; 0 shows the fixed frame. |
waitNCycles |
integer |
Pause in animation cycles between two runs of the animation. |
stopOnLastFrame |
boolean |
Stop at the last frame instead of looping. |
animationFrameBottomToTop |
boolean |
Frames are ordered from the bottom of the sheet upwards. |
rotation |
number |
Rotation of the image. |
Builtin.ButtonParam¶
record base/tealdef/scripts/builtin.d.tl:859
record ButtonParam
Notes
Parameters of a button.
Fields
| Name | Type | Description |
|---|---|---|
content |
TreeNodeId |
Content of the button, e.g. a text view. |
Functions
onClick() base/tealdef/scripts/builtin.d.tl:861
Notes
Called when the button is clicked or activated.
Builtin.ToggleButtonParam¶
record base/tealdef/scripts/builtin.d.tl:866
record ToggleButtonParam
use initialValue if your ToggleButton is dumb (not referring to an external state) use value AND onValueChange your ToggleButton refers to a state (in the parent recipe of the checkBox)
Fields
| Name | Type | Description |
|---|---|---|
content |
TreeNodeId |
Content of the button. |
initialValue |
integer |
Start value when the button keeps its own state. |
value |
integer |
Current value when a parent state controls the button (use with onValueChange). |
Functions
onValueChange(integer) base/tealdef/scripts/builtin.d.tl:868
Notes
Called with the new value, 0 (off) or 1 (on).
Builtin.ToggleButtonGroupChildParam¶
record base/tealdef/scripts/builtin.d.tl:873
record ToggleButtonGroupChildParam
Notes
One button of a toggle button group.
Used in the base game: 11 times in 9 files
base/content/gui/gui/game_bar/game_bar_widgets.tl:206
base/content/gui/gui/menu/settings_page.tl:1945
base/content/gui/gui/menu/difficulty_react_util.tl:27
base/content/gui/gui/main/menu_category_util.tl:125
local createButtonParam = function(object : MenuCategoryUtil.FilterObject, isMajor : boolean, addDefaultTooltip : boolean) : Builtin.ToggleButtonGroupChildParam
base/content/gui/gui/main/script_param_util.tl:397
base/content/gui/gui/entity_window/line/line_eow.script.tl:461
… and 3 more files.
Fields
| Name | Type | Description |
|---|---|---|
content |
TreeNodeId |
Content of the button. |
meta |
Meta |
all transferred to ToggleButton inside ToggleButtonGroup! |
Builtin.ToggleButtonGroupParam¶
record base/tealdef/scripts/builtin.d.tl:878
record ToggleButtonGroupParam
Notes
Parameters of a group of toggle buttons of which one is selected.
Fields
| Name | Type | Description |
|---|---|---|
buttons |
{ToggleButtonGroupChildParam} |
The buttons. |
deselectAllowed |
boolean |
default is false |
layout |
Layout |
default is "Horizontal" |
separators |
{integer : TreeNodeId} |
Nodes inserted between buttons, keyed by position. |
initialSelected |
integer |
use -1 to avoid any selection at all (only working if deselectAllowed is set to true) |
selected |
integer |
Index of the selected button; -1 selects none (only with deselectAllowed). |
Functions
onValueChange(index : integer, value : integer) base/tealdef/scripts/builtin.d.tl:886
Notes
Called with the index of the newly selected button.
Builtin.ToggleButtonGroupParam.Layout¶
enum base/tealdef/scripts/builtin.d.tl:879
enum Layout
Notes
Arrangement of the buttons.
Builtin.ToolButtonParam¶
record base/tealdef/scripts/builtin.d.tl:896
record ToolButtonParam
Notes
Parameters of a tool button, which pushes a tool onto the tool stack.
Fields
| Name | Type | Description |
|---|---|---|
rendererComponentId |
string |
defaults to "mainView" |
toolDefinition |
IReactToolDefinition |
Tool pushed by the button. |
toolName |
string |
can be used instead of toolDefinition for cases where the definition is not available |
toolVariant |
string |
Variant of the tool; the button shows as active when this variant is active. |
toolStack |
ReactRefWrapApiT<ToolStackParam, ToolStackAPI> |
Tool stack to use. |
text |
string |
Button text. |
content |
TreeNodeId |
Button content. |
Functions
showFn() base/tealdef/scripts/builtin.d.tl:908
No description in the game files yet.
hideFn() base/tealdef/scripts/builtin.d.tl:909
No description in the game files yet.
Builtin.DoubleSpinBoxApi¶
record base/tealdef/scripts/builtin.d.tl:917
record DoubleSpinBoxApi
Notes
API of a spin box node.
Functions
startEditing(onStop : function()) base/tealdef/scripts/builtin.d.tl:918
Notes
Starts text editing; onStop is called when editing ends.
Builtin.DoubleSpinBoxParam¶
record base/tealdef/scripts/builtin.d.tl:920
record DoubleSpinBoxParam
Notes
Parameters of a number input with up and down steps.
Fields
Functions
onValueChange(number) base/tealdef/scripts/builtin.d.tl:925
Notes
Called with the new value.
onStopEditMode() base/tealdef/scripts/builtin.d.tl:930
Notes
Called when text editing ends.
Builtin.TextInputFieldParam¶
record base/tealdef/scripts/builtin.d.tl:935
record TextInputFieldParam
Notes
Parameters of a text input field.
Fields
Functions
filter(string) : boolean base/tealdef/scripts/builtin.d.tl:939
Notes
Returns false to reject a text.
Returns boolean
onEditingModeChange(boolean) base/tealdef/scripts/builtin.d.tl:940
Notes
Called when editing starts (true) or ends (false).
onTyping(string) base/tealdef/scripts/builtin.d.tl:941
Notes
Called with the text after each change while typing.
onValueChange(string) base/tealdef/scripts/builtin.d.tl:942
Notes
Called with the accepted text.
onCancel() base/tealdef/scripts/builtin.d.tl:943
Notes
Called when editing is cancelled.
Builtin.SliderParam¶
record base/tealdef/scripts/builtin.d.tl:959
record SliderParam
Notes
Parameters of a slider.
Fields
Functions
onValueChange(newValue : integer) base/tealdef/scripts/builtin.d.tl:972
Notes
Called with the new value.
Builtin.ColorPickerParam¶
record base/tealdef/scripts/builtin.d.tl:977
record ColorPickerParam
Notes
Parameters of a colour picker.
Fields
| Name | Type | Description |
|---|---|---|
color |
Vec3f |
Current colour (RGB). |
showApplyButton |
boolean |
Show an apply button. |
Functions
onValueChange(Vec3f) base/tealdef/scripts/builtin.d.tl:979
Notes
Called with the colour while it changes.
onApply(Vec3f) base/tealdef/scripts/builtin.d.tl:980
Notes
Called with the colour when the apply button is pressed.
Builtin.ColorChooserParam¶
record base/tealdef/scripts/builtin.d.tl:984
record ColorChooserParam
Notes
Parameters of a colour chooser, a set of colour swatches.
Fields
| Name | Type | Description |
|---|---|---|
colors |
{Vec3f} |
Colours to choose from. |
useCustomColors |
boolean |
Functions
onValueChange(Vec3f) base/tealdef/scripts/builtin.d.tl:987
Notes
Called with the chosen colour.
Builtin.ColorChooserButtonParam¶
record base/tealdef/scripts/builtin.d.tl:990
record ColorChooserButtonParam
Notes
Parameters of a button that opens a colour chooser.
Fields
| Name | Type | Description |
|---|---|---|
colors |
{Vec3f} |
Colours to choose from. |
color |
Vec3f |
Current colour. |
resetButton |
boolean |
Show a reset button. |
innerResetButton |
boolean |
|
image |
string |
Image on the button. |
toolTipPosition |
integer |
Position of the tooltip, a builtin.type.ToolTipPosition value. |
Functions
onValueChange(Vec3f) base/tealdef/scripts/builtin.d.tl:993
Notes
Called with the chosen colour.
Builtin.GradientLegendParam¶
record base/tealdef/scripts/builtin.d.tl:1004
record GradientLegendParam
Notes
Parameters of a colour gradient legend.
Fields
Builtin.ProgressBarParam¶
record base/tealdef/scripts/builtin.d.tl:1013
record ProgressBarParam
Notes
Parameters of a progress bar.
Fields
| Name | Type | Description |
|---|---|---|
value |
number |
must be in [0, 1]! |
thresholds |
{number} |
must be in [0, 1]! |
label |
string |
Text on the bar. |
applyGradient |
boolean |
defaults to true |
Builtin.CheckBoxParam¶
record base/tealdef/scripts/builtin.d.tl:1024
record CheckBoxParam
use initialValue if your CheckBox is dumb (not referring to an external state) use value AND onValueChange your CheckBox refers to a state (in the parent recipe of the checkBox)
Fields
Functions
onValueChange(integer) base/tealdef/scripts/builtin.d.tl:1025
Notes
Called with the new value, 0 (unchecked), 1 (checked) or -1 (indeterminate).
Builtin.ComboBoxParam¶
record base/tealdef/scripts/builtin.d.tl:1033
record ComboBoxParam
Notes
Parameters of a combo box (drop-down list).
Fields
| Name | Type | Description |
|---|---|---|
value |
integer | number | string |
Value of the selected item. |
items |
{TreeNodeId} |
Items, created with ComboBoxItem. |
compact |
boolean |
defaults to false, decides about visual appearance |
Functions
onValueChange(newValue : integer | number | string) base/tealdef/scripts/builtin.d.tl:1036
Notes
Called with the value of the newly selected item.
onPopupChange(popupShown : boolean) base/tealdef/scripts/builtin.d.tl:1037
Notes
Called when the drop-down list opens (true) or closes (false).
Builtin.ComboBoxItemParam¶
record base/tealdef/scripts/builtin.d.tl:1041
record ComboBoxItemParam
Notes
One entry of a combo box.
Fields
| Name | Type | Description |
|---|---|---|
value |
integer | number | string |
Value of the entry. |
content |
TreeNodeId |
Content shown for the entry. |
available |
boolean |
False shows the entry as unavailable. |
Builtin.NativeFileDialogButtonParam¶
record base/tealdef/scripts/builtin.d.tl:1051
record NativeFileDialogButtonParam
Notes
Parameters of a button that opens the operating system's file dialog.
Fields
| Name | Type | Description |
|---|---|---|
content |
TreeNodeId |
Content of the button. |
title |
string |
Title of the dialog. |
filters |
{{string, string}} |
File type filters as {name, pattern} pairs. |
intiialPath |
string |
Folder the dialog opens in (the field name is spelled this way). |
Functions
onOpen({string}) base/tealdef/scripts/builtin.d.tl:1053
Notes
Called with the selected file paths.
Builtin.DropComponentParam¶
record base/tealdef/scripts/builtin.d.tl:1061
record DropComponentParam
Notes
Parameters of an area that accepts dropped files.
Fields
| Name | Type | Description |
|---|---|---|
content |
TreeNodeId |
Content of the area. |
Functions
onDrop({string}) base/tealdef/scripts/builtin.d.tl:1063
Notes
Called with the paths of the dropped files.
Builtin.RadialMenuChildParam¶
record base/tealdef/scripts/builtin.d.tl:1068
record RadialMenuChildParam
Notes
One entry of a radial menu.
Fields
| Name | Type | Description |
|---|---|---|
icon |
string |
Icon of the entry. |
tag |
string |
Tag of the entry. |
Functions
onActivate() base/tealdef/scripts/builtin.d.tl:1070
Notes
Called when the entry is chosen.
getInfoText() : string base/tealdef/scripts/builtin.d.tl:1071
Notes
Returns the text shown while the entry is highlighted.
Returns string
Builtin.RadialMenuParam¶
record base/tealdef/scripts/builtin.d.tl:1075
record RadialMenuParam
Notes
Parameters of a radial menu.
Used in the base game: 1 time in 1 file
base/content/gui/gui/game_bar/game_bar.tl:1114
Fields
| Name | Type | Description |
|---|---|---|
mouseSupport |
boolean |
Allow choosing with the mouse. |
children |
{TreeNodeId} |
of type Builtin.RadialMenuChild |
Functions
onHide() base/tealdef/scripts/builtin.d.tl:1076
Notes
Called when the menu closes.
getNoSelectionInfoText() : string base/tealdef/scripts/builtin.d.tl:1077
Notes
Returns the text shown while no entry is highlighted.
Returns string
Builtin.TabWidgetParam¶
record base/tealdef/scripts/builtin.d.tl:1086
record TabWidgetParam
Notes
Parameters of a tab widget.
Fields
| Name | Type | Description |
|---|---|---|
orientation |
Type.TabOrientation |
default: TabOrientation.North |
deselectAllowed |
boolean |
default: false |
indicatorsScrollable |
boolean |
default: true, works only with orientation = Type.North and Type.South |
tabs |
{TreeNodeId} |
Tabs, created with TabWidgetChild. |
showIndicators |
boolean |
default: true |
initialValue |
integer | number | string |
default: first child |
value |
integer | number | string |
Index of the active tab. |
Functions
onClose() base/tealdef/scripts/builtin.d.tl:1092
Notes
Called when the tab widget is closed.
onValueChange(newValue : integer | number | string) base/tealdef/scripts/builtin.d.tl:1096
value of selected child, nil if nothing is selected (only if deselectAllowed == true)
Builtin.TabWidgetChildParam¶
record base/tealdef/scripts/builtin.d.tl:1099
record TabWidgetChildParam
Notes
One tab of a tab widget.
Fields
| Name | Type | Description |
|---|---|---|
localKey |
string |
Key that keeps the tab's identity between renders. |
indicator |
TreeNodeId |
Node shown in the tab bar. |
item |
TreeNodeId |
Content of the tab. |
value |
integer | number | string |
must be not nil and must be unique within their TabWidget note: index of tab inside parent TabWidget is NOT such a good idea, especially if your number of tabs might change |
Builtin.RowParam¶
record base/tealdef/scripts/builtin.d.tl:1112
record RowParam
Notes
One row of a table layout.
Fields
| Name | Type | Description |
|---|---|---|
cells |
{TreeNodeId} |
Cells of the row. |
Builtin.TableLayoutParam¶
record base/tealdef/scripts/builtin.d.tl:1116
record TableLayoutParam
Notes
Parameters of a table layout.
Fields
| Name | Type | Description |
|---|---|---|
id |
string |
Element id. |
columnWeights |
{number} |
Relative widths of the columns, e.g. {3, 2}. |
rows |
{TreeNodeId} |
instances of Builtin.Row |
Builtin.TableCellParam¶
record base/tealdef/scripts/builtin.d.tl:1125
record TableCellParam
Notes
Parameters a data table passes to a cell recipe.
Used in the base game: 114 times in 18 files
base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:1957
local LineAndDepotListEntry = react.RegisterRecipe("LineAndDepotListEntry", function(params : Builtin.TableCellParam) : TreeNodeId
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_table.tl:16
local CapacityDummyCell = react.RegisterRecipe("CapacityDummyCell", function(_params : Builtin.TableCellParam) : TreeNodeId
base/content/gui/gui/line_vehicle_mgmt/vehicle_list_react_util.tl:25
local ToggleSelectVehicle = react.RegisterRecipe("ToggleSelectVehicle", function(params : Builtin.TableCellParam) : TreeNodeId
base/content/gui/gui/menu/mod_manager_react_util.tl:4305
local makeValidationCell = function(param : Builtin.TableCellParam, content :TreeNodeId) : TreeNodeId
base/content/gui/gui/statistics/statistic_warehouses.tl:13
local WarehouseLocationAndNameCell = react.RegisterRecipe("WarehouseLocationAndNameCell", function(params : Builtin.TableCellParam) : TreeNodeId
base/content/gui/gui/statistics/statistic_depots.tl:12
… and 12 more files.
Fields
| Name | Type | Description |
|---|---|---|
rowKey |
integer |
Key of the row. |
colKey |
integer |
Key of the column. |
userParam |
any |
The table's user parameter. |
Builtin.TableCellParamT¶
record base/tealdef/scripts/builtin.d.tl:1131
record TableCellParamT<T>
Notes
Typed parameters a data table passes to a cell recipe.
Used in the base game: 5 times in 1 file
base/content/gui/gui/menu/mod_selector_page.tl:415
Fields
| Name | Type | Description |
|---|---|---|
rowKey |
integer |
Key of the row. |
colKey |
integer |
Key of the column. |
userParam |
T |
The table's user parameter. |
Builtin.ColumnDescParam¶
record base/tealdef/scripts/builtin.d.tl:1137
record ColumnDescParam
Notes
Description of one column of a data table.
Fields
| Name | Type | Description |
|---|---|---|
name |
string |
Column header text. |
tooltip |
string |
Tooltip of the header. |
path |
string |
Icon of the header. |
headerStyleClass |
string |
Style class of the header. |
weight |
number |
Relative width of the column. |
recipe |
IRecipe |
with arg of type Builtin.TableCellParam |
forceLexicographicalStringComparison |
boolean |
Force lexicographical string comparison for all strings (causing e.g. "Train 10" before "Train 2") |
Functions
getCompareValue(rowKey : integer) : any base/tealdef/scripts/builtin.d.tl:1149
Get value to be used when sorting the table at C++. Sorting the table from C++ will use lang_util.compareStrings() to compare strings that are not themselves keys inside a table. For example, this will cause "Train 2" to be sorted before "Train 10". If needed, you can opt-out of this string comparison behavior by setting forceLexicographicalStringComparison = true.
Returns any
Builtin.DataTableApi¶
record base/tealdef/scripts/builtin.d.tl:1155
record DataTableApi
Notes
API of a data table node.
Functions
scrollToRowKey(rowKey : integer, forceTopAlign : boolean) base/tealdef/scripts/builtin.d.tl:1158
note that this will not work in the 1st frame. You should always set for initial selection, use preferredInitialSelectionRowKey
Builtin.DataTableParam¶
record base/tealdef/scripts/builtin.d.tl:1160
record DataTableParam
Notes
Parameters of a data table, a sortable table built from cell recipes.
Fields
| Name | Type | Description |
|---|---|---|
columns |
{TreeNodeId} |
instances of type Builtin.ColumnDesc |
rowKeys |
{integer} |
Keys of the rows to show. |
preferredInitialSelectionRowKey |
integer |
Row selected when the table first appears. |
disableSortKey |
boolean |
|
iaSort |
string |
InputAction key to change sorting (default: IA_OPTION2) |
userParam |
any |
Input param given to NEWLY CREATED cells. Existing cells will NOT be updated! (-> use constants or pass a ref and read onStep inside the cell) |
initialSortColumn |
{integer, boolean} |
1-based index of initial column, true if ASC, false if DESC |
columnWeights |
{number} |
Removed. Use weight of ColumDesc instead. |
scrollPolicyHorizontal |
Type.ScrollBarPolicy |
When to show the horizontal scroll bar. |
scrollPolicyVertical |
Type.ScrollBarPolicy |
When to show the vertical scroll bar. |
keyboardNavigation |
boolean |
use arrow keys to navigate cells (instead of controlling scrollbars directly) |
Functions
compareFn(colIndex : integer, rowKeyA : integer, rowKeyB : integer) : boolean base/tealdef/scripts/builtin.d.tl:1168
Deprecated: Function for table sorting. Prefer ColumnDescParam.getCompareValue instead.
Returns boolean
fnUserFilter(integer) : boolean base/tealdef/scripts/builtin.d.tl:1171
Notes
Returns false for rows to hide.
Returns boolean
onSortColumnChange(columnIndex : integer, ascending : boolean) base/tealdef/scripts/builtin.d.tl:1173
Notes
Called when the sort column or order changes.
Builtin.WindowParam¶
record base/tealdef/scripts/builtin.d.tl:1186
record WindowParam
Notes
Parameters of a window.
Fields
| Name | Type | Description |
|---|---|---|
title |
string |
Window title. |
closable |
boolean |
Show the close button. |
movable |
boolean |
Allow moving the window. |
pinnable |
boolean |
Show the pin button. |
pinned |
boolean |
Window is pinned. |
autoFocusOnBecomingVisible |
boolean |
Give the window the focus when it becomes visible. |
autoVisibilityOnFocusChange |
boolean |
|
content |
TreeNodeId |
Content of the window (required). |
initialX |
number |
Start position, X. |
initialY |
number |
Start position, Y. |
titleEditable |
boolean |
Let the player edit the title (e.g. to rename an entity). |
locateVisible |
boolean |
Show the locate button. |
id |
string |
Element id, e.g. "menu.pause"; api.gui.byId finds the window by it. |
tool |
string |
Name of the tool the window belongs to, e.g. "notification-log". |
expanded |
boolean |
if true, specify expanded size with a css rule using !window-expanded, furthermore: !window-collapsed is set when returning from expanded mode (but not initially) |
compact |
boolean |
if true, the content fills the entire window. Title bar gets reduced to some button (via !window-compact css rules) and overlaps with the content. |
emptyNameAllowed |
boolean |
defaults to true |
inputActionBubbleUpFilter |
Type.InputActionBubbleUpFilter |
Which input actions the window passes on to its parent. |
header |
TreeNodeId |
Extra node in the window header. |
Functions
onClose() base/tealdef/scripts/builtin.d.tl:1188
Notes
Called when the window is closed.
onTitleChange(string) base/tealdef/scripts/builtin.d.tl:1199
Notes
Called with the edited title.
onLocate() base/tealdef/scripts/builtin.d.tl:1201
Notes
Called when the locate button is pressed.
onPinned(boolean) base/tealdef/scripts/builtin.d.tl:1202
Notes
Called when the window is pinned or unpinned.
Builtin.WindowContainerDelegateParam¶
record base/tealdef/scripts/builtin.d.tl:1212
record WindowContainerDelegateParam
Notes
Parameters of the window container.
Used in the base game: 10 times in 7 files
base/content/gui/gui/menu/mod_manager_react_util.tl:2810
base/content/gui/gui/menu/settings_page.tl:107
base/content/gui/gui/menu/save_game_page.tl:28
base/content/gui/gui/menu/main_menu.tl:538
local windowContainer = react.useNodeRef() as ReactRefWrapApiT<Builtin.WindowContainerDelegateParam, Builtin.WindowAPI>
base/content/gui/gui/menu/paradox_react_util.tl:288
base/content/gui/gui/main/pause_menu.tl:15
… and 1 more files.
Fields
| Name | Type | Description |
|---|---|---|
redirectToComponentIdHack |
string |
Builtin.WindowAPI¶
record base/tealdef/scripts/builtin.d.tl:1216
record WindowAPI
Notes
API of the window container, from gameCtx.windowContainer:get():getApi().
Used in the base game: 27 times in 16 files
base/content/gui/gui/layers/layers_button_ridge.tl:25
base/content/gui/gui/line_vehicle_mgmt/line_manager_panel.tl:60
base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:4772
base/content/gui/gui/game_bar/game_bar.tl:25
base/content/gui/gui/menu/mod_manager_react_util.tl:74
mod_manager_react_util.showMessageBox = function(wc : Builtin.WindowAPI, setBlockedForModal : function(boolean), title : string, message : string)
base/content/gui/gui/menu/settings_page.tl:107
… and 10 more files.
Functions
addSingletonWindow<T>(Recipe<T>, params : T) base/tealdef/scripts/builtin.d.tl:1218
note that if these reuse a window, they do not change its visibility
Notes
Opens a window of the recipe; there is at most one such window.
addSingletonWindow<T, A>(RecipeWithApi<T, A>, params? : T) base/tealdef/scripts/builtin.d.tl:1219
Notes
Opens a window of the recipe; there is at most one such window.
addWindow<T>(Recipe<T>, key : string, params : T) base/tealdef/scripts/builtin.d.tl:1220
Notes
Opens a window of the recipe under a key; several windows of one recipe can be open with different keys.
moveSingletonWindowToFront(IRecipe) base/tealdef/scripts/builtin.d.tl:1223
note that these only move the window in z order, they do not change its visibility
Notes
Brings the single window of the recipe to the front.
moveSingletonWindowToFront<T>(Recipe<T>) base/tealdef/scripts/builtin.d.tl:1224
Notes
Brings the single window of the recipe to the front.
moveSingletonWindowToFront<T, A>(RecipeWithApi<T, A>) base/tealdef/scripts/builtin.d.tl:1225
Notes
Brings the single window of the recipe to the front.
moveWindowToFront(IRecipe, key : string) base/tealdef/scripts/builtin.d.tl:1226
Notes
Brings the window of the recipe with the key to the front.
moveWindowToFront<T>(Recipe<T>, key : string) base/tealdef/scripts/builtin.d.tl:1227
Notes
Brings the window of the recipe with the key to the front.
removeAllWindows<T>(Recipe<T>) base/tealdef/scripts/builtin.d.tl:1229
Notes
Closes all windows of the recipe.
removeAllWindows<T, A>(?RecipeWithApi<T, A>) base/tealdef/scripts/builtin.d.tl:1230
Notes
Closes all windows of the recipe.
removeWindow<T>(Recipe<T>, key : string) base/tealdef/scripts/builtin.d.tl:1231
Notes
Closes the window of the recipe with the key.
Builtin.ToolStackContext¶
record base/tealdef/scripts/builtin.d.tl:1237
record ToolStackContext<T>
Notes
Context a tool's callbacks receive.
Used in the base game: 38 times in 9 files
base/content/mission/mission/mission_framework/mission_framework_react.tl:847
local function addOrUpdateWindow(ctx : Builtin.ToolStackContext<MissionGuiToolParam>, toolParam : MissionGuiToolParam)
base/content/gui/gui/layers/layers_button_ridge.tl:88
local makeToolWindowParam = function(toolParam : LayerToolParamInternal, ctx : Builtin.ToolStackContext<LayerToolParamInternal>) : LayerToolWindowParam
base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:8283
local makeToolWindowParam = function(toolParam : ManagerWindow.ManagerToolParam, ctx : Builtin.ToolStackContext<ManagerWindow.ManagerToolParam>) : ToolReactUtil
base/content/gui/gui/construction/construction.tl:5037
local makeToolWindowParam = function(toolParam : ConstructionToolParam, ctx : Builtin.ToolStackContext<ConstructionToolParam>) : ConstructionToolWindowParam
base/content/gui/gui/main/pause_menu.tl:430
pauseMenuToolImpl.pop = function(ctx : Builtin.ToolStackContext<ToolReactUtil.IToolParam>, param : ToolReactUtil.IToolParam)
base/content/gui/gui/main/free_cam_options.tl:38
… and 3 more files.
Functions
setActionFn(actionFn? : (function() : TreeNodeId), key2? : string) base/tealdef/scripts/builtin.d.tl:1238
Notes
Sets the function that creates the tool's action node (e.g. a ConstructionAction) for the 3D view; nil removes it.
popSelf() base/tealdef/scripts/builtin.d.tl:1239
shortcut to toolStackApi.pop(recipe, key)
setVariantOverride(string) base/tealdef/scripts/builtin.d.tl:1240
Notes
Overrides the active variant of the tool.
Builtin.ToolStackAPI¶
record base/tealdef/scripts/builtin.d.tl:1242
record ToolStackAPI
Notes
API of the tool stack.
Used in the base game: 11 times in 11 files
base/content/mission/mission/mission_framework/mission_framework_react.tl:17
base/content/gui/gui/layers/layers_button_ridge.tl:28
base/content/gui/gui/game_bar/game_bar.tl:22
base/content/gui/gui/game_bar/game_bar_widgets.tl:66
base/content/gui/gui/construction/construction.tl:178
base/content/gui/gui/main/free_cam_options.tl:7
… and 5 more files.
Functions
push<T>(ReactToolDefinition<T>, key : string, params? : T, allowStacking : boolean) base/tealdef/scripts/builtin.d.tl:1243
Notes
Pushes a tool with a key and parameters; with allowStacking false, all other tools except the default tool are removed first.
pop<T>(ReactToolDefinition<T>, key : string) base/tealdef/scripts/builtin.d.tl:1244
Notes
Removes the tool with the key from the stack.
pop(tool : IReactToolDefinition, key : string) base/tealdef/scripts/builtin.d.tl:1245
Notes
Removes the tool with the key from the stack.
clear() base/tealdef/scripts/builtin.d.tl:1246
Notes
Removes all tools except the default tool.
setActionsDisabled(block : boolean) base/tealdef/scripts/builtin.d.tl:1247
start/end behaving as if actionFn would always be nil
getActiveTool() : IReactToolDefinition, string base/tealdef/scripts/builtin.d.tl:1248
Notes
Returns the tool on top of the stack and its key.
Returns IReactToolDefinition, string
Builtin.ToolStackParam¶
record base/tealdef/scripts/builtin.d.tl:1250
record ToolStackParam
Notes
Parameters of the tool stack.
Used in the base game: 1 time in 1 file
base/content/gui/gui/main/game.tl:608
Fields
| Name | Type | Description |
|---|---|---|
rendererComponent |
ReactRefWrapApiT<Builtin.RendererComponentParam, Builtin.RenderComponentAPI> |
Renderer component (3D view) the tools act on. |
defaultTool |
ReactToolDefinition |
Tool used when the stack is empty. |
defaultToolParam |
any |
Parameters of the default tool. |
defaultToolKey |
string |
Key of the default tool. |
showDebugVisualization |
boolean |
Show debug output of the tool stack. |
Builtin.HudIconParam¶
record base/tealdef/scripts/builtin.d.tl:1261
record HudIconParam
Notes
Parameters a HUD icon recipe receives for one entity.
Used in the base game: 35 times in 22 files
base/content/landmarks/landmark_hud.script.tl:11
hudIconFn = function(_captureParams : any, _params : Builtin.HudIconParam, _userParam : HudIconToolbox.HudIconMasterUserParam) : TreeNodeId
base/content/landmarks/hq/hq/headquarter_hud.script.tl:4
hudIconFn = function(_captureParams : any, _params : Builtin.HudIconParam, _userParam : HudIconToolbox.HudIconMasterUserParam) : TreeNodeId
base/content/gui/gui/layers/layer_terrain.tl:45
local HudIconManagerTerrain = react.RegisterRecipe("HudIconManagerTerrain", function(params : Builtin.HudIconParam, userParam : HudIconUserParam) : TreeNodeId
base/content/gui/gui/layers/layer_passenger_flow.tl:33
local HudIconManagerMobility = react.RegisterRecipe("HudIconManagerMobility", function(params : Builtin.HudIconParam, userParam : HudIconUserParam) : TreeNodeId
base/content/gui/gui/layers/layer_infrastructure.tl:61
local HudIconManagerSpeed = react.RegisterRecipe("HudIconManagerSpeed", function(params : Builtin.HudIconParam, userParam : HudIconUserParam) : TreeNodeId
base/content/gui/gui/layers/layer_civilization.tl:51
… and 16 more files.
Fields
| Name | Type | Description |
|---|---|---|
entity |
Engine.Entity |
The entity the icon belongs to. |
index |
integer |
|
details |
Gui.SelectionDetails |
Selection details of the entity or sub-entity. |
internalLayer |
integer |
|
internalPhysicsImpact |
integer |
Builtin.HudIconChildConfigParam¶
record base/tealdef/scripts/builtin.d.tl:1270
record HudIconChildConfigParam
Notes
Wraps one HUD icon node.
Fields
| Name | Type | Description |
|---|---|---|
item |
TreeNodeId |
The icon node. |
selectorSupport |
boolean |
true to allow selector hover event while mouse hovers the item. nil to inherit from parent (root defaults to true). |
overrideSelectionDetails |
boolean |
true to override selectionDetails for the above feature, false to use the one from HudIconParamT. nil to inherit from parent (root defaults to false) |
selectionDetails |
Gui.SelectionDetails |
if overrideSelectionDetails == true, the selectionDetails to be used |
Builtin.HudIconManagerConfigParam¶
record base/tealdef/scripts/builtin.d.tl:1278
record HudIconManagerConfigParam<T>
Notes
Configures the HUD icons of a map layer.
Used in the base game: 2 times in 1 file
base/content/gui/gui/construction/construction_react_util.tl:1256
Fields
| Name | Type | Description |
|---|---|---|
userParam |
T |
Value passed to the master recipe as its second parameter. |
masterRecipe |
Recipe2<HudIconParam, T> |
Recipe that creates the icon for each entity. |
preFilter |
{Engine.ComponentType} |
List components for which the HUD icons will be created and shown Subconstruction filter only applies to subconstruction that are of no other type |
preFilterTvCarriers |
{Carrier} |
In case you have TransportVehicle in you preFilter, this additionally filters for its carriers |
showCosts |
boolean |
Show cost pop-ups. |
showIncome |
boolean |
Show income pop-ups. |
incomeSFX |
{FilePath} |
only active if showIncome is true |
costsRenderDistance |
number |
Camera distance up to which cost pop-ups are shown. |
transportVehiclePainter |
any |
variant nil|LineVehicleColor|TrafficColor|EmissionEmitterColor|MaintainedTransportVehicleColor |
fallbackColor |
LayerConfig.ColorPassFn.FallbackColor |
should be set whenever transportVehiclePainter is provided |
localKey |
string |
Key that keeps the node's identity between renders. |
visibilityThresholds |
Builtin.Type.VisibilityThresholds |
Camera distance rules per entity type. |
vehicleIconOffsets |
{Carrier : Vec3f} |
Offset of vehicle icons per carrier. |
Builtin.RendererComponentParam¶
record base/tealdef/scripts/builtin.d.tl:1303
record RendererComponentParam
Notes
Parameters of the renderer component (the 3D view).
Used in the base game: 4 times in 2 files
base/content/gui/gui/main/selector_react_util.tl:88
function selector_react_util.makeDefaultSelector(refRC : ReactRefWrapApiT<Builtin.RendererComponentParam, Builtin.RenderComponentAPI>, selectedEntityRef : React
base/content/gui/gui/main/game.tl:37
Fields
| Name | Type | Description |
|---|---|---|
toolStack |
ReactRefWrapApiT<ToolStackParam, ToolStackAPI> |
Tool stack whose top tool acts in the view. |
redirectToComponentIdHack |
string |
Builtin.RenderComponentAPI¶
record base/tealdef/scripts/builtin.d.tl:1308
record RenderComponentAPI
Notes
API of the renderer component.
Used in the base game: 4 times in 2 files
base/content/gui/gui/main/selector_react_util.tl:88
function selector_react_util.makeDefaultSelector(refRC : ReactRefWrapApiT<Builtin.RendererComponentParam, Builtin.RenderComponentAPI>, selectedEntityRef : React
base/content/gui/gui/main/game.tl:37
Functions
bindAction(ref : ReactRefWrap, (function() : TreeNodeId), key2? : string) base/tealdef/scripts/builtin.d.tl:1309
No description in the game files yet.
unbindAction(ref : ReactRefWrap) base/tealdef/scripts/builtin.d.tl:1310
No description in the game files yet.
Builtin.EntityRendererComponentParams¶
record base/tealdef/scripts/builtin.d.tl:1313
record EntityRendererComponentParams
Notes
Parameters of an entity view.
Fields
| Name | Type | Description |
|---|---|---|
entity |
Engine.Entity |
The entity to show. |
Builtin.EdgeRenderableParam¶
record base/tealdef/scripts/builtin.d.tl:1317
record EdgeRenderableParam
Notes
Parameters of edge highlights in the 3D view.
Fields
| Name | Type | Description |
|---|---|---|
edges |
{Type.EdgeRenderable.Edge} |
The edges to draw. |
ignoreDepth |
boolean |
Draw the edges on top of everything. |
Builtin.MissionArrowRenderableParam¶
record base/tealdef/scripts/builtin.d.tl:1322
record MissionArrowRenderableParam
Notes
Parameters of mission arrows.
Fields
| Name | Type | Description |
|---|---|---|
arrows |
{Type.MissionArrowRenderable.Arrow} |
The arrows to draw. |
Builtin.TerrainCirclePolicy¶
enum base/tealdef/scripts/builtin.d.tl:1331
enum TerrainCirclePolicy
Notes
When the circle under the mouse cursor is drawn on the terrain.
Used in the base game: 3 times in 2 files
base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:503
ctx.setTerrainCirclePolicy(app_util.getMouseOrGamepad("Never", "Always") as Builtin.TerrainCirclePolicy)
base/content/gui/gui/line_vehicle_mgmt/line_util.tl:985
| Value | Description |
|---|---|
"FocusSelection" |
Only around the focused selection. |
"Always" |
Always. |
"IfNoEntity" |
Only when the cursor is not over an entity. |
"Never" |
Never. |
Builtin.ActionDescriptorParam¶
record base/tealdef/scripts/builtin.d.tl:1338
record ActionDescriptorParam
Notes
Describes the active action in the 3D view (tool name, layer, input prompts).
Fields
| Name | Type | Description |
|---|---|---|
tool |
string |
Name of the tool. |
layer |
string |
Map layer shown during the action. |
terrainCirclePolicy |
TerrainCirclePolicy |
When to draw the terrain circle. |
highlightedEntities |
{Engine.Entity} |
Entities to highlight. |
crosshair |
boolean |
Show the crosshair (the base game shows it in gamepad mode). |
parent |
ReactNodeRef |
Parent node of the action. |
horizontalPromptList |
boolean |
Lay out the button prompts horizontally. |
children |
{TreeNodeId} |
Child nodes of the action. |
Functions
onBack() base/tealdef/scripts/builtin.d.tl:1345
Notes
Called when the player backs out of the action.
Builtin.ActionTooltipParam¶
record base/tealdef/scripts/builtin.d.tl:1350
record ActionTooltipParam<T>
Notes
Tooltip shown at the cursor during an action.
Used in the base game: 14 times in 3 files
base/content/gui/gui/construction/construction_react_util.tl:1285
base/content/gui/gui/construction/tools/marketing_campaign_tool.script.tl:35
base/content/gui/gui/construction/tools/industry_greenify_tool.script.tl:28
Fields
| Name | Type | Description |
|---|---|---|
recipe |
Recipe<T> |
Recipe of the tooltip content. |
param |
T |
Parameter passed to the recipe. |
Builtin.ConstructionActionParam¶
record base/tealdef/scripts/builtin.d.tl:1355
record ConstructionActionParam
Notes
Parameters of a building action in the 3D view. Set the descriptor of the tool kind to use, e.g.
constructionBuilder to place a construction or bulldozer to remove objects.
Used in the base game: 1 time in 1 file
base/content/gui/gui/construction/construction_react_util.tl:3146
Fields
| Name | Type | Description |
|---|---|---|
modifierColor |
Type.ConstructionAction.ModifierColor |
Highlight colours of modifier tools. |
constructionBuilder |
Type.ConstructionAction.ConstructionBuilder |
Settings for placing constructions. |
streetEdgeBuilder |
Type.ConstructionAction.StreetEdgeBuilder |
Settings for building streets. |
trackEdgeBuilder |
Type.ConstructionAction.TrackEdgeBuilder |
Settings for building tracks. |
streetEdgeNodeModifier |
Type.ConstructionAction.StreetEdgeNodeModifier |
Settings for changing streets. |
trackEdgeModifier |
Type.ConstructionAction.TrackEdgeModifier |
Settings for changing tracks. |
edgeObjectBuilder |
Type.ConstructionAction.EdgeObjectBuilder |
Settings for placing edge objects (street stops, signals). |
laneModifier |
Type.ConstructionAction.LaneModifier |
Settings for changing lanes. |
crosswalkModifier |
Type.ConstructionAction.CrosswalkModifier |
Settings for changing crosswalks. |
terrainModifier |
Type.ConstructionAction.TerrainModifier |
Settings for shaping the terrain. |
terrainPainter |
Type.ConstructionAction.TerrainPainter |
Settings for painting the terrain. |
assetBrush |
Type.ConstructionAction.AssetBrush |
Settings for placing assets with a brush. |
townBuilder |
Type.ConstructionAction.TownBuilder |
Settings for founding towns. |
bulldozer |
Type.ConstructionAction.Bulldozer |
Settings for bulldozing. |
moduleBuilder |
Type.ConstructionAction.ModuleBuilder |
Settings for placing modules. |
moduleBulldozer |
Type.ConstructionAction.ModuleBulldozer |
Settings for removing modules. |
inputActions |
{string : string} |
Extra input actions of the action, by name. |
inputActionPrompts |
{string : string} |
Prompt text per input action. |
inputActionActive |
{string : boolean} |
Active flag per input action. |
preventFocusStealFromIds |
{string} |
Element ids from which the action does not take the focus. |
Functions
getProposalStringsFn(proposal : Proposal, proposalData : ProposalData) : {string} base/tealdef/scripts/builtin.d.tl:1373
Notes
Returns text lines for the current proposal.
Returns {string}
inputActionsHandler(string) base/tealdef/scripts/builtin.d.tl:1376
Notes
Called with the name of a triggered input action.
Builtin.SimpleInputActionsParam¶
record base/tealdef/scripts/builtin.d.tl:1386
record SimpleInputActionsParam
Notes
Parameters of a set of input actions.
Fields
| Name | Type | Description |
|---|---|---|
inputActions |
{string : string} |
Input actions, by name. |
Functions
inputActionsHandler(string) base/tealdef/scripts/builtin.d.tl:1388
Notes
Called with the name of a triggered input action.
Builtin.SelectorParam¶
record base/tealdef/scripts/builtin.d.tl:1392
record SelectorParam
Notes
Parameters of the entity selector in the 3D view.
Fields
| Name | Type | Description |
|---|---|---|
lineViewerSupport |
boolean |
Allow selecting lines drawn by the line viewer. |
stopOnMenuBack |
boolean |
End the selection with the back input action. |
selectionColor |
Vec4f |
Highlight colour of the selection. |
selectionOutlineColor |
Vec4f |
Outline colour of the selection. |
selectionOutlineColor1 |
Vec4f |
Second outline colour of the selection. |
circleBorderColor |
Vec4f |
Border colour of the terrain circle. |
circleFillColor |
Vec4f |
Fill colour of the terrain circle. |
circleBorderWidth |
number |
Border width of the terrain circle. |
circleAnimEasing |
Easing |
Easing of the circle animation. |
circleAnimDuration |
number |
Duration of the circle animation. |
crosshairColor |
Vec4f |
Colour of the crosshair. |
Functions
onSelect(entity : Engine.Entity, indices : {integer}, details : Gui.SelectionDetails) : boolean base/tealdef/scripts/builtin.d.tl:1393
Notes
Called when an entity is selected.
Returns boolean
onSelectSecondary(entity : Engine.Entity, indices : {integer}, details : Gui.SelectionDetails) : boolean base/tealdef/scripts/builtin.d.tl:1394
Notes
Called when an entity is selected with the secondary button.
Returns boolean
onHover(entity : Engine.Entity, indices : {integer}, details : Gui.SelectionDetails) base/tealdef/scripts/builtin.d.tl:1395
Notes
Called when the cursor moves over an entity.
filter(entity : Engine.Entity) base/tealdef/scripts/builtin.d.tl:1396
Notes
Returns false for entities that cannot be selected.
terminalFilter(stationGroupEntity : Engine.Entity, stationTerminal : StationTerminal, flatTerminalIndex : integer) base/tealdef/scripts/builtin.d.tl:1397
Notes
Returns false for station terminals that cannot be selected.
onProcessMouseEvent(evt : Gui.Mouse.Event) : boolean base/tealdef/scripts/builtin.d.tl:1400
Notes
Called with mouse events before the selector handles them.
Returns boolean
Builtin.FullScreenComponentParam¶
record base/tealdef/scripts/builtin.d.tl:1417
record FullScreenComponentParam<T>
Notes
Content of a full-screen overlay.
Fields
| Name | Type | Description |
|---|---|---|
recipe |
Recipe<T> |
Recipe of the overlay content. |
param |
T |
Parameter passed to the recipe. |
Builtin.LineViewerParam¶
record base/tealdef/scripts/builtin.d.tl:1424
record LineViewerParam
Notes
Parameters of the line viewer, which draws lines and stops in the 3D view.
Fields
| Name | Type | Description |
|---|---|---|
selectable |
boolean |
Lines can be selected. |
carriers |
{Carrier} |
Carriers whose lines are drawn. |
highlightedLine |
Engine.Entity |
Line to highlight. |
highlightedLineStop |
integer |
Stop of the highlighted line to highlight. |
highlightedLineWaypoint |
integer |
Waypoint of the highlighted line to highlight. |
showTerminals |
boolean |
Draw the station terminals. |
highlightedTerminal |
StationTerminal |
Terminal to highlight. |
maxSnapFactorView |
number |
|
maxSnapFactorWorld |
number |
|
fadingMinHeight |
number |
|
fadingDeltaHeight |
number |
|
highlightedTerminalNodes |
{{Engine.Entity, StationTerminal}} |
Terminals to highlight, as {station, terminal} pairs. |
showLineTerminalsFor |
Engine.Entity |
Line whose terminals are shown. |
highlightStop |
Gui.SelectionDetails.Stop |
Stop to highlight. |
highlightWaypoint |
{Engine.Entity, integer, integer} |
waypoint to highlight (line entity, zero-based stopIndex, waypoint tag) |
snapPreview |
Gui.SelectionDetails.TransportNetworkEdge |
|
showLines |
{Builtin.Type.LineVisualization} |
Lines to draw, with transparency. |
hiddenLinesTransparent |
boolean |
default is true --> if set to false, the lines are completely invisible (refers to all the lines filtered away with "showLines") |
continuousRenderLine |
Engine.Entity |
|
preferLineOverTransportNetworkEdge |
boolean |
default is true --> if set to false, it enables building waypoints on (already existing) lines |
Builtin.ProposalViewerParam¶
record base/tealdef/scripts/builtin.d.tl:1450
record ProposalViewerParam
Notes
Parameters of the proposal viewer, which previews a building proposal in the 3D view.
Fields
| Name | Type | Description |
|---|---|---|
simpleProposal |
SimpleProposal |
Proposal to preview (simple form). |
proposal |
Proposal |
Proposal to preview. |
controlPointInfo |
Type.ControlPointInfo |
Control point to show. |
entityForRefundableContext |
Engine.Entity |
|
proposalId |
string |
Id of the proposal. |
Functions
onCreateProposalData(ProposalData, Proposal) base/tealdef/scripts/builtin.d.tl:1454
Notes
Called with the processed proposal data.
Builtin.MapPreviewCompParam¶
record base/tealdef/scripts/builtin.d.tl:1459
record MapPreviewCompParam
Notes
Parameters of the map preview of the new-game and map editor screens.
Fields
| Name | Type | Description |
|---|---|---|
mapColoring |
PreviewColoring |
Colouring of the preview. |
showMapSize |
boolean |
Show the map size. |
showTownAndIndustryCount |
boolean |
Show the numbers of towns and industries. |
showBiomesColors |
boolean |
Colour the biomes. |
inputMap |
GameMap |
Map to show. |
mode |
any |
HeighmapGenerationMode | TownIndustryGenerationMode |
locationsConfig |
BaseConfig.Locations |
Town and industry settings for the preview. |
economy |
string |
Economy setting. |
initialMap |
GameMap |
use this when creating for the 1st time (instead of recomputing) |
Functions
onReady(map : GameMap, feedback : {string}) base/tealdef/scripts/builtin.d.tl:1468
Notes
Called when the preview map is ready.
onTownConnectionsChanged({{integer, integer}}) base/tealdef/scripts/builtin.d.tl:1469
No description in the game files yet.
Builtin.NodeViewerParam¶
record base/tealdef/scripts/builtin.d.tl:1475
record NodeViewerParam
No description in the game files yet.
Fields
| Name | Type | Description |
|---|---|---|
nodeConfig |
{Engine.Entity : {integer, Vec4f}} |
Builtin.ICompParam¶
interface base/tealdef/scripts/builtin.d.tl:1488
interface ICompParam
Notes
Parameters of an entity component widget.
Fields
| Name | Type | Description |
|---|---|---|
entity |
Engine.Entity |
The entity. |
Builtin.RailroadCrossingCompParam¶
record base/tealdef/scripts/builtin.d.tl:1492
record RailroadCrossingCompParam is ICompParam
Notes
Parameters of the railroad crossing widget.
Builtin.SignalCompParam¶
record base/tealdef/scripts/builtin.d.tl:1494
record SignalCompParam is ICompParam
Notes
Parameters of the signal widget.
Builtin.ReactAdapterHost¶
record base/tealdef/scripts/builtin.d.tl:1502
record ReactAdapterHost
No description in the game files yet.
Builtin.ReactAdapterHostEventParam¶
record base/tealdef/scripts/builtin.d.tl:1504
record ReactAdapterHostEventParam
No description in the game files yet.
Used in the base game: 1 time in 1 file
base/content/gui/gui/main/game.tl:208
Fields
| Name | Type | Description |
|---|---|---|
component |
ReactAdapterHost |
|
type |
string |
|
param |
any |
Builtin.ReactAdapterGuestContainerAPI¶
record base/tealdef/scripts/builtin.d.tl:1510
record ReactAdapterGuestContainerAPI
No description in the game files yet.
Functions
add(host : ReactAdapterHost, recipeFn : Recipe, recipeParam : any) base/tealdef/scripts/builtin.d.tl:1511
No description in the game files yet.
remove(host : ReactAdapterHost) base/tealdef/scripts/builtin.d.tl:1512
No description in the game files yet.