API ReferenceGE Extensionsflowgraphnodesui
End Screen (Flowgraph Node)
- **Node Name:** `End Screen`
Overview
- Node Name:
End Screen - Category:
once_instant - File:
extensions/flowgraph/nodes/ui/endScreen.lua
Shows the scenario/mission end screen with customizable buttons, stats, medals, and portraits. Triggers the scenario-end UI state.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
title | string | Title of the menu |
text | string/table | Subtext or multi-description |
progress | string/table | Progress display string |
timeStr | string/number | Time display (hidden) |
successString | string | Overhead text on success (hidden) |
failString | string | Overhead text on fail (hidden) |
failed | bool | Whether the player failed (hidden) |
medal | string | Awarded medal: "wood", "bronze", "silver", "gold" (hidden) |
autoPoints | bool | Auto-compute total score from stats (hidden) |
points | number | Player's points (hidden) |
maxPoints | number | Maximum reachable points (hidden) |
portraitSuccess | string | Portrait shown on success (hidden) |
portraitFail | string | Portrait shown on fail (hidden) |
stats | table (endStats) | Stats data from End Stats node |
change | table | Aggregate change from the attempt |
attempt | table | Attempt data |
progressKey | string | Key for the attempt |
Dynamic Pins
Custom button pins are created via the editor. Each button adds:
- Input:
string- button label text - Output:
flow- fires when that button is clicked
Internals
Key Methods
| Method | Description |
|---|---|
workOnce() | Opens the end screen dialogue |
openDialogue() | Builds stats data and triggers ChangeState to scenario-end |
closeDialogue() | Triggers ChangeState back to play |
buttonPushed(action) | Sets the matching output flow pin and closes the dialogue |
updateButtons() | Rebuilds dynamic button pins and re-links existing connections |
onResetGameplay() | Auto-closes if retry button is enabled |
drawCustomProperties() | Editor UI for adding/removing/renaming buttons |
Data Properties
| Property | Default | Description |
|---|---|---|
data.includeScenarioButton | false | Add a "Scenarios" button |
data.includeRetryButton | true | Add a "Retry" button |
How It Works
- When triggered,
workOnce()callsopenDialogue(). openDialogue()assembles astatsDatatable with title, text, time, medal, points, buttons, and portrait info.- If the flowgraph has an associated mission activity, it also builds
missionDatawith progress, leaderboard, and star info. - It triggers
guihooks.trigger('ChangeState', {state = 'scenario-end', params = {...}}). - Custom buttons call back via
core_flowgraphManager.getManagerGraphNode(...)to invokebuttonPushed(). - When a button is pushed, the corresponding output flow pin fires and the dialogue closes.
Usage Example
-- The node builds and triggers data like:
guihooks.trigger('ChangeState', {
state = 'scenario-end',
params = {
stats = {
title = "Race Complete",
text = "You finished in 1st place!",
time = "01:23.45",
overall = { failed = false, medal = "gold", points = 100, maxPoints = 100 },
buttons = {
{ label = "Retry", cmd = 'extensions.hook("onResetGameplay")' },
{ label = "Continue", cmd = '...' },
},
},
portrait = { success = "/ui/portraits/happy.png" },
}
})Key Dependencies
guihooks.trigger('ChangeState', ...)- transitions the UI stategameplay_missions_missions- mission lookup for next-mission buttonsgameplay_missions_progress- leaderboard and progress formattingcore_flowgraphManager.getManagerGraphNode()- button callback routing
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