API ReferenceGE Extensionsflowgraphnodesui
Set UI Race Laps (Flowgraph Node)
- **Node Name:** `Set UI Race Laps`
Overview
- Node Name:
Set UI Race Laps - Category:
repeat_instant - File:
extensions/flowgraph/nodes/ui/raceLaps.lua - Author: BeamNG
Sets the UI race laps display to show the current and maximum lap count. Clears the display when no value is provided.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
cur | number | Current lap. If not set, clears the app |
max | number | Maximum number of laps |
How It Works
work()- Called every frame:- If
curis set:- Triggers
guihooks.trigger('RaceLapChange', {current, count}). - Sets generic mission data via
ui_apps_genericMissionData.setData()with:title:"missions.missions.general.lap"txt:"cur / max"formatted stringcategory:"raceLaps"style:"text"order:110
- Triggers
- If
curis nil:- Triggers
guihooks.trigger('RaceLapClear'). - Clears the generic mission data for category
"raceLaps".
- Triggers
- If
Lua Code Example
-- Show lap 2 of 5:
guihooks.trigger('RaceLapChange', { current = 2, count = 5 })
ui_apps_genericMissionData.setData({
title = "missions.missions.general.lap",
txt = "2 / 5",
category = "raceLaps",
style = "text",
order = 110,
})
-- Clear lap display:
guihooks.trigger('RaceLapClear')
ui_apps_genericMissionData.setData({
category = "raceLaps",
clear = true,
})Key Dependencies
guihooks.trigger('RaceLapChange', ...)- Updates the lap counter HUDguihooks.trigger('RaceLapClear')- Resets the lap counter HUDui_apps_genericMissionData.setData()- Generic mission data display system
See Also
- Medal / Auto Medal (Flowgraph Node) - Related reference
- Clear Messages (Flowgraph Node) - Related reference
- Context Translation (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide