API ReferenceGE Extensionsflowgraphnodesuiimgui
ImGui Vehicle Selector
- **Node Name:** `im Vehicle Selector`
Overview
- Node Name:
im Vehicle Selector - Category:
once_instant - File:
extensions/flowgraph/nodes/ui/imgui/imVehicleSelect.lua
Displays an ImGui vehicle selection window that lets the user browse models, configs, and paint options. Outputs the selected vehicle details when the user clicks "Select".
Pin Schema
Output Pins
| Pin | Type | Hidden | Description |
|---|---|---|---|
selected | flow | no | Fires once when the Select button is pressed |
model | string | no | Model name of the selected vehicle |
config | string | no | Config name of the selected vehicle |
configPath | string | no | Full config path of the selected vehicle |
paintName1 | string | yes | First paint layer |
paintName2 | string | yes | Second paint layer |
paintName3 | string | yes | Third paint layer |
Node Data
| Field | Default | Description |
|---|---|---|
enableConfigs | true | Show config selection |
enablePaints | false | Show paint selection |
enableCustomConfig | false | Allow custom config paths |
Internals
| Field | Purpose |
|---|---|
self.util | Instance of editor/util/vehicleSelectUtil - provides the widget and selection state |
self.open | Whether the window is currently displayed |
self.done | Whether selection is complete |
self.refresh | Flag to refresh output pin values |
How It Works
_executionStarted()- Creates avehicleSelectUtilinstance with the node's config flags. Resets state.workOnce()- Setsopen = trueand triggers a refresh.work()- Whileopen, callsdisplayWindow()each frame.displayWindow()- Renders a 480×300 ImGui window:- Calls
self.util:widget()to draw the vehicle browser. - On change, copies model/config/paint values to output pins.
- Select button - closes window, fires
selectedflow output. - Reset button - resets all selections via
self.util:resetSelections().
- Calls
onNodeReset()- Closes the window and resets all state.
Lua Code Example
-- The node uses vehicleSelectUtil internally:
local util = require("/lua/ge/extensions/editor/util/vehicleSelectUtil")("My Selector##1")
util.enableConfigs = true
util.enablePaints = false
-- In an ImGui draw loop:
if util:widget() then
print("Selected model:", util.model)
print("Selected config:", util.config)
endKey Dependencies
editor/util/vehicleSelectUtil- Reusable ImGui vehicle browser widgetui_imgui- BeamNG's ImGui binding layer
See Also
- im Dialogue (Flowgraph Node) - Related reference
- im Simple Text Box (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide