API ReferenceGE ExtensionsuitopBar
Top Bar Config
Static configuration of top bar navigation entries and their flags.
Static configuration of top bar navigation entries and their flags.
Overview
ui_topBar_config defines the entries (buttons) shown in the game's top navigation bar. Each entry specifies a label, icon, target UI state, visibility flags, and ordering. Used by ui_topBar to determine what to display.
Extension path: lua/ge/extensions/ui/topBar/config.lua
Exports (M)
| Field | Type | Description |
|---|---|---|
TopBarEntryType | table | Entry type constants (currently only MAIN). |
TopBarEntries | table | Map of entry ID → entry definition. |
Entry Structure
{
id = "bigmap",
label = "ui.dashboard.bigmap", -- translation key
icon = "mapWithEmitter",
targetState = "menu.bigmap", -- UI state to navigate to
flags = {TopBarEntryFlags.IN_GAME_ONLY, ...},
substate = "menu.mods", -- optional prefix for active-item matching
order = 3, -- sort order (lower = left)
}Default Entries
| ID | Label Key | Target State | Order | Notable Flags |
|---|---|---|---|---|
mainmenu | ui.dashboard.menu | menu.mainmenu | 1 | IN_GAME_ONLY |
career | ui.playmodes.career | menu.careerPause | 2 | IN_GAME_ONLY, CAREER_ONLY |
bigmap | ui.dashboard.bigmap | menu.bigmap | 3 | NO_SCENARIO, NO_MISSION, NO_GARAGE |
mods | ui.dashboard.mods | menu.mods.local | 5 | NO_SCENARIO, NO_MISSION, NO_GARAGE |
vehicles | ui.dashboard.vehicles | menu.vehiclesnew | 6 | NO_SCENARIO, NO_MISSION, NO_GARAGE, NO_CAREER |
vehicleconfig | ui.dashboard.vehicleconfig | menu.vehicleconfig.parts | 7 | NO_SCENARIO, NO_MISSION, NO_GARAGE, NO_CAREER |
environment | ui.dashboard.environment | menu.environment | 8 | NO_SCENARIO, NO_MISSION, NO_GARAGE, NO_CAREER |
photomode | ui.dashboard.photomode | menu.photomode | 9 | NO_GARAGE |
appedit | ui.dashboard.appedit | menu.appedit | 10 | NO_SCENARIO |
options | ui.dashboard.options | menu.options.graphics | 11 | IN_GAME_ONLY |
Entry Flags
| Flag Constant | Meaning |
|---|---|
IN_GAME_ONLY | Only visible when a level is loaded. |
CAREER_ONLY | Only in career mode. |
NO_CAREER | Hidden in career mode. |
NO_GARAGE | Hidden in garage mode. |
NO_MISSION | Hidden during active missions. |
NO_SCENARIO | Hidden during scenarios. |
GARAGE_ONLY | Only in garage mode. |
How It Works
ui_topBar imports TopBarEntries and uses it as the source of truth for navigation items. The flags are evaluated by ui_topBar.updateVisibleItems() against the current game state to determine which entries appear.
Lua Examples
-- Access entries from another extension
local config = extensions.ui_topBar_config
local bigmap = config.TopBarEntries.bigmap
print(bigmap.targetState) -- "menu.bigmap"
-- Modify an entry at runtime (via ui_topBar)
extensions.ui_topBar.updateEntry("vehicles", {
id = "vehicles", label = "My Vehicles", icon = "car",
targetState = "menu.vehiclesnew", order = 6
})Additional Exports
The following exports are available but not yet documented in detail:
M.TopBarEntriesM.TopBarEntryType