API ReferenceGE Extensionsflowgraphnodesui
Select Buttons (Flowgraph Node)
- **Node Name:** `Select Buttons`
Overview
- Node Name:
Select Buttons - Category:
once_instant - File:
extensions/flowgraph/nodes/ui/selectButtons.lua
Shows the user a dialogue with a configurable number of buttons. Each button has its own flow output pin. Buttons with empty string inputs are hidden. Only one instance can be active at a time.
Pin Schema
Input Pins
| Pin | Type | Hidden | Default | Description |
|---|---|---|---|---|
altMode | bool | yes | false | Aligns popup to the lower part of the screen |
title | string | no | - | Title of the dialogue |
description | string / table (multiTranslationObject) | no | - | Description text |
hideApps | bool | yes | false | Hides apps while dialogue is active |
| (dynamic) | string | no | - | Button label text (one per button) |
Output Pins (Dynamic)
Each button name gets a corresponding flow output pin. Default buttons are accept and decline.
Internals
| Field | Purpose |
|---|---|
self.open | Whether the dialogue is currently displayed |
self.options | Array of button names (default: {"accept", "decline"}) |
self.oldOptions | Previous button names for pin management |
How It Works
workOnce()- CallsopenDialogue().openDialogue()- Builds a buttons table fromself.options:- Skips buttons whose input pin value is empty or nil.
- Each button gets an
action,text, andcmd(Lua callback string). - Uses
ui_missionInfo.openDialogue()to show the dialogue. - Optionally hides apps via
guihooks.trigger('ShowApps', false).
buttonPushed(action)- Called from UI callback. Sets the matching output pin totrueand closes the dialogue.closeDialogue()- Callsui_missionInfo.closeDialogue()and re-shows apps if they were hidden.drawCustomProperties()- Editor UI for adding/removing/renaming buttons.updateButtons()- Dynamically creates/removes input string + output flow pins while preserving links.
Button Action Mapping
The first two buttons map to 'accept' and 'decline' actions for the UI styling. Additional buttons use their name as the action.
Serialization
_onSerialize()- Savesoptionsarray._onDeserialized()- Restores options (defaults to{"accept", "decline"}), rebuilds pins.
Lua Code Example
-- What the node does internally:
ui_missionInfo.openDialogue({
title = "Choose Your Path",
typeName = "Do you want to take the shortcut?",
altMode = false,
buttons = {
{ action = "accept", text = "Yes, take it!", cmd = '...' },
{ action = "decline", text = "No, full route", cmd = '...' },
}
})
-- Close:
ui_missionInfo.closeDialogue()Key Dependencies
ui_missionInfo.openDialogue()/closeDialogue()- Mission info dialogue systemguihooks.trigger('ShowApps', bool)- App visibility togglecore_flowgraphManager.getManagerGraphNode()- Node callback from UI
Previously Undocumented (Added by Audit)
C:getCmd(action)- Function handling getCmd logic
See Also
- Medal / Auto Medal (Flowgraph Node) - Related reference
- Clear Messages (Flowgraph Node) - Related reference
- Context Translation (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide