API ReferenceGE ExtensionsuigameplaySelectortileGenerators
Scenario Tiles Generator
Tile generator for legacy scenario entries in the gameplay selector grid.
Tile generator for legacy scenario entries in the gameplay selector grid.
Overview
ui_gameplaySelector_tileGenerators_scenarioTiles provides tiles and detail panels for the deprecated scenario system. Scenarios are loaded from scenario_scenariosLoader and displayed in the "Scenarios (deprecated)" system group.
Extension path: lua/ge/extensions/ui/gameplaySelector/tileGenerators/scenarioTiles.lua
Exports (M)
| Hook Handler | Signature | Description |
|---|---|---|
onGameplaySelectorGetTiles | (items, backend) | Adds scenario tiles to the items list. |
onGameplaySelectorGetDetails | (itemDetails, details, buttonInstance, backend) | Detail panel with scenario specs and start button. |
Internals
Tile Structure
{
name = translate(scenario.name),
system = "Scenarios (deprecated)",
type = "Scenario (deprecated)",
level = translate(core_levels.getLevelTitle(scenario.levelName)),
isLegacy = true,
key = "scenario_<sourceFile>",
order = -tonumber(scenario.date),
validBackends = {gameplaySelector = true},
}Detail Panel Specifications
Includes: difficulty, authors, creation date, map, multiplayer info, goals list, and a legacy notice ("Scenario system is outdated").
Tags
- Official (beamNG icon), Auxiliary (bug icon), Mod info (puzzle icon)
Start Button
buttonInstance.addButton(function()
backend.trackRecent(itemDetails.key)
scenario_scenariosLoader.start(scenario)
end, {
label = "Start Scenario",
primary = true,
isDoubleClickAction = true,
waitForLoadingScreen = true,
})How It Works
- Hook collects scenarios from
scenario_scenariosLoader.getList(nil, false, true) - Each scenario produces a tile with level/system metadata
- Scenarios are clustered by level in automatic mode
- Detail panel loads full scenario data and displays specs
- "Start Scenario" button launches the scenario and tracks recent usage
Additional Exports
The following exports are available but not yet documented in detail:
M.onGameplaySelectorGetDetailsM.onGameplaySelectorGetTiles