API ReferenceGE Extensionsflowgraphnodesuiimgui
ImGui Dialogue
- **Node Name:** `im Dialogue`
Overview
- Node Name:
im Dialogue - Category:
repeat_instant - File:
extensions/flowgraph/nodes/ui/imgui/imDialogue.lua
Opens an ImGui window with a title, description text, and customizable buttons. Each button triggers a separate output flow. Only one instance should be active at a time (singleActive behaviour).
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
title | string | Window title |
description | string | Description text displayed in the window |
Dynamic Pins (per button)
For each button option (default: "accept", "decline"):
- Input:
string- custom label for the button (if nil, uses the option name) - Output:
flow- fires when that button is clicked
Internals
Data Properties
| Property | Default | Description |
|---|---|---|
data.wrapSize | 500 | Text wrap width in pixels |
Key Methods
| Method | Description |
|---|---|
workOnce() | Sets self.open = true to show the dialogue |
work() | Draws the ImGui window with text and buttons when open |
drawCustomProperties() | Editor UI for adding/removing/renaming buttons |
updateButtons() | Rebuilds dynamic in/out pins and re-links connections |
_executionStopped() | Closes the dialogue |
onNodeReset() | Closes the dialogue |
_onSerialize(res) | Saves button options |
_onDeserialized(data) | Restores button options and rebuilds pins |
Button Management
Buttons are managed as a list of string names in self.options. The editor allows:
- Renaming buttons via text input
- Adding buttons with the "add" button
- Removing the last button with "rem"
- Clearing a button by setting its name to empty
How It Works
workOnce()opens the dialogue by settingself.open = true.- Each frame while open,
work()draws an ImGui window with:- Title bar using the
titleinput - Wrapped description text (wrap width from
data.wrapSize) - One button per option, labeled from the corresponding string input pin
- Title bar using the
- When a button is clicked, the dialogue closes and the matching output flow pin fires.
- The
closed()method is called on button press (inherited behaviour).
Usage Example
-- Default setup with accept/decline:
-- [im Dialogue (title="Confirm?", description="Are you sure?")]
-- → (accept) → [Do Action]
-- → (decline) → [Cancel]
-- Under the hood:
im.Begin("Confirm?##42", im.BoolPtr(true))
im.PushTextWrapPos(im.GetCursorPosX() + 500)
im.TextWrapped("Are you sure?")
im.PopTextWrapPos()
if im.Button("Yes##42-1") then
-- close and fire accept
end
if im.Button("No##42-2") then
-- close and fire decline
end
im.End()Key Dependencies
ui_imgui- ImGui bindingsffi- for reading ImGui text input buffers
See Also
- im Simple Text Box (Flowgraph Node) - Related reference
- im Vehicle Selector (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide