API ReferenceGE Extensionsflowgraphnodesui
Three Element Select (Flowgraph Node)
- **Node Name:** `Three Element Select`
Overview
- Node Name:
Three Element Select - Category:
once/singleActive - File:
extensions/flowgraph/nodes/ui/threeElementSelect.lua
Presents the player with a choice of three elements (typically vehicles), each with an image, name, and description. Outputs flow for whichever option is picked.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Inflow for this node |
reset | flow (impulse) | Resets this node |
description | string/table | Subtext of the menu |
veh1image | string | Image path for element 1 |
veh1name | string | Name of element 1 |
veh1desc | string | Description of element 1 |
veh2image | string | Image path for element 2 |
veh2name | string | Name of element 2 |
veh2desc | string | Description of element 2 |
veh3image | string | Image path for element 3 |
veh3name | string | Name of element 3 |
veh3desc | string | Description of element 3 |
Output Pins
| Pin | Type | Description |
|---|---|---|
pick1 | flow | Element 1 was selected |
pick2 | flow | Element 2 was selected |
pick3 | flow | Element 3 was selected |
Internals
Key Methods
| Method | Description |
|---|---|
init() | Initializes open and done flags |
openDialogue() | Builds the three-element data and triggers the UI state change |
closeDialogue() | Clears the open/active state |
buttonPushed(action) | Sets the matching output pin to true |
getCmd(action) | Returns a Lua command string to call buttonPushed from the UI |
work() | Handles reset logic and opens the dialogue when flow is active |
_executionStarted() | Resets all output pins and state |
_executionStopped() | Closes dialogue and resets |
How It Works
- When
flowbecomes active,openDialogue()builds a data table with three elements (image, name, desc, pickButtonCode). - Each element's
pickButtonCodeis a Lua string that callsbuttonPushed('pickN')viacore_flowgraphManager.getManagerGraphNode(). - Triggers
guihooks.trigger('ChangeState', {state = 'menu.threeElementSelect', params = {data = data}}). - When the player picks an element, the corresponding
pick1/pick2/pick3output fires. - The
resetimpulse closes the dialogue and resets all state.
Usage Example
-- The UI state 'menu.threeElementSelect' receives data like:
{
description = "Choose your vehicle",
elements = {
{ image = "/vehicles/etk800/default.png", name = "ETK 800", desc = "Sedan", pickButtonCode = "..." },
{ image = "/vehicles/vivace/default.png", name = "Vivace", desc = "Coupe", pickButtonCode = "..." },
{ image = "/vehicles/pickup/default.png", name = "D-Series", desc = "Truck", pickButtonCode = "..." },
}
}Key Dependencies
guihooks.trigger('ChangeState', ...)- opens the selection menucore_flowgraphManager.getManagerGraphNode()- used for UI-to-node callbackcore_input_bindings- listed dependency
See Also
- Medal / Auto Medal (Flowgraph Node) - Related reference
- Clear Messages (Flowgraph Node) - Related reference
- Context Translation (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide