Skip to content

line

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

Notes

Types for the GUI-side copy of a line that the Line & Vehicle Manager edits before it is sent to the engine with api.cmd.makeLineCreateCmd / api.cmd.makeLineUpdateCmd.

Line

record global base/tealdef/gui/line_vehicle_mgmt/line.d.tl:3

global record Line

Notes

Namespace for the GUI-side line types used by the Line & Vehicle Manager.

Line.PassThroughStopData

record base/tealdef/gui/line_vehicle_mgmt/line.d.tl:4

record PassThroughStopData

Notes

Stop settings that the line editor does not change itself but must keep, so that the update command can carry them over to the engine Line.Stop.

Fields

Name Type Description
minWaitingTime number Minimum waiting time at the stop, copied from / to Engine.Component.Line.Stop.minWaitingTime.
maxWaitingTime number Maximum waiting time at the stop, copied from / to Engine.Component.Line.Stop.maxWaitingTime.
maxAdditionalWaitingTime number Maximum additional waiting time at the stop, copied from / to Engine.Component.Line.Stop.maxAdditionalWaitingTime.
stopConfig Engine.Component.Line.StopConfig Cargo load configuration of the stop (load, maxLoad, forceUnload per cargo type), as in Engine.Component.Line.Stop.stopConfig.
loadMode Engine.Component.Line.LoadMode Load mode of the stop, copied from / to Engine.Component.Line.Stop.loadMode.

Line.ReactTerminal

record base/tealdef/gui/line_vehicle_mgmt/line.d.tl:12

record ReactTerminal

Notes

One stop of a Line.ReactLine, using 1-based station and terminal indices (the engine uses 0-based ones).

Used in the base game: 4 times in 1 file

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

local stop : Line.ReactTerminal = {}

Fields

Name Type Description
stationGroup Engine.Entity Entity of the station group the stop belongs to.
station1 integer 1-based index in stationGroup
terminal1 integer 1-based index in station
alternativeTerminals {StationTerminal} Additional terminals (0-based StationTerminal values) the vehicle may use at this stop.
loadMode Engine.Component.Line.LoadMode Load mode of the stop; overridden by passThroughStopData.loadMode when that is set.
passThroughStopData PassThroughStopData not used by line editor, but need to store them so we can create the updateline command

Line.ReactVia

record base/tealdef/gui/line_vehicle_mgmt/line.d.tl:23

record ReactVia

Notes

One entry of a line path; either stop or waypoint is set.

Used in the base game: 13 times in 3 files

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

viaState : ReactStateT<{Line.ReactVia}>
base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:6975
local newPath : {Line.ReactVia} = {}
base/content/gui/gui/line_vehicle_mgmt/line_util.tl:93
local path : {Line.ReactVia} = {}

Fields

Name Type Description
waypoint Waypoint nil if not a waypoint
stop ReactTerminal The stop, or nil if this entry is a waypoint.

Line.ReactLine

record base/tealdef/gui/line_vehicle_mgmt/line.d.tl:28

record ReactLine

Notes

Editable copy of a line as the Line & Vehicle Manager holds it. Create one from the game state with LineUtil.getReactLineFromGameState.

Details

Unlike the engine LINE component, waypoints are separate entries of path instead of being attached to the preceding stop. LineUtil.autoAssignTerminals converts the path back to Engine.Component.Line.Stop entries.

Used in the base game: 21 times in 2 files

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

local reactLineState, reactLineCommit : (ReactStateT<Line.ReactLine>) = engine_react_util.useStepState(
base/content/gui/gui/line_vehicle_mgmt/line_util.tl:87
line_util.getReactLineFromGameState = function(lineEntity : Engine.Entity) : Line.ReactLine

Fields

Name Type Description
entityAndRevision EntityUtil.EntityAndRevision Line entity and the revision the copy was made from; nil for a line that is not created yet.
path {ReactVia} Stops and waypoints of the line in driving order ("stop number" = 1-based index into this list).
customFilters boolean Whether the cargo loading of the stops was configured by hand. When true, LineUtil.autoLoadConfig leaves the stop configuration unchanged.
reservationPriority number Reservation priority of the line, passed to Engine.Component.Line.reservationPriority; new lines use 1.0.
maxWaypointTag integer Highest waypoint tag used in the line (-1 if there are none); new waypoints get the next tag.
color Vec3f Colour of a new line; filled with LineUtil.makeLineColor when the line is created.
carrierFilter {Carrier : boolean} Carriers served by the line's stops, as computed by LineUtil.getLineCarriers.

Line.DnDLineStop

record base/tealdef/gui/line_vehicle_mgmt/line.d.tl:40

record DnDLineStop

Notes

Drag-and-drop payload used when a stop is dragged in the line panel of the Line & Vehicle Manager (resource ::/dnd_line_stop.res).

Used in the base game: 5 times in 2 files

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

local data : Line.DnDLineStop = {
base/content/gui/gui/line_vehicle_mgmt/dnd_line_stop.res.lua:2
-- represents a line stop being dragged / dropped (uses Line.DnDLineStop as payload type to transfer data)

Fields

Name Type Description
lineEntity Engine.Entity Line the dragged stop belongs to.
lineRevision Engine.Revision Revision of the line when the drag started.
stopNumber integer 1-based index of the dragged entry in Line.ReactLine.path.
apiStopIndex0 integer 0-based index of the stop in the engine LINE component.