Skip to content

line_util

Source: base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl

Notes

Line utilities of the Line & Vehicle Manager (LVM): converting between the engine LINE component and the editable Line.ReactLine, stop/waypoint index conversion, automatic terminal and cargo-load assignment, the selection/hover context of the LVM tool, and the shared CommonActionParams interface that the LVM panels pass around.

Globals

Types

Name Definition Description
VehicleStoreOpenInfo declared here, defined in VehicleStoreOpenInfo defined in manager_window.d.tl Depot and line the vehicle store window was opened for from the Line & Vehicle Manager.
VehicleManagerParams declared here, defined in VehicleManagerParams defined in manager_window.d.tl Parameters of the vehicle manager (vehicle list) of the Line & Vehicle Manager.
VehicleManagerApi declared here, defined in VehicleManagerApi defined in manager_window.d.tl API of the vehicle manager, reached through CommonActionParams.vehicleManagerRef.
VehicleManagerState declared here, defined in VehicleManagerState defined in manager_window.d.tl Contents of the vehicle list; kept between openings of the manager.
LineManagerState declared here, defined in LineManagerState defined in manager_window.d.tl Selection of the line and depot list.
LineAndDepotListParams declared here, defined in LineAndDepotListParams define in manager_window.d.tl Parameters of the line and depot list of the Line & Vehicle Manager.
LineAndDepotListApi declared here, defined in LineAndDepotListApi defined in manager_window.d.tl API of the line and depot list, reached through CommonActionParams.lineAndDepotListRef.

LineUtil

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:5

global record LineUtil

Load: local line_util = ug_require "/gui/line_vehicle_mgmt/line_util.tl"

Notes

Line utilities of the Line & Vehicle Manager. Load with ug_require "/gui/line_vehicle_mgmt/line_util.tl".

Functions

autoAssignTerminals(entity : Engine.Entity, path : {Line.ReactVia}) : {Engine.Component.Line.Stop} base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:177

Call as line_util.autoAssignTerminals

Notes

Converts a line path into engine Line.Stop entries and fills in missing station/terminal indices with the engine's best line assignment.

Parameter Type Description
entity Engine.Entity Existing line entity, or nil for a new line.
path {Line.ReactVia} Path of a Line.ReactLine.

Returns {Engine.Component.Line.Stop}: The stops for Engine.Component.Line.stops, with waypoints attached to the preceding stop.

Details

Waypoints before the first stop are appended to the last stop. Stops without a station or terminal are assigned with api.engine.system.lineSystem.getBestLineAssignment; if that finds nothing, station 0 / terminal 0 is used.

Used in the base game: 1 time in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:6527

newLineComp.stops = line_util.autoAssignTerminals(lineEntity, lineStateNew.path)

makeLineColor(Engine.Entity) : Vec3f base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:178

Call as line_util.makeLineColor

Notes

Picks a colour for a new line from ::/gui/line_vehicle_mgmt/line_colors.gres, preferring colours the player's lines use least.

Parameter Type Description
#1 Engine.Entity Player entity.

Returns Vec3f

Used in the base game: 1 time in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:6535

lineStateNew.color = line_util.makeLineColor(playerEntity)

makeLineName(Engine.Entity) : string base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:179

Call as line_util.makeLineName

Notes

Returns the first unused default line name ("Line 1", "Line 2", ...) among the player's lines.

Parameter Type Description
#1 Engine.Entity Player entity.

Returns string: Translated name; "New Line" if the numbers up to 999 are all used.

Used in the base game: 1 time in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:6536

local name = line_util.makeLineName(playerEntity)

getReactLineFromGameState(Engine.Entity) : Line.ReactLine base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:180

Call as line_util.getReactLineFromGameState

Notes

Reads the LINE component of a line entity and returns it as an editable Line.ReactLine.

Parameter Type Description
#1 Engine.Entity Line entity; nil returns nil.

Returns Line.ReactLine

Used in the base game: 6 times in 3 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:2647

local reactLine = line_util.getReactLineFromGameState(selectedLines[1].entity)
base/content/gui/gui/line_vehicle_mgmt/auto_rename/scheme_components/scheme_component_firststop.script.tl:6
local reactLine =  line_util.getReactLineFromGameState(renameParams.lineEntity)
base/content/gui/gui/line_vehicle_mgmt/auto_rename/scheme_components/scheme_component_laststop.script.tl:6
local reactLine =  line_util.getReactLineFromGameState(renameParams.lineEntity)

computeStopAndWaypointIndex0(line : Engine.Entity, stopNumber : integer) : {integer, integer} base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:181

Call as line_util.computeStopAndWaypointIndex0

Notes

Converts a stop number (1-based index in the flat stop-and-waypoint path) into engine indices.

Parameter Type Description
line Engine.Entity Line entity.
stopNumber integer 1-based index in the flat path.

Returns {integer, integer}: {stopIndex0, waypointIndex}; the waypoint index is -1 (stop without waypoints), 0 (stop with waypoints) or the 1-based waypoint number. Nil if out of range.

Used in the base game: 1 time in 1 file

base/content/gui/gui/line_vehicle_mgmt/line_manager_panel.tl:1019

local apiStopIndex0 = line_util.computeStopAndWaypointIndex0(params.lineEntity, params.stopNumber)[1]

computeWaypointIndex0FromTag(line : Engine.Entity, stopIndex0 : integer, waypointTag : integer) : integer base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:182

Call as line_util.computeWaypointIndex0FromTag

Notes

Finds the 0-based index of a waypoint (by its tag) within a stop of the line.

Returns integer: The index, -1 if the tag is nil or negative, or nil (with an error log) if not found.

computeStopNumber(line : Engine.Entity, stopIndex0 : integer, apiWaypointIndex : integer) : integer base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:183

Call as line_util.computeStopNumber

Notes

Converts engine indices (stop index and waypoint index) into the stop number, i.e. the 1-based index in the flat stop-and-waypoint path.

Returns integer

convertDetails(entity : Engine.Entity, apiDetails : Gui.SelectionDetails) : SelectionDetails base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:184

Call as line_util.convertDetails

Notes

Converts engine selection details (or a plain entity) into LineUtil.SelectionDetails.

Parameter Type Description
entity Engine.Entity Picked entity, used when apiDetails has no data.
apiDetails Gui.SelectionDetails Selection details from the selector or HUD.

Returns SelectionDetails: Details with one field set; for plain entities: station group, station, vehicle depot, signal, or entity. Nil if the entity does not exist.

makeNewStop(details : StationSelectionDetails) : Line.ReactVia base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:185

Call as line_util.makeNewStop

Notes

Creates a new path entry for a stop at the given station, with an empty load configuration and the default waiting time.

Returns Line.ReactVia: A Line.ReactVia with stop set.

Used in the base game: 2 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:6702

local stop = line_util.makeNewStop(newLineStartingWithStation)

applyInputActionConfig(guiCtx : GuiContextState) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:186

Call as line_util.applyInputActionConfig

Notes

Calls react.useInputAction for every input action configured in the context state (so it can also be applied on the owning window).

Used in the base game: 1 time in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:6251

line_util.applyInputActionConfig(guiCtxForInputActions:old())

guiContextEquals(old : GuiContextState, newContext : GuiContextState) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:187

Call as line_util.guiContextEquals

Notes

Compares two context states (tooltips, highlights, filters, input actions and their compare proxies); used to avoid needless state updates.

Returns boolean

Used in the base game: 1 time in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:6370

if line_util.guiContextEquals(old, newContext) then

useContextState(prepareContextBuilder? : (function() : LineUtil.ContextBuilder), updateIA? : function(ctx : LineUtil.GuiContextState)) : LineUtil.GuiContextState, function(ctx : LineUtil.GuiContextState) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:188

Call as line_util.useContextState

Notes

React hook that keeps a GuiContextState and applies its input actions.

Parameter Type Description
prepareContextBuilder? (function() : LineUtil.ContextBuilder) Optional; returns the builder whose result is the initial state.
updateIA? function(ctx : LineUtil.GuiContextState) Optional; called with the current state each render.

Returns LineUtil.GuiContextState, function(ctx : LineUtil.GuiContextState): The current state and a setter that only updates when LineUtil.guiContextEquals reports a change.

Used in the base game: 5 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:287

= line_util.useContextState(prepareContextBuilder, commonParams.updateIA)

MakeContextBuilder() : ContextBuilder base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:191

Call as line_util.MakeContextBuilder

Notes

Returns a new, empty LineUtil.ContextBuilder.

Returns ContextBuilder

Used in the base game: 5 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:253

local ctx : LineUtil.ContextBuilder = line_util.MakeContextBuilder()

makeLineActionDescriptor<CommonParams, Mode>(commonParams : CommonActionParams, gameCtx : GameContext, parent : ReactNodeRef, switchMode : function(newMode : {Mode, any | LineUtil.StopSelectionDetails | nil}), lineVisualizations : {Builtin.Type.LineVisualization}, continuousRenderLine : Engine.Entity, highlightedEntities : {Engine.Entity}, oldContext : GuiContextState, pickedEntity : function(details : LineUtil.SelectionDetails) : LineUtil.GuiContextState, processMosueEvent : function(evt : Gui.Mouse.Event) : boolean, lineSelectable : boolean, showTownDistrictColors : boolean, pushTownIconsToBack : boolean, isGamepadInputMode : boolean, lvm2D3DMode : LVM2D3DMode, horizontalPromptList : boolean, preferLineOverTNEdge : boolean) : TreeNodeId base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:192

Call as line_util.makeLineActionDescriptor

Notes

Builds the builtin.ActionDescriptor (tool "management") of the Line & Vehicle Manager, with layer config, line viewer, selector, cursor tooltip and HUD icon config.

Returns TreeNodeId: The action descriptor node.

Used in the base game: 5 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:435

return line_util.makeLineActionDescriptor(

getStationHudPath(carrier : Carrier, depot : boolean, cargo : boolean) : string base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:211

Call as line_util.getStationHudPath

Notes

Returns the HUD icon path for a station or depot of the given carrier.

Parameter Type Description
carrier Carrier Carrier of the station or depot.
depot boolean True for a depot icon.
cargo boolean True for the cargo variant of a station icon.

Returns string: Icon path under ::/gui/hud/icons/, or an empty string for an unknown carrier.

getLineCarriers(line : Line.ReactLine) : {Carrier : boolean} base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:212

Call as line_util.getLineCarriers

Notes

Returns the carriers served by the first stop of the line that has a station assigned (empty if there is none).

Returns {Carrier : boolean}

Used in the base game: 2 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:468

carriers = line_util.getLineCarriers(commonParams.lineState:old())

isWaypointTooClose(line : Line.ReactLine, position : Vec3f, ignoreStopNumber : integer) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:213

Call as line_util.isWaypointTooClose

Notes

Checks whether a position is within 8 metres of a waypoint of the line.

Parameter Type Description
line Line.ReactLine
position Vec3f
ignoreStopNumber integer Path index to skip (the waypoint being moved).

Returns boolean

Used in the base game: 4 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:723

elseif line_util.isWaypointTooClose(commonParams.lineState:old(), apiWaypoint.pos, nil) then

calculateFrequencySeconds(entityId : Engine.Entity) : integer base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:214

Call as line_util.calculateFrequencySeconds

Notes

Returns the line interval in seconds (1 / api.engine.util.line.getMaxFrequency), or 0 if the frequency is zero.

Returns integer

Used in the base game: 4 times in 3 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:3975

return line_util.calculateFrequencySeconds(params.lineEntity)
base/content/gui/gui/statistics/statistic_lines.tl:203
return line_util.calculateFrequencySeconds(entity)
base/content/gui/gui/entity_window/line/line_eow.script.tl:58
return line_util.calculateFrequencySeconds(entityId)

getVehicleInstructionName(vehicleEntity : Engine.Entity) : string base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:215

Call as line_util.getVehicleInstructionName

Notes

Returns the name of the vehicle's line if it is en route or at a terminal, otherwise "Going to Depot" or "In Depot".

Returns string

Used in the base game: 1 time in 1 file

base/content/gui/gui/statistics/statistic_vehicles.tl:448

local vehicleInstructionName = line_util.getVehicleInstructionName(key)

autoLoadConfig(line : Line.ReactLine) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:216

Call as line_util.autoLoadConfig

Notes

Sets the cargo loading of all stops automatically from the stations' supply and demand. Does nothing if the line has customFilters.

Details

Also assigns terminals first if a stop has none. Passengers are loaded at passenger stations; cargo is loaded where it is produced if another stop of the line needs it.

Used in the base game: 5 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:6712

line_util.autoLoadConfig(lineState2)

isTerminalCargoTypeAllowed(stop : Line.ReactTerminal, cargoTypeId : CargoTypeId) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:218

Call as line_util.isTerminalCargoTypeAllowed

Notes

Returns false only for passengers at a terminal that neither loads nor unloads passengers.

Returns boolean

Used in the base game: 1 time in 1 file

base/content/gui/gui/line_vehicle_mgmt/cargofilter_window.tl:372

data[k].allowed = line_util.isTerminalCargoTypeAllowed(reactStop, cargoTypeId)

getTerminalAlternative(details : LineUtil.StationSelectionDetails, lineState : Line.ReactLine, stopNumber : integer) : LineUtil.TerminalAlternative base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:219

Call as line_util.getTerminalAlternative

Notes

Checks whether a terminal can be (or already is) an alternative terminal of the given stop.

Parameter Type Description
details LineUtil.StationSelectionDetails The terminal under the cursor.
lineState Line.ReactLine The edited line.
stopNumber integer 1-based index of the stop in the line path.

Returns LineUtil.TerminalAlternative

isLineCompatibleWithTransportMode(lineEntity : Engine.Entity, tm : TransportMode) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:220

Call as line_util.isLineCompatibleWithTransportMode

Notes

Returns true if the edges at every assigned terminal of the line allow the transport mode.

Returns boolean

Used in the base game: 3 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:165

showLine = (line_util.isLineCompatibleWithTransportMode(lineEntity, tmSmAircraft)

getLineHasVehicles(lineEntity : Engine.Entity) : LineUtil.LineHasVehicles base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:221

Call as line_util.getLineHasVehicles

Notes

Returns which kinds of vehicles are assigned to the line.

Returns LineUtil.LineHasVehicles

getLineAndVehicleCompatibleTransportModesAndCarrier(vehicleEntities : {Engine.Entity}) : VehicleStoreUtil.TransportModesAndCarrier base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:222

Call as line_util.getLineAndVehicleCompatibleTransportModesAndCarrier

Notes

Returns the carrier of the vehicles and the transport modes a replacement vehicle may have (used by the vehicle store).

Returns VehicleStoreUtil.TransportModesAndCarrier: Empty transport modes and nil carrier when the vehicles have different carriers.

Used in the base game: 3 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:5195

local transportModesAndCarrier = line_util.getLineAndVehicleCompatibleTransportModesAndCarrier(vehicleEntities)
base/content/gui/gui/entity_window/vehicle/vehicle.tl:450
local transportModesAndCarrier = line_util.getLineAndVehicleCompatibleTransportModesAndCarrier({vehicleEntityId})

isStopProtected(lineEntity : Engine.Entity, stationGroupEntity : Engine.Entity, protectedEntities : {Engine.Entity : GameContext.Filters.ProtectionConfig | boolean}) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:225

Call as line_util.isStopProtected

Notes

Checks whether a line (or one of its stops) is protected against changes by GameContext.Filters.protectedEntities (e.g. in missions).

Parameter Type Description
lineEntity Engine.Entity
stationGroupEntity Engine.Entity Station group to check; nil checks the line as a whole.
protectedEntities {Engine.Entity : GameContext.Filters.ProtectionConfig | boolean}

Returns boolean

Used in the base game: 6 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/line_manager_panel.tl:656

return line_util.isStopProtected(params.lineEntity, stationGroup, params.commonParams.gameCtx.filters:get().protectedEntities)
base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:744
return not line_util.isStopProtected(lineEntity, nil, commonParams.gameCtx.filters:get().protectedEntities)

getBestDepotForLine(lineEntity : Engine.Entity) : Engine.Entity base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:231

Call as line_util.getBestDepotForLine

Notes

Finds a depot suited to the line's carriers and vehicles with api.engine.util.vehicle.findBestDepotForLine; the result is negative (or nil) if none is found.

Returns Engine.Entity

Used in the base game: 1 time in 1 file

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:7400

local depotForLine = line_util.getBestDepotForLine(singleLine)

getTerminal(stop : Line.ReactTerminal) : Terminal base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:233

Call as line_util.getTerminal

Notes

Returns the Terminal of the stop's station and terminal, or nil if none is assigned.

Returns Terminal

Used in the base game: 1 time in 1 file

base/content/gui/gui/line_vehicle_mgmt/cargofilter_window.tl:344

local terminal = line_util.getTerminal(reactStop)

getTerminalLength(stationEntity : Engine.Entity, terminalIndex1 : integer) : number base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:234

Call as line_util.getTerminalLength

Notes

Returns the largest cargo transfer length of the terminal (1-based index) of the station.

Returns number

Used in the base game: 2 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/line_manager_panel.tl:153

local terminalLength = line_util.getTerminalLength(stationEntity, terminalIndex1)
base/content/gui/gui/entity_window/station_group/station_group.tl:739
local terminalLength = line_util.getTerminalLength(stationEntity, terminalIndex1)

getRelaxationType(okModes : {TransportMode : boolean}, relaxedModes : {TransportMode : boolean}, allowedModes : {TransportMode : boolean}) : LineUtil.RelaxationType base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:248

Call as line_util.getRelaxationType

Notes

Compares the original and relaxed transport modes and returns what infrastructure is missing, or nil.

Returns LineUtil.RelaxationType

Used in the base game: 3 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/line_manager_panel.tl:491

local relaxationType = line_util.getRelaxationType(pathProblemLocation.okModes, pathProblemLocation.relaxedModes, pathProblemLocation.allowedModes)
base/content/game_mechanics/game_mechanics/notifications/types/line_warning.script.tl:90
local relaxationType = line_util.getRelaxationType(param.okModes, param.relaxedModes, param.allowedModes)

getRelaxationText(relaxationType : RelaxationType) : string base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:249

Call as line_util.getRelaxationText

Notes

Returns the translated text for a relaxation type ("Missing catenaries", ...), or nil.

Returns string

Used in the base game: 3 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/line_manager_panel.tl:492

return line_util.getRelaxationText(relaxationType)
base/content/game_mechanics/game_mechanics/notifications/types/line_warning.script.tl:91
local relaxationText = line_util.getRelaxationText(relaxationType)

filterLine(allowedCarriers : {Carrier}, lineEntity : Engine.Entity) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:251

Call as line_util.filterLine

Notes

Returns true if the line matches the allowed carriers, based on its transport modes and the vehicles assigned to it (used by the LVM carrier filter).

Returns boolean

Used in the base game: 3 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:241

if line_util.filterLine(allowedCarriers, lineEntity) then
base/content/gui/gui/statistics/statistic_lines.tl:319
if not line_util.filterLine(allowedCarriers, key) then

LineUtil.LineSelectionDetails

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:6

record LineSelectionDetails

Notes

A picked or highlighted line, optionally at a specific stop or waypoint.

Used in the base game: 4 times in 4 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:6717

line : LineUtil.LineSelectionDetails,
base/content/gui/gui/line_vehicle_mgmt/manager_tooltips_util.tl:24
manager_tooltips_util.SelectLine = react.RegisterRecipe("SelectLine", function(line : LineUtil.LineSelectionDetails) : TreeNodeId
base/content/gui/gui/line_vehicle_mgmt/line_util.tl:314
local function convertLineDetails(apiDetails : Gui.SelectionDetails.Line) : LineUtil.LineSelectionDetails
base/content/gui/gui/line_vehicle_mgmt/manager_hud_util.tl:146
local lineDetails : LineUtil.LineSelectionDetails = {}

Fields

Name Type Description
entity Engine.Entity The line entity.
stopNumber integer 1-based index of the Via
apiStopIndex0 integer 0-based stop index in the engine LINE component.
apiWaypointIndex integer Waypoint index after that stop as the engine reports it (-1 or nil for the stop itself).

LineUtil.StationSelectionDetails

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:14

record StationSelectionDetails

Notes

A picked station group, optionally narrowed down to one station and terminal.

Used in the base game: 19 times in 4 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:47

pickedStation : function(sDetails : LineUtil.StationSelectionDetails)
base/content/gui/gui/line_vehicle_mgmt/manager_tooltips_util.tl:111
manager_tooltips_util.CreateLine = react.RegisterRecipe("CreateLine", function(station : LineUtil.StationSelectionDetails) : TreeNodeId
base/content/gui/gui/line_vehicle_mgmt/line_util.tl:323
local function convertStationDetails(apiDetails : Gui.SelectionDetails.Station) : LineUtil.StationSelectionDetails
base/content/gui/gui/line_vehicle_mgmt/manager_hud_util.tl:383
stationDetails : LineUtil.StationSelectionDetails,

Fields

Name Type Description
stationGroup Engine.Entity The station group entity.
stationIndex1 integer 1-based index in stationGroup
station Engine.Entity The station entity that contains the picked terminal, or nil.
terminalIndex1 integer 1-based index in station
flatStationTerminalIndex1 integer 1-based index in all station/terminal pairs of the station group.

LineUtil.SignalSelectionDetails

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:25

record SignalSelectionDetails

Notes

A picked signal (waypoint signal list entry).

Used in the base game: 3 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/line_util.tl:350

local function convertSignalDetails(apiDetails : Gui.SelectionDetails.Signal) : LineUtil.SignalSelectionDetails

Fields

Name Type Description
signal Engine.Entity Entity with the SIGNAL_LIST component.
signalIndex1 integer 1-based index in signalList

LineUtil.StopSelectionDetails

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:30

record StopSelectionDetails

Notes

A picked stop of a line, together with the station it is at.

Used in the base game: 14 times in 4 files

base/content/gui/gui/line_vehicle_mgmt/line_manager_panel.tl:1659

if (lvmMode[2] as LineUtil.StopSelectionDetails).stopNumber == stopNumber then
base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:838
local function makeActionMoveStopMode(commonParams : CommonActionParams, movingStop : LineUtil.StopSelectionDetails) : TreeNodeId
base/content/gui/gui/line_vehicle_mgmt/line_util.tl:357
local function convertStopDetails(apiDetails : Gui.SelectionDetails.Stop) : LineUtil.StopSelectionDetails
base/content/gui/gui/line_vehicle_mgmt/manager_hud_util.tl:180
stopDetails : LineUtil.StopSelectionDetails

Fields

Name Type Description
station StationSelectionDetails Station (group, station, terminal) of the stop.
line Engine.Entity The line entity.
stopNumber integer 1-based index of the Via
apiStopIndex0 integer 0-based stop index in the engine LINE component.

LineUtil.WaypointSelectionDetails

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:39

record WaypointSelectionDetails

Notes

A picked waypoint of a line.

Used in the base game: 10 times in 5 files

base/content/gui/gui/line_vehicle_mgmt/line_manager_panel.tl:1026

} as LineUtil.WaypointSelectionDetails})
base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:1013
local function makeActionMoveWaypointMode(commonParams : CommonActionParams, movingWaypoint : LineUtil.WaypointSelectionDetails) : TreeNodeId
base/content/gui/gui/line_vehicle_mgmt/manager_tooltips_util.tl:162
manager_tooltips_util.LMMoveWaypoint = react.RegisterRecipe("LMMoveWaypoint", function(waypoint : LineUtil.WaypointSelectionDetails) : TreeNodeId
base/content/gui/gui/line_vehicle_mgmt/line_util.tl:366
local function convertWaypointDetails(apiDetails : Gui.SelectionDetails.Waypoint) : LineUtil.WaypointSelectionDetails
base/content/gui/gui/line_vehicle_mgmt/manager_hud_util.tl:734
waypointDetails : LineUtil.WaypointSelectionDetails

Fields

Name Type Description
line Engine.Entity The line entity.
stopNumber integer 1-based index of the Via
apiStopIndex0 integer 0-based index of the stop the waypoint follows in the engine LINE component.
tag integer Tag of the waypoint (Waypoint.tag), which identifies it within the line.

LineUtil.TransportNetworkEdgeSelectionDetails

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:47

record TransportNetworkEdgeSelectionDetails

Notes

A picked position on a transport network edge (used to place waypoints).

Used in the base game: 2 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/line_util.tl:376

local function convertTransportNetworkEdgeDetails(apiDetails : Gui.SelectionDetails.TransportNetworkEdge) : LineUtil.TransportNetworkEdgeSelectionDetails

Fields

Name Type Description
snap EdgePos Edge position the cursor snapped to.

LineUtil.VehicleDepotDetails

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:51

record VehicleDepotDetails

Notes

A vehicle or depot entity plus whether it should be removed from (instead of added to) the vehicle list or selection.

Used in the base game: 5 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:7000

commonParams.addOrRemoveVehicleToVehicleList = function(vehicleDepotDetails : LineUtil.VehicleDepotDetails)
base/content/gui/gui/line_vehicle_mgmt/manager_tooltips_util.tl:91
manager_tooltips_util.AddOrRemoveDepotVehiclesToVehicleList = react.RegisterRecipe("AddOrRemoveDepotVehiclesToVehicleList", function(vehicleDepotDetails : LineU

Fields

Name Type Description
entity Engine.Entity Vehicle or depot entity.
removeFromList boolean True to remove instead of add.

LineUtil.SelectionDetails

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:56

record SelectionDetails

Notes

Result of LineUtil.convertDetails; exactly one field is set, depending on what was picked.

Used in the base game: 9 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:292

local function pickedEntity(details : LineUtil.SelectionDetails) : LineUtil.GuiContextState
base/content/gui/gui/line_vehicle_mgmt/line_util.tl:382
line_util.convertDetails = function(entity : Engine.Entity, apiDetails : Gui.SelectionDetails) : LineUtil.SelectionDetails

Fields

Name Type Description
entity Engine.Entity use if it is only an entity, without additional detail infos
line LineSelectionDetails Set when a line was picked.
station StationSelectionDetails Set when a station group, station or terminal was picked.
signal SignalSelectionDetails Set when a signal was picked.
stop StopSelectionDetails Set when a stop of a line was picked.
waypoint WaypointSelectionDetails Set when a waypoint of a line was picked.
transportNetworkEdge TransportNetworkEdgeSelectionDetails Set when a position on a transport network edge was picked.
world Gui.SelectionDetails.World Set when the terrain was picked; the engine's Gui.SelectionDetails.World data.
vehicleDepot VehicleDepotDetails Set when a vehicle depot (with in or out nodes) was picked.
townData Gui.SelectionDetails.Town Set when a town was picked; the engine's Gui.SelectionDetails.Town data.

LineUtil.TerminalAlternative

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:69

record TerminalAlternative

Notes

Result of LineUtil.getTerminalAlternative.

Used in the base game: 3 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/line_util.tl:1406

line_util.getTerminalAlternative = function(details: LineUtil.StationSelectionDetails, lineState : Line.ReactLine, stopNumber : integer) : LineUtil.TerminalAlte
base/content/gui/gui/line_vehicle_mgmt/manager_hud_util.tl:409
terminalAlternative : LineUtil.TerminalAlternative

Fields

Name Type Description
alternativePossible boolean True if the terminal belongs to the stop's station group but is not its main terminal.
alternativeSelected boolean True if the terminal is already one of the stop's alternative terminals.
color Vec4f Line colour (alpha 1) when an alternative is possible, otherwise nil.

LineUtil.LineHasVehicles

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:75

record LineHasVehicles

Notes

Which kinds of vehicles run on a line; result of LineUtil.getLineHasVehicles.

Used in the base game: 1 time in 1 file

base/content/gui/gui/line_vehicle_mgmt/line_util.tl:1486

line_util.getLineHasVehicles = function(lineEntity : Engine.Entity) : LineUtil.LineHasVehicles

Fields

Name Type Description
hasNoVehicles boolean True if no vehicle is assigned to the line.
hasRoadVehicles boolean At least one vehicle with carrier ROAD.
hasRailVehicles boolean At least one vehicle with carrier RAIL.
hasTramVehicles boolean At least one vehicle with carrier TRAM.
hasAirVehicles boolean At least one vehicle with carrier AIR.
hasWaterVehicles boolean At least one vehicle with carrier WATER.
hasPlanes boolean At least one air vehicle with transport mode AIRCRAFT.
hasSmallPlanes boolean At least one air vehicle with transport mode SMALL_AIRCRAFT.
hasHelicopters boolean At least one air vehicle with transport mode HELICOPTER.
hasShips boolean At least one water vehicle with transport mode SHIP.
hasSmallShips boolean At least one water vehicle with transport mode SMALL_SHIP.
hasLightrailRail boolean At least one rail vehicle that can also use tram transport modes (light rail).
hasLightrailTram boolean At least one tram vehicle that can use tram track transport modes (light rail).

LineUtil.RecipeAndParamErased

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:94

record RecipeAndParamErased

Notes

A tooltip recipe together with its parameter, with the parameter type erased.

Fields

Name Type Description
recipe Recipe<any> Recipe that renders the tooltip.
param any Parameter passed to the recipe.

LineUtil.GuiContextState

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:99

record GuiContextState

Notes

What the Line & Vehicle Manager tool shows and accepts for the current hover state (input actions, tooltip, highlights, selection filter). Built with LineUtil.MakeContextBuilder and consumed by LineUtil.makeLineActionDescriptor.

Used in the base game: 35 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:286

local oldContextState, setContextState : (LineUtil.GuiContextState, function(LineUtil.GuiContextState))
base/content/gui/gui/line_vehicle_mgmt/line_util.tl:722
line_util.applyInputActionConfig = function(guiCtx : LineUtil.GuiContextState)

Fields

Name Type Description
inputActions {string} the set of input actions depend on the internal state (e.g. on what entity is hovered) IAs are always a bit delayed, as they might go to the element hovered in the previous frame, while mouse clicks don't need the extra roundtrip to update hover
iaForwards {string : React.IaForward} Input actions forwarded to another node, by input action key (see ContextBuilder.iaForward).
iaHandlers {string : {React.IaHandler, any, any}} Input action handlers by key, each as {handler, handlerCompareProxy, isEnabledCompareProxy}; the proxies are used by LineUtil.guiContextEquals.
tooltip RecipeAndParamErased Tooltip shown next to the cursor (builtin.ActionTooltip), or nil.
mouseCursor integer Mouse cursor id passed to the action descriptor (0 by default).
terrainCirclePolicy Builtin.TerrainCirclePolicy Terrain circle policy of the action descriptor; when nil, "Never" in 2D mode and a mouse/gamepad-dependent default in 3D mode.
highlightLine LineUtil.LineSelectionDetails Line (and stop or waypoint) highlighted in the line viewer.
highlightStop Gui.SelectionDetails.Stop Stop highlighted in the line viewer.
highlightTerminal {Engine.Entity, StationTerminal} Station group and 0-based station terminal highlighted in the line viewer.
highlightWaypoint {Engine.Entity, integer, integer} Waypoint highlighted in the line viewer, as {line, apiStopIndex0, tag}.
snapPreview Gui.SelectionDetails.TransportNetworkEdge Edge position shown as snap preview in the line viewer (where a waypoint would go).
player boolean When true, only entities owned by the player (or not owned at all) can be selected.
disableCreateNewLine boolean When true, the line viewer does not show station terminals.
showNavigableLayer boolean When true, the terrain layer colours water and navigable water (used for ship waypoints).
showTerminalsForLine Engine.Entity Line whose terminals the line viewer shows.
componentsFilter {Engine.ComponentType} Component types an entity must have (at least one) to be selectable; nil allows all.
unselectableComponents {Engine.ComponentType} Component types that make an entity unselectable (only checked when componentsFilter is set).
hudMaster Recipe2<Builtin.HudIconParam, CommonActionParams> HUD icon master recipe used while the tool is active, or nil for no HUD icon config.
carriers {Carrier} Carriers whose lines and vehicles are shown and coloured; nil shows all.

Functions

handleClick() base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:107

there is no IA for mouse clicks yet, so call this handler instead

LineUtil.ContextBuilder

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:133

record ContextBuilder

Notes

Builder for a LineUtil.GuiContextState, created with LineUtil.MakeContextBuilder. Call its functions, then read result.

Used in the base game: 9 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:183

ctx : LineUtil.ContextBuilder,
base/content/gui/gui/line_vehicle_mgmt/line_util.tl:813
prepareContextBuilder : (function() : LineUtil.ContextBuilder),

Fields

Name Type Description
result GuiContextState The context state being built.

Functions

iaHandler(iaKey : string, handler : function(), handler_compareProxy : any, isEnabled : (function() : boolean), isEnabled_compareProxy : any, promptTextOverride? : string) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:134

Notes

Registers a handler for an input action.

Parameter Type Description
iaKey string Input action key, e.g. "IA_SELECT".
handler function() Called when the input action fires.
handler_compareProxy any Value compared by LineUtil.guiContextEquals instead of the function itself.
isEnabled (function() : boolean) Returns whether the action is currently enabled.
isEnabled_compareProxy any Value compared instead of the isEnabled function.
promptTextOverride? string Optional prompt text shown for the action.

iaHandlerExtended(iaKey : string, handler : function(Gui.InputAction.InvokeData), handler_compareProxy : any, isEnabled : (function() : boolean), isEnabled_compareProxy : any, promptTextOverride? : string) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:142

Notes

Like iaHandler, but the handler receives the Gui.InputAction.InvokeData of the action.

iaForward(iaKey : string, target : ReactRefWrap, asIaKey : string) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:150

Notes

Forwards an input action to another node (react.iaForward), optionally under another key.

Parameter Type Description
iaKey string Input action key to forward.
target ReactRefWrap Node the action is forwarded to.
asIaKey string Key under which the target receives it.

iaClick(handleClick : function()) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:151

note: currently, this is also triggered with IA_SELECT

iaClickOrSelect(handleClickOrSelect : function(), handleClickOrSelect_compareProxy : any, isEnabled : (function() : boolean), isEnabled_compareProxy : any) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:152

Notes

Sets the mouse-click handler and registers the same function for IA_SELECT.

tooltip<T>(recipe : Recipe<T>, param : T) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:158

Notes

Sets the tooltip recipe and its parameter.

setShowNavigableLayer(showNavigableLayer : boolean) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:159

Notes

Sets showNavigableLayer.

highlightLine(lineEntity : Engine.Entity, stopNumber : integer) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:160

Notes

Highlights a line at the given stop number (1-based index in the line path); pass a nil line to clear.

highlightTerminal(station : LineUtil.StationSelectionDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:161

Notes

Highlights the station terminal; clears the highlight if the details contain no station and terminal index.

highlightStop(stop : LineUtil.StopSelectionDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:162

Notes

Highlights a stop of a line in the line viewer.

highlightSignal(signal : LineUtil.SignalSelectionDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:163

Notes

Highlights a signal (stored in highlightTerminal); clears it when no signal index is given.

highlightWaypoint(waypoint : LineUtil.WaypointSelectionDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:164

Notes

Highlights a waypoint of a line.

showSnapPreview(snap : LineUtil.TransportNetworkEdgeSelectionDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:165

Notes

Shows a snap preview at the given edge position.

setPlayer(player : boolean) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:166

Notes

Sets player (restrict selection to the player's entities).

showTerminalsForLine(lineEntity : Engine.Entity) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:167

Notes

Sets the line whose terminals are shown.

setComponentsFilter(passComponents : {Engine.ComponentType}) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:168

Notes

Sets componentsFilter.

setUnselectableComponents(failComponents : {Engine.ComponentType}) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:169

Notes

Sets unselectableComponents.

setHudMaster<T is CommonActionParams>(masterRecipe : Recipe2<Builtin.HudIconParam, T>) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:170

Notes

Sets the HUD icon master recipe.

setMouseCursor(mouseCursor : integer) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:171

Notes

Sets the mouse cursor id.

setTerrainCirclePolicy(terrainCirclePolicy : Builtin.TerrainCirclePolicy) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:172

Notes

Sets the terrain circle policy.

LineUtil.DepotAndLineParams

record base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:236

record DepotAndLineParams

Notes

A depot and a line, e.g. to buy vehicles for the line at that depot.

Used in the base game: 2 times in 2 files

base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:679

local depotAndLine : LineUtil.DepotAndLineParams = {
base/content/gui/gui/line_vehicle_mgmt/manager_tooltips_util.tl:168
manager_tooltips_util.LMSelectDepotForLine = react.RegisterRecipe("LMSelectDepotForLine", function(depotAndLine : LineUtil.DepotAndLineParams) : TreeNodeId

Fields

Name Type Description
depot Engine.Entity Depot entity.
line Engine.Entity Line entity.

LineUtil.RelaxationType

enum base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:241

enum RelaxationType

Notes

Which infrastructure is missing when a line's transport modes had to be relaxed; result of LineUtil.getRelaxationType.

Used in the base game: 2 times in 1 file

base/content/gui/gui/line_vehicle_mgmt/line_util.tl:1966

function line_util.getRelaxationType(okModes : {TransportMode : boolean}, relaxedModes : {TransportMode : boolean}, allowedModes : {TransportMode : boolean}) : 

Value Description
"Catenary" Electric modes were lost (missing catenaries).
"Road" Road modes were lost (missing road).
"Train" Train modes were lost (missing train tracks).
"TramLanes" Tram modes were lost (missing tram lane).
"TramTrack" Tram track modes were lost (missing tram tracks).

LVMMode

enum global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:254

global enum LVMMode

Notes

Mode of the Line & Vehicle Manager tool, stored as {mode, param}.

Value Description
"MAIN" no line selected, not sending to line; the default state
"SEND_TO_LINE" selected vehicles to send to line or depot
"SEGMENT" segment selected (can add stops here)
"MOVE_STOP" grabbed a stop to be moved
"MOVE_WAYPOINT" grabbed a waypoint to be moved

LVM2D3DMode

enum global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:262

global enum LVM2D3DMode

Notes

Whether the Line & Vehicle Manager is operated in the panels (2D) or in the 3D world view; relevant for gamepad input.

Value Description
"2D" Focus in the manager panels.
"3D" Focus in the 3D world view (crosshair selection).

LVMSection

enum global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:267

global enum LVMSection

Notes

Section of the Line & Vehicle Manager that has the gamepad focus.

Value Description
"LM" line manager section
"VM" vehicle manager section
"LP" line panel section

LVMActionButtons

enum global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:273

global enum LVMActionButtons

Notes

Action button bar of the Line & Vehicle Manager that has the focus.

Value Description
"LMAB" line manager action buttons
"VMAB" vehicle manager action buttons
"LPLAB" line panel line action buttons
"LPDAB" line panel depot action buttons
"LPPAB" line panel placeholder action buttons
"NONE" focus not in any action buttons

LVMCountData

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:289

global record LVMCountData

Notes

Counts and selection ratios shown by the Line & Vehicle Manager (respecting the carrier and visibility filters).

Fields

Name Type Description
countLinesWithProblems integer considering all player lines
countLinesSelected integer Number of selected lines.
countLinesUnselected integer Number of unselected lines.
selectionRatioLines number Selected lines divided by all counted lines (0 if there are none).
countDepotsSelected integer considering all player depots
countDepotsUnselected integer Number of unselected depots.
selectionRatioDepots number Selected depots divided by all counted depots.
countVehiclesWithProblems integer considering vehicles of selected lines
countVehiclesSelected integer Number of selected vehicles in the vehicle list.
countVehiclesUnselected integer Number of unselected vehicles in the vehicle list.
selectionRatioVehicles number Selected vehicles divided by all vehicles in the list (0 if there are none).

ProblemCache

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:308

global record ProblemCache

Notes

Problem information the Line & Vehicle Manager refreshes a few lines per frame, to mark lines and vehicles with problems.

Fields

Name Type Description
vehiclesAndProblems {{{Engine.Entity}, VehicleProblem}} Result of api.engine.util.vehicle.getVehicleProblems().
vehiclesWithRoundTrips {Engine.Entity : integer} Vehicles with cargo round trips, from api.engine.system.simEntityAtVehicleSystem.getVehiclesWithRoundTripCount().
line2misconfiguredLines {Engine.Entity : {LineIssue}} Line issues of the player's lines, from api.engine.util.line.getLinesIssues.
line2detailedLineProblems {Engine.Entity : {{UtilLine.StopState}}} Per line, the result of api.engine.util.line.getDetailedLineProblems.
line2problem {Engine.Entity : boolean} True for lines with stop problems (no path, duplicate or incompatible stop) or line issues.
vehicle2problem {Engine.Entity : boolean} True for vehicles with a vehicle problem or a cargo round trip.
line2vehicleProblemCount {Engine.Entity : integer} Number of vehicles with problems per line.

LVMDisplayData

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:318

global record LVMDisplayData

No description in the game files yet.

Fields

Name Type Description
notificationProblemColor Vec4f
contrastColor Vec4f
textColor Vec4f
waypointColor Vec4f
selectedLineColor Vec4f

VehicleProblems

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:326

global record VehicleProblems

No description in the game files yet.

Fields

Name Type Description
vehicles2problem {Engine.Entity : boolean}
problemCount integer

LVMButtonIAs

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:331

global record LVMButtonIAs

Notes

Input action keys of the Line & Vehicle Manager's gamepad buttons; several buttons share a key and differ by 2D/3D mode.

Fields

Name Type Description
btn2D3D_Switch string Switch between 2D and 3D mode (IA_OPTION1).
btn2D_ActionButtons string Focus the action buttons in 2D mode (IA_OPTION2).
btn3D_Move string also locate
btn2D_MoreOptions string Hold for more options in 2D mode (IA_OPTION3).
btn3D_Configure string Configure in 3D mode (IA_OPTION3).
btn2D_NextSection string Next section in 2D mode (IA_OPTION4).
btn3D_Delete string Delete in 3D mode (IA_OPTION4).
btn2D_MoveStopHold string Hold to move a stop in 2D mode (IA_SELECT).
btnMore_SendToLine string More options, send to line (IA_OPTION1).
btnMore_NewLine string More options, new line (IA_OPTION2).
btnMore_DeleteSell string More options, delete line or stop / sell vehicle (IA_MENU_BACK).
btnMore_BuyVehicle string More options, buy vehicle (IA_SELECT).
modifier3D_PreferWaypoint string Modifier held in 3D mode to place waypoints (IA_PRECISION_MODE).

LVMDeleteSell

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:353

global record LVMDeleteSell

Notes

What the gamepad "delete / sell" button acts on, depending on the focused section (line list, vehicle list or line panel).

Fields

Name Type Description
focusedLine Engine.Entity Focused line in the line list (deleted).
focusedVehicle Engine.Entity Focused vehicle in the vehicle list (sold).
focusedStopLine Engine.Entity Line of the focused stop in the line panel.
focusedStopNumber integer 1-based path index of the focused stop.
focusedApiStopIndex0 integer 0-based engine stop index of the focused stop (nil for waypoints).

BufferedLVMSendData

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:362

global record BufferedLVMSendData

Notes

A send-to-line command that failed and is retried when the line is selected again.

Fields

Name Type Description
line Engine.Entity Target line.
vehicle Engine.Entity Vehicle to send.
stopToSend integer Stop index passed to api.cmd.makeVehicleSetLineCmd.

LVMDnDData

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:368

global record LVMDnDData

Notes

Line and revision at the start of a stop drag-and-drop in the line panel.

Fields

Name Type Description
dragStartLineEntity Engine.Entity Line whose stop is dragged.
dragStartLineRevision Engine.Revision Revision of the line when the drag started.

LVMIconPaths

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:373

global record LVMIconPaths

Notes

Icon paths used by the Line & Vehicle Manager; row* for list rows (20 px), reg* regular size, ab* action buttons, hud* HUD icons.

Fields

Name Type Description
rowRename string
rowConfigure string
rowMove string
rowDelete string
rowSelectTerminals string
rowLocate string
rowRemove string
rowCart string
problemAlert string
problemArrow string
regSelectTerminals string
regRename string
regAutoRename string
regFilterVisible string
regGradient string
regDragGrip string
abNewLine string
abSendToLine string
abBuyVehicles string
abFilterVisible string
abFilterRoad string
abFilterTram string
abFilterRail string
abFilterWater string
abFilterAir string
abReverse string
abStartStop string
abPaint string
abDuplicate string
abReplace string
abConfigure string
abSendToDepot string
abSell string
abAutoRename string
hudTerminal string
hudConfigureNone string
hudConfigure string
hudMove string
hudAdd string
hudRemove string

CommonActionParams

interface global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:420

global interface CommonActionParams

Notes

Shared state, refs and actions of the Line & Vehicle Manager, created once by the manager tool and passed to its panels, tooltips and HUD icons.

Fields

Name Type Description
gameCtx GameContext The game context.
parent ReactNodeRef Node of the manager tool.
lvmButtonIAs LVMButtonIAs Input action keys of the gamepad buttons.
iconPaths LVMIconPaths Icon paths of the manager.
lineState ReactStateT<Line.ReactLine> The line currently being edited (single selected line).
problemCacheState ReactStateT<ProblemCache> Line and vehicle problem cache.
countDataState ReactStateT<LVMCountData> Line, depot and vehicle counts.
gamepadInputModeState ReactStateT<boolean> True while gamepad input is used.
lvm2D3DModeState ReactStateT<LVM2D3DMode> Current 2D/3D mode.
lvmSectionState ReactStateT<LVMSection> Section with the gamepad focus.
lvmActionButtonsState ReactStateT<LVMActionButtons> Action button bar with the focus.
moreOptionsState ReactStateT<boolean> True while the "more options" button is held.
sendToLineHoveredLineState ReactStateT<Engine.Entity> Line hovered in the send-to-line popover.
addStopHoveredStationState ReactStateT<LineUtil.StationSelectionDetails> Station hovered while adding a stop.
preferLineOverTNEdgeState ReactStateT<boolean> Passed to the line viewer's preferLineOverTransportNetworkEdge.
creatingNewLineState ReactStateT<boolean> True while the player picks the first station of a new line.
gamepadNo3DSelectionInfoState ReactStateT<boolean>
vehicleManagerStateRef ReactRefT<VehicleManagerState> Vehicle list contents (selected and unselected vehicles).
lineManagerStateRef ReactRefT<LineManagerState> Line and depot list selection.
vehicleManagerRef ReactRefWrapApiT<VehicleManagerParams, VehicleManagerApi> Vehicle manager node; its API is VehicleManagerApi.
lineAndDepotListRef ReactRefWrapApiT<LineAndDepotListParams, LineAndDepotListApi> Line and depot list node; its API is LineAndDepotListApi.
vehicleStoreOpenForDepotAndLineRef ReactRefT<VehicleStoreOpenInfo> Depot and line the vehicle store is open for, or nil.
deleteSellRef ReactRefT<LVMDeleteSell> Target of the gamepad delete / sell button.
forceUpdateTag ReactRefT<string> Changing string used as local key to force HUD icons to rebuild.
bufferedSendDataRef ReactRefT<{BufferedLVMSendData}> Failed send-to-line commands waiting for a retry.
prevLvmModeRef ReactRefT<{LVMMode, any}>
lvmDnDDataRef ReactRefT<LVMDnDData> State of a running stop drag-and-drop.
configureLinesPopoverPosRef ReactRefWrap
sendToLinePopoverPosRef ReactRefWrap
btnBuyVehiclesRef ReactRefWrap
btnSendToLineRef ReactRefWrap
btnNewLineRef ReactRefWrap

Functions

switchMode(newMode : {LVMMode, any | LineUtil.StopSelectionDetails}) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:457

Notes

Switches the manager mode, e.g. {"SEGMENT", stopNumber} or {"MAIN", nil}.

switchToPrevMode() base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:458

Notes

Returns to the previous SEGMENT mode, otherwise to MAIN.

getModeState() : {LVMMode, any} base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:459

Notes

Returns the current {mode, param}.

Returns {LVMMode, any}

addFeedback(message : string, mode : string, dialogData : FeedbackListUtil.FeedbackDialogParam, id : number) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:460

Notes

Shows a message in the manager's feedback list (mode e.g. "Error", "Warning", "Question").

updateIA(newContext : LineUtil.GuiContextState) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:466

Notes

Sets the context state whose input actions the manager window applies.

onProcessMouseEvent(evt : Gui.Mouse.Event) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:467

No description in the game files yet.

Returns boolean

accessNotificationCacheFn(entity : Engine.Entity) : {Notification} base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:468

Notes

The game context's accessNotificationCacheFn.

Returns {Notification}

carrierFn() : {Carrier} base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:469

Notes

Returns the carriers allowed by the manager's category filter, or nil.

Returns {Carrier}

getDisableHudInteraction() : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:470

Notes

True while HUD icons should not react (gamepad input in 2D mode).

Returns boolean

resetLVMDnDData() base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:471

Notes

Clears lvmDnDDataRef.

getFirstStopToSendTo(vehicleToSendToLine : Engine.Entity, lineToSendTo : Engine.Entity) : integer base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:473

Notes

Returns the stop index a vehicle should start at on a line, using the "first stop to send" scheme for its carrier.

Returns integer

addDepotVehiclesToDepotVehicleCompare(depotEntity : Engine.Entity) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:478

Notes

Remembers the current vehicles of a depot for comparison.

removeDepotVehiclesFromDepotVehicleCompare(depotEntity : Engine.Entity) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:479

Notes

Forgets the remembered vehicles of a depot.

addVehicleToDepotVehicleCompare(vehicleEntity : Engine.Entity, depotEntity : Engine.Entity) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:480

Notes

Adds a vehicle to the remembered vehicles of a depot.

removeVehicleFromDepotVehicleCompare(vehicleEntity : Engine.Entity) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:484

Notes

Removes a vehicle from all remembered depot vehicles.

clearDepotVehicleCompare() base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:485

Notes

Forgets all remembered depot vehicles.

newLine(newLineStartingWithStation : LineUtil.StationSelectionDetails, vehicleEntities : {Engine.Entity}) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:487

Notes

Creates a new line starting at the station; the given vehicles are assigned to it.

selectLine(LineUtil.LineSelectionDetails, scrollToRow : boolean, selectSegment : integer) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:491

Notes

Selects a single line (optionally scrolling to its row and selecting a segment).

deleteGamepadFocusedLine() base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:496

Notes

Deletes the line focused with the gamepad, asking first if it has vehicles.

addStop(station : LineUtil.StationSelectionDetails, insertAtStopNumber : integer) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:498

Notes

Inserts a stop at the station after the given stop number (at the end if nil) and commits the line.

removeStop(stop : LineUtil.StopSelectionDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:502

Notes

Removes a stop; removing the last stop deletes the line if it has no vehicles.

moveStop(movingStop : LineUtil.StopSelectionDetails, station : LineUtil.StationSelectionDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:503

Notes

Moves a stop to another station or terminal.

moveVia(oldStopNumber : integer, newStopNumber : integer) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:504

Notes

Moves a path entry from one stop number to another.

addAlternativeTerminal(details : LineUtil.StationSelectionDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:505

Notes

Adds the terminal as alternative terminal of the stop selected in the current mode.

removeAlternativeTerminal(details : LineUtil.StationSelectionDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:506

Notes

Removes the terminal from the alternative terminals of the stop selected in the current mode.

selectAlternativeTerminal(stopNumber : integer, stationIndex1 : integer, terminalIndex1 : integer, add : boolean) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:507

Notes

Adds (add true) or removes an alternative terminal of the given stop (1-based indices).

changeMainTerminal(stopNumber : integer, stationIndex1 : integer, terminalIndex1 : integer) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:513

Notes

Sets the main station and terminal (1-based indices) of the given stop.

addWaypoint(waypoint : Waypoint, insertAtStopNumber : integer) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:518

Notes

Inserts a waypoint after the given stop number.

removeWaypoint(waypoint : LineUtil.WaypointSelectionDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:522

Notes

Removes the waypoint with the given tag.

moveWaypoint(movingWaypoint : LineUtil.WaypointSelectionDetails, apiWaypoint : Waypoint) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:523

Notes

Replaces the waypoint at the given stop number with a new position.

addOrRemoveVehicleToVehicleList(vehicleDepotDetails : LineUtil.VehicleDepotDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:525

Notes

Adds a vehicle to the vehicle list (selected) or removes it.

addOrRemoveDepotVehiclesToVehicleList(vehicleDepotDetails : LineUtil.VehicleDepotDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:528

Notes

Adds all vehicles of a depot to the vehicle list or removes them.

addOrRemoveLineVehiclesToVehicleList(lineEntity : Engine.Entity, removeFromList : boolean, clearList : boolean) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:531

Notes

Adds all vehicles of a line to the vehicle list or removes them, optionally clearing the list first.

isVehicleSelected(vehicleEntity : Engine.Entity) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:536

Notes

True if the vehicle is selected in the vehicle list.

Returns boolean

isVehicleInVehicleList(vehicleEntity : Engine.Entity) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:537

Notes

True if the vehicle is in the vehicle list.

Returns boolean

selectOrDeselectVehicleInVehicleList(vehicleEntity : Engine.Entity, selectVehicle : boolean) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:538

Notes

Selects or deselects a vehicle in the vehicle list.

areAllDepotVehiclesInVehicleList(vehicleDepotEntity : Engine.Entity) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:542

Notes

True if the depot has vehicles and all of them are in the vehicle list.

Returns boolean

openVehicleDepot(depotEntity : Engine.Entity, lineEntity : Engine.Entity) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:544

Notes

Opens the vehicle store for the depot; bought vehicles are added to the list and sent to the line if one is given.

areAnyVehiclesInDepot(vehicleDepotEntity : Engine.Entity) : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:548

Notes

True if the depot contains vehicles.

Returns boolean

selectOrDeselectDepot(vehicleDepotDetails : LineUtil.VehicleDepotDetails) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:549

Notes

Selects or deselects a depot in the line and depot list.

sendVehiclesToLine(selection : {Engine.Entity}, lineEntity : Engine.Entity) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:551

Notes

Sends the vehicles to the line, using the "first stop to send" scheme.

sendVehiclesToDepot(selection : {Engine.Entity}, depotEntity : Engine.Entity) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:555

Notes

Sends the vehicles to a depot and returns to MAIN mode.

openWarehouse(warehouseEntity : Engine.Entity) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:560

Notes

Closes the vehicle store and opens the entity window of the warehouse.

sellVehicle(vehicleEntity : Engine.Entity) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:561

Notes

Sells the vehicle and removes it from the vehicle list.

openCargoFilter(where : LineUtil.StopSelectionDetails, pos : Vec2f, onClose? : function()) base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:562

Notes

Opens the cargo filter (stop configuration) window for a stop.

closeCargoFilter() base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:566

Notes

Closes the cargo filter window.

btnNewLineEnabled() : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:568

Notes

True if "New Line" is available (not already creating one and not disabled by the game context).

Returns boolean

btnNewLineOnClick() base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:569

Notes

Clears the selection and starts creating a new line.

btnSendToLineEnabled() : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:570

Notes

True if vehicles are selected and sending is not blocked.

Returns boolean

btnSendToLineOnClick() base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:571

Notes

Opens the send-to-line popover for the selected vehicles.

btnBuyVehiclesEnabled() : boolean base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:572

Notes

True if a single line or a depot is selected.

Returns boolean

btnBuyVehiclesOnClick() base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:573

Notes

Opens the vehicle store at the best depot for the selected line, or at the selected depot.

LineManagerPanelParams

record global base/tealdef/gui/line_vehicle_mgmt/line_util.d.tl:576

global record LineManagerPanelParams

Notes

Parameters of the line panel of the Line & Vehicle Manager (line_manager_panel.tl).

Fields

Name Type Description
commonParams CommonActionParams Shared manager state and actions.