Gameplay Selector Tiles
Main tile processing module - handles path-based navigation, grouping, clustering, filtering, and sorting for the gameplay grid.
Main tile processing module - handles path-based navigation, grouping, clustering, filtering, and sorting for the gameplay grid.
Overview
ui_gameplaySelector_tiles is the core tile processing engine. It routes navigation paths to handlers, groups items by mode (system/type/level), applies clustering, manages special groups (favourites/recent), and sorts results for the UI.
Extension path: lua/ge/extensions/ui/gameplaySelector/tiles.lua
Dependencies: Dynamically discovers tile generators in tileGenerators/ folder.
Exports (M)
| Function | Signature | Description |
|---|---|---|
getTiles | (path, backend) | Main entry - returns grouped tile data for a navigation path. |
getUiData | () | Returns backend name, group/sort functions, and sorting module. |
emptyProfiler | () | Returns a no-op profiler instance. |
Internals
Path Routing
| Path Type | Handler | Description |
|---|---|---|
allGameplay | handleAllGameplayPath | Full grid with grouping + clustering |
detailGameplay | handleDetailGameplayPath | Drilled-in view for a specific cluster |
All Gameplay Path
- Filters items via
backend.passesFilters() - Groups items by
groupMode(system, type, level, none) - Creates special Favourites/Recent groups if enabled
- Applies clustering within each group via
tileClustering - Sorts tiles per group using
tileSorting - Sorts groups by system order or alphabetically
-- Group mode determines the primary grouping key
local groupModeFunctions = {
Type = function(item) return item.type or "Other..." end,
System = function(item) return item.system or "Other..." end,
-- ...
}Special Groups (Favourites & Recent)
Display modes for special groups:
hidden- not shownreducedClusters- items added directly to the groupcompleteClusters- cluster tiles duplicated into the groupunclustered- individual items without clustering
Recent groups are limited to 15 tiles and sorted by recency.
Detail Gameplay Path
Handles drill-down into a specific cluster. Path format:
detailGameplay / clusterMode / clusterKey / groupKey / groupName / metaModeItems are filtered by cluster/group membership plus optional Favourites/Recent meta mode. A default tile is selected (default spawnpoint or first item).
Tile Generator Discovery
Generator files are auto-discovered from tileGenerators/ and registered as dependencies:
local generatorFiles = FS:findFiles('lua/ge/extensions/ui/gameplaySelector/tileGenerators/', '*.lua', 1)How It Works
- UI calls
getTiles({keys = {"allGameplay"}}, backend) - Backend reference is set, clustering module gets backend for favourite queries
- Items are filtered → grouped → clustered → tiles created
- Each group's tiles are sorted (automatic, name, or date)
- Groups are sorted and empty groups removed
- Result is a list of
{key, label, tiles, order}groups for the grid UI
Additional Exports
The following exports are available but not yet documented in detail:
M.dependenciesM.getTilesM.getUiData