Level Tiles Generator
Tile generator for freeroam level/spawnpoint entries in the gameplay selector grid.
Tile generator for freeroam level/spawnpoint entries in the gameplay selector grid.
Overview
ui_gameplaySelector_tileGenerators_levelTiles provides per-spawnpoint tiles for each level. Each spawnpoint appears as a separate tile in the Freeroam system group, with detail panels showing level specifications and freeroam/configuration buttons.
Extension path: lua/ge/extensions/ui/gameplaySelector/tileGenerators/levelTiles.lua
Exports (M)
| Hook/Function | Signature | Description |
|---|---|---|
onGameplaySelectorGetTiles | (items) | Adds spawnpoint tiles from all levels. |
onGameplaySelectorGetDetails | (itemDetails, details, buttonInstance, backend) | Detail panel with level specs and buttons. |
onFilterCustomLevelTiles | (item, searchText, result) | Extended search across biome, features, roads, country. |
setAlwaysShowDialogue | (backendName, newValue) | Toggles default freeroam action between start/configure. |
openLevelConfigurationPopup | (levelData) | Opens the level configuration popup for a given level. |
onFreeroamSelectorOpenedWithItemDetails | (...) | Hook - handles freeroam selector opened with item details. |
Internals
Tile Structure
Each spawnpoint produces a tile:
{
name = "Spawn Name (Level Title)",
system = "Freeroam",
type = "Freeroam Spawnpoint",
levelName = level.levelName,
isDefaultSpawnPoint = true/false,
validBackends = {freeroamSelector = true, gameplaySelector = false},
key = "spawnPoint_<levelName>_<objectName>",
filterHook = "onFilterCustomLevelTiles",
}Note: Level tiles set gameplaySelector = false by default - they're primarily for the freeroam selector.
Detail Panel
Includes:
- Specifications: size (metric/imperial), biome, roads, suitability, features, country
- Tags: official, Camshaft Software, auxiliary, mod info
- Buttons: "Start Freeroam" and "Configure" - primary action depends on
defaultFreeroamActiondisplay setting
-- Start button calls:
freeroam_freeroam.startFreeroamByName(levelName, spawnPointObjectName)
-- Configure button opens:
freeroam_freeroamConfigurator.setLevel(levelName, spawnPointObjectName)
guihooks.trigger("ChangeState", "menu.freeroamconfigurator")Custom Search
The onFilterCustomLevelTiles hook extends text search to check level biome, suitability, features, roads, and country fields.
How It Works
onGameplaySelectorGetTilesiterates all levels and their spawnpoints- Each spawnpoint becomes a tile with the default spawnpoint flagged
- Tiles are typically clustered by level name in the gameplay selector
- Detail panel shows level info with Start/Configure buttons
- Custom search hook enables filtering by level metadata beyond just name
Additional Exports
The following exports are available but not yet documented in detail:
M.onFilterCustomLevelTilesM.onFreeroamSelectorOpenedWithItemDetailsM.onGameplaySelectorGetDetailsM.onGameplaySelectorGetTilesM.openLevelConfigurationPopupM.setAlwaysShowDialogue