Skip to content

layer_cargo

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

Notes

The "Cargo Satisfaction" map layer (button menu.layers.cargoButton).

LayerCargo

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

global record LayerCargo

Load: local layer_cargo = ug_require "/gui/layers/layer_cargo.tl"

Notes

The "Cargo Satisfaction" layer, which colors warehouses and network edges by cargo satisfaction.

Fields

Name Type Description
Legend Recipe0 Recipe of the layer legend. used 1× in the base game
Layer Recipe<LayersButtonRidge.LayerContentParam> Recipe of the layer window content, with a cargo type selector. used 1× in the base game
HudIconMaster Recipe2<Builtin.HudIconParam, HudIconUserParam> HUD icon recipe of the layer; shows town cargo ratings, the matching cargo of vehicles and warehouse stocks. used 1× in the base game

Functions

getConfig(cargoIndex : CargoTypeId) : LayerConfig base/tealdef/gui/layers/layer_cargo.d.tl:4

Call as layer_cargo.getConfig

Notes

Builds the layer config for one cargo type or for all cargo types.

Parameter Type Description
cargoIndex CargoTypeId Cargo type id, or -1 for all cargo types except passengers.

Returns LayerConfig: A new LayerConfig with warehouse coloring, satisfaction edges, signs and town areas.

Used in the base game: 1 time in 1 file

base/content/gui/gui/entity_window/town/town.tl:1000

layerConfig = layer_cargo.getConfig(-1)

getHudIconPreFilter() : {Engine.ComponentType} base/tealdef/gui/layers/layer_cargo.d.tl:12

Call as layer_cargo.getHudIconPreFilter

Notes

Component types that get HUD icons in this layer.

Returns {Engine.ComponentType}: TRANSPORT_VEHICLE, TOWN and WAREHOUSE.

Used in the base game: 1 time in 1 file

base/content/gui/gui/entity_window/entity_window_hud.tl:611

filter = layer_cargo.getHudIconPreFilter()

LayerCargo.HudIconUserParam

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

record HudIconUserParam is LayersButtonRidge.HudIconUserParam

Notes

User parameter of LayerCargo.HudIconMaster.

Used in the base game: 2 times in 2 files

base/content/gui/gui/layers/layer_cargo.tl:44

layer_cargo.HudIconMaster = react.RegisterRecipe("LayerCargoHudIconMaster", function(params : Builtin.HudIconParam, userParam : LayerCargo.HudIconUserParam) : T
base/content/gui/gui/entity_window/entity_window_hud.tl:575
local cargoLayerHudIconUserParam : LayerCargo.HudIconUserParam = {

Functions

getSelectedCargoTypeId() : CargoTypeId base/tealdef/gui/layers/layer_cargo.d.tl:9

Notes

Returns the cargo type selected in the layer window, or -1 for all.

Returns CargoTypeId