Skip to content

hud_gui_config

Source: base/tealdef/gui/hud/hud_gui_config.d.tl

Notes

Type of the GUI resource ::/gui/hud/hud_gui_config.gres (defined in hud_gui_config.gres.lua): distance scales, colors and vehicle icon offsets for the HUD icons drawn in the 3D view.

HudGuiConfig

record global base/tealdef/gui/hud/hud_gui_config.d.tl:3

global record HudGuiConfig

Notes

Content of the GUI resource ::/gui/hud/hud_gui_config.gres, the base settings for HUD icons in the 3D view.

Example

local hudGuiConfig = api.gui.genericRep.get(api.gui.genericRep.find("::/gui/hud/hud_gui_config.gres")).data
local offsets = hud_react_util.makeVehicleIconOffsets(hudGuiConfig.vehicleIconOffsets)

Fields

Name Type Description
renderDistances RenderDistances Per-entity-type HUD icon scales, see HudGuiConfig.RenderDistances.
colors Colors Colors used by HUD icons, see HudGuiConfig.Colors.
vehicleIconOffsets {string : {number}} Offset {x, y, z} of the vehicle HUD icon per carrier name ("ROAD", "RAIL", "TRAM", "AIR", "WATER").

HudGuiConfig.RenderDistances

record base/tealdef/gui/hud/hud_gui_config.d.tl:4

record RenderDistances

Notes

Scale multipliers for the HUD icons of each entity type (all 1.0 in the base game).

Details

HudReactUtil.makeDefaultVisibilityThresholds copies these values into the scale of the matching forComponents entry; Costs is passed as costsRenderDistance to the HUD icon manager.

Fields

Name Type Description
Town number HUD icon scale for towns (TOWN component).
Industry number HUD icon scale for industries (INDUSTRY component).
Warehouse number HUD icon scale for warehouses (WAREHOUSE component).
Depot number HUD icon scale for vehicle depots (VEHICLE_DEPOT component).
Station number HUD icon scale for stations (STATION_GROUP component).
Signal number HUD icon scale for signals (SIGNAL_LIST component).
TransportVehicle number HUD icon scale for vehicles (TRANSPORT_VEHICLE component).
DeadEndPath number HUD icon scale for dead-end markers on the network (BASE_NODE component).
TownBuildingCargo number HUD icon scale for cargo icons on town buildings (TOWN_BUILDING component).
Costs number Passed as costsRenderDistance to the HUD icon manager, which draws cost and income pop-ups.

HudGuiConfig.Colors

record base/tealdef/gui/hud/hud_gui_config.d.tl:18

record Colors

Notes

Colors used by HUD icons and layers.

Fields

Name Type Description
FallbackVehicle GResColor Fallback color for vehicles in layer views; used as both surface and details color of LayerReactUtil.createDefaultFallbackColor in the HUD icon manager config (white in the base game).
Perk GResColor Background color of perk HUD icons (PerkHudIcon in gui/main/hud_icon_master.css.lua; true blue in the base game).
Capital GResColor Background color of the town HUD icon of the capital city (style TownHudIcon!capital-city; true blue in the base game).