API ReferenceGE Extensionsflowgraphnodesui
Set UI Layout (Flowgraph Node)
- **Node Name:** `Set UI Layout`
Overview
- Node Name:
Set UI Layout - Category:
once_instant - File:
extensions/flowgraph/nodes/ui/setUILayout.lua
Sets the UI app layout and game state. Controls which app layout is displayed (scenario, freeroam, quickrace, etc.) and optionally persists the layout after the flowgraph stops.
Pin Schema
Input Pins
| Pin | Type | Default | Hidden | Description |
|---|---|---|---|---|
flow | flow | - | no | Inflow |
reset | flow (impulse) | - | no | Resets the node to allow re-triggering |
layout | string / table (layoutData) | "scenario" | no | Layout name (e.g. scenario, freeroam) |
menu | string | "scenario" | no | Menu state name |
keepLayout | bool | - | no | If set, layout persists after FG stops |
gameStateName | string | "scenario" | yes | Game state name |
appContainerContext | string | - | yes | Gameplay app container context to activate |
Output Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Outflow |
Node Data
| Field | Default | Description |
|---|---|---|
useFreeroamMenuWhenUnrestricted | true | Auto-switches to freeroam menu if scenario restrictions are off |
How It Works
postInit()- Populates hardcoded template options for layout, menu, and appContainerContext pins.workOnce()- Sets the game state:- If restrictions are off and
useFreeroamMenuWhenUnrestrictedis true, forcesfreeroammenu. - Calls
self.mgr.modules.ui:setGameState(gameStateName, layout, menu). - Calls
self.mgr.modules.ui:keepGameState(keepLayout)to persist if requested. - If
appContainerContextis set, shows that app viaui_gameplayAppContainers.showApp().
- If restrictions are off and
onClientPostStartMission()- Re-applies the game state (workaround for the game overriding state on mission start).onUiChangedState(cur, prev)- If active and the layout isquickraceScenario, triggers quick race mode and hotlapping reset on menu state.
Lua Code Example
-- What the node does internally:
self.mgr.modules.ui:setGameState("scenario", "scenario", "scenario")
self.mgr.modules.ui:keepGameState(false)
-- Optionally show a specific app container:
ui_gameplayAppContainers.showApp('gameplayApps', 'someAppId')Key Dependencies
self.mgr.modules.ui:setGameState()- Flowgraph UI module for game state managementself.mgr.modules.ui:keepGameState()- Persist layout beyond FG lifetimeui_gameplayAppContainers.showApp()- App container visibilitysettings.getValue('restrictScenarios')- Scenario restriction check
See Also
- Medal / Auto Medal (Flowgraph Node) - Related reference
- Clear Messages (Flowgraph Node) - Related reference
- Context Translation (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide