Skip to content

layers_button_ridge

Source: base/tealdef/gui/layers/layers_button_ridge.d.tl

Notes

The layers button and its expandable ridge of layer buttons (terrain, towns, traffic, flows, noise, pollution, HUD filters), plus the parameter types shared by all layer windows.

LayersButtonRidge

record global base/tealdef/gui/layers/layers_button_ridge.d.tl:3

global record LayersButtonRidge

Notes

The layers button with its ridge of layer buttons and the types shared by the layer windows.

Fields

Name Type Description
ExpandableLayerButton Recipe<LayerButtonsParam> Recipe of the layers button that expands into the ridge of layer buttons.

LayersButtonRidge.LayersMode

enum base/tealdef/gui/layers/layers_button_ridge.d.tl:4

enum LayersMode

Notes

How a layer is opened from the ridge.

Used in the base game: 1 time in 1 file

base/content/gui/gui/layers/layers_button_ridge.tl:163

mode : LayersButtonRidge.LayersMode

Value Description
"StandaloneTool" The layer is pushed as a tool on the tool stack.
"ConstructionMenuAssist" The layer window is opened without pushing a tool, used while the construction menu is active.

LayersButtonRidge.LayerButtonsParam

record base/tealdef/gui/layers/layers_button_ridge.d.tl:8

record LayerButtonsParam

Notes

Parameters of ExpandableLayerButton.

Used in the base game: 1 time in 1 file

base/content/gui/gui/layers/layers_button_ridge.tl:304

local ExpandableLayerButton = react.RegisterRecipe("ExpandableLayerButton", function(param : LayersButtonRidge.LayerButtonsParam) : TreeNodeId

Fields

Name Type Description
layersEnabled {ButtonKey : boolean} Which layer buttons are shown; in the map editor the base game enables only Terrain, Civilization and HUDFilter.
gameCtx GameContext Game GUI context.

LayersButtonRidge.LayerButtonsParam.ButtonKey

enum base/tealdef/gui/layers/layers_button_ridge.d.tl:9

enum ButtonKey

Notes

Keys of the layer buttons in the ridge.

Value Description
"Terrain" Terrain layer.
"Civilization" Towns layer.
"Infrastructure" Infrastructure layer.
"Traffic" Traffic layer (LayerTraffic).
"Satisfaction" Passenger Satisfaction layer (LayerPublicTransport).
"DeliveryOnTime" Cargo Satisfaction layer (LayerCargo).
"PassengerFlow" Passenger Flow layer.
"CargoFlow" Cargo Flow layer (LayerCargoFlow).
"Noise" Noise layer (LayerNoise).
"Pollution" Pollution layer (LayerPollution).
"HUDFilter" HUD Filters window (HUDFilter).

LayersButtonRidge.LayerContentParam

record base/tealdef/gui/layers/layers_button_ridge.d.tl:27

record LayerContentParam is ToolReactUtil.ToolWindowParamPayload<LayerToolParam>

Notes

Parameter of every layer content recipe (the Layer field of the layer modules); carries the LayerToolParam as toolParam.

Used in the base game: 27 times in 12 files

base/content/gui/gui/layers/layer_hud_filter.tl:10

local HUDFilterWindowContent = react.RegisterRecipe("HUDFilterWindowContent", function(param : LayersButtonRidge.LayerContentParam) : TreeNodeId
base/content/gui/gui/layers/layer_terrain.tl:140
local TerrainLayerWindowContent = react.RegisterRecipe("TerrainLayerWindowContent", function(param : LayersButtonRidge.LayerContentParam) : TreeNodeId
base/content/gui/gui/layers/layer_passenger_flow.tl:161
local MobilityLayerWindowContent = react.RegisterRecipe("MobilityLayerWindowContent", function(param : LayersButtonRidge.LayerContentParam) : TreeNodeId
base/content/gui/gui/layers/layer_infrastructure.tl:150
local SpeedLayerWindowContent = react.RegisterRecipe("SpeedLayerWindowContent", function(param : LayersButtonRidge.LayerContentParam) : TreeNodeId
base/content/gui/gui/layers/layers_button_ridge.tl:2
local CivilizationLayer = ug_require "/gui/layers/layer_civilization.tl" as Recipe<LayersButtonRidge.LayerContentParam>
base/content/gui/gui/layers/layer_civilization.tl:76
local TownsLayerWindowContent = react.RegisterRecipe("TownsLayerWindowContent", function(param : LayersButtonRidge.LayerContentParam) : TreeNodeId
… and 6 more files.

Fields

Name Type Description
meta Meta Node meta data; the layer recipes set a tag such as menu.layers.noise on it.

LayersButtonRidge.LayerToolParam

record base/tealdef/gui/layers/layers_button_ridge.d.tl:31

record LayerToolParam is ToolReactUtil.IToolParam

Notes

Tool parameter of an open layer window, created by the ridge for the selected button.

Used in the base game: 6 times in 1 file

base/content/gui/gui/layers/layers_button_ridge.tl:22

local record LayerToolWindowParam is ToolReactUtil.IToolWindowParam<LayersButtonRidge.LayerToolParam>

Fields

Name Type Description
data Data Window title, style class and content recipe of the layer.

Functions

onBack() base/tealdef/gui/layers/layers_button_ridge.d.tl:40

Notes

Called when the layer is left; forwards to the ridge's onBack only if the layer was opened with tool stacking.

switchToPrevious() base/tealdef/gui/layers/layers_button_ridge.d.tl:41

Notes

Switches to the previous layer in the ridge (used for IA_NAV_UP in the layer windows).

switchToNext() base/tealdef/gui/layers/layers_button_ridge.d.tl:42

Notes

Switches to the next layer in the ridge (used for IA_NAV_DOWN in the layer windows).

reduce() base/tealdef/gui/layers/layers_button_ridge.d.tl:43

Notes

Closes the layer (calls onBack and pops the layer tool); in gamepad mode it also closes the ridge.

onMount(ReactRefWrap) base/tealdef/gui/layers/layers_button_ridge.d.tl:44

Notes

Layer windows call it with their own node reference when they mount.

LayersButtonRidge.LayerToolParam.Data

record base/tealdef/gui/layers/layers_button_ridge.d.tl:32

record Data

Notes

What the layer window shows.

Used in the base game: 1 time in 1 file

base/content/gui/gui/layers/layers_button_ridge.tl:159

layerData : LayersButtonRidge.LayerToolParam.Data

Fields

Name Type Description
title string Window title.
class string Style class added to the window.
content Recipe<LayerContentParam> Recipe of the window content, e.g. LayerNoise.Layer.
gameCtx GameContext Game GUI context.

LayersButtonRidge.HudIconUserParam

interface base/tealdef/gui/layers/layers_button_ridge.d.tl:47

interface HudIconUserParam is HudIconToolbox.HudIconMasterUserParam

Notes

User parameter of the layer HUD icon master recipes; same as HudIconToolbox.HudIconMasterUserParam (the layers fill accessNotificationCacheFn).

Used in the base game: 5 times in 5 files

base/content/gui/gui/layers/layer_noise.tl:47

layer_noise.HudIconMaster = react.RegisterRecipe("LayerNoiseHudIconMaster", function(params : Builtin.HudIconParam, userParam : LayersButtonRidge.HudIconUserPar
base/content/gui/gui/layers/layer_traffic.tl:49
layer_traffic.HudIconMaster = react.RegisterRecipe("LayerTrafficHudIconMaster", function(params : Builtin.HudIconParam, userParam : LayersButtonRidge.HudIconUse
base/content/gui/gui/layers/layer_public_transport.tl:71
layer_public_transport.HudIconMaster = react.RegisterRecipe("LayerPublicTransportHudIconMaster", function(params : Builtin.HudIconParam, userParam : LayersButto
base/content/gui/gui/layers/layer_pollution.tl:32
layer_pollution.HudIconMaster = react.RegisterRecipe("LayerPollutionHudIconMaster", function(params : Builtin.HudIconParam, userParam : LayersButtonRidge.HudIco
base/content/gui/gui/entity_window/entity_window_hud.tl:524
local layerHudIconUserParam : LayersButtonRidge.HudIconUserParam = {

LayersButtonRidge.OpenLayerRidgeEventParams

record base/tealdef/gui/layers/layers_button_ridge.d.tl:49

record OpenLayerRidgeEventParams

Notes

Payload of the openLayerRidge event, which expands the layer ridge and optionally opens one layer.

Example

-- from game_mechanics/towns/town_util.tl
onClickEvent = {"openLayerRidge", { layer = "menu.layers.trafficButton", stack = true }},
Used in the base game: 1 time in 1 file

base/content/gui/gui/layers/layers_button_ridge.tl:450

local params = eventParam as LayersButtonRidge.OpenLayerRidgeEventParams

Fields

Name Type Description
layer string Button id of the layer to open, e.g. "menu.layers.noiseButton".
stack boolean If true, the layer tool is stacked on top of the current tool instead of replacing it.

LayersButtonRidge.PreferredLayerConfigEvent

record base/tealdef/gui/layers/layers_button_ridge.d.tl:54

record PreferredLayerConfigEvent

Notes

Payload of the preferredLayerConfig event that layer windows fire when they open (nil when closed); the construction tools use the config instead of their own.

Used in the base game: 3 times in 3 files

base/content/gui/gui/construction/construction.tl:4425

local eventParam = param as LayersButtonRidge.PreferredLayerConfigEvent
base/content/gui/gui/construction/construction_react_util.tl:1372
local eventParam = param as LayersButtonRidge.PreferredLayerConfigEvent
base/content/gui/gui/main/game.tl:131
local eventParam = param as LayersButtonRidge.PreferredLayerConfigEvent

Fields

Name Type Description
config LayerConfig Layer config of the open layer.