vehicle_store¶
Source: base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl
Notes
Shared types of the vehicle store (buy / replace / modify vehicles window): store mode, browser filter and sort settings, and the shopping-cart API.
VehicleStore¶
record global base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:3
global record VehicleStore
Notes
Shared types of the vehicle store window.
VehicleStore.VehicleStoreMode¶
enum base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:4
enum VehicleStoreMode
Notes
What the store window does with the chosen vehicles.
Used in the base game: 7 times in 2 files
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_window.tl:59
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_table.tl:10
VehicleStore.CanBuy¶
record base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:10
record CanBuy
Notes
Result of VehicleCartApi.canBuyVehicle.
Used in the base game: 3 times in 1 file
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_window.tl:859
Fields
VehicleStore.VehicleBrowserFilter¶
record base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:16
record VehicleBrowserFilter
Notes
Current filter of the vehicle browser; evaluated per vehicle by VehicleStoreUtil.vehicleFilter.
Used in the base game: 27 times in 2 files
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_window.tl:55
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_util.tl:693
Fields
| Name | Type | Description |
|---|---|---|
text |
string |
Search text; vehicles whose name does not contain it are hidden. Empty string for no search. |
transportModes |
{TransportMode : boolean} |
Transport modes of the depot or vehicles; a vehicle must share at least one enabled mode. |
carrier |
Carrier |
Carrier the vehicles must use. |
cargoFilters |
{CargoTypeId : boolean} |
Selected cargo types; a vehicle must be able to carry all of them. |
engines |
{VehicleEngineType | string : boolean} |
Selected engine types (VehicleEngineType); if any is set, a vehicle must have at least one of them. |
multipleUnits |
boolean |
Include multiple units. |
onlyMultipleUnits |
boolean |
Show only multiple units. |
onlyLightrail |
boolean |
Show only vehicles all of whose parts can run on tram tracks (set by the Light Rail toggle in tram depots). |
singleVehicles |
boolean |
Include single vehicles (not multiple units). |
filterTags |
{string} |
Filter tags of the depot or of the vehicles being replaced; see VehicleStoreUtil.depotMatchesVehicleFilterTags. |
withEngine |
boolean |
If not nil, a vehicle must (true) or must not (false) have an engine. |
withCapacity |
boolean |
If not nil, a vehicle must (true) or must not (false) have capacity. |
withPassengerCapacity |
boolean |
Set by the tab handlers to select passenger vehicles; with withCargoCapacity it chooses the table layout and whether cargo filters are shown. |
withCargoCapacity |
boolean |
Set by the tab handlers to select cargo vehicles; makes the cargo filters visible and chooses the cargo table layout. |
vehicleFilter |
GameContext.Filters.VehicleFilter |
Global enabled / disabled vehicle lists from the game context (matched against the model or multiple-unit path). |
VehicleStore.VehicleBrowserSort¶
record base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:36
record VehicleBrowserSort
Notes
Sort order of the vehicle browser.
Used in the base game: 14 times in 1 file
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_window.tl:58
Fields
| Name | Type | Description |
|---|---|---|
mode |
VehicleBrowserSortMode |
Sort mode. |
ascending |
boolean |
Sort ascending. |
groupTypes |
boolean |
Set to true by the store window; not read by base-game code. |
VehicleStore.VehicleBrowserSort.VehicleBrowserSortMode¶
enum base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:37
enum VehicleBrowserSortMode
Notes
Value the vehicles are sorted by. Vehicles are first grouped into buckets (no capacity, passengers, mixed, cargo); see VehicleStoreUtil.getPrimaryBucket.
Used in the base game: 1 time in 1 file
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_window.tl:2012
VehicleStore.CartInfo¶
record base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:58
record CartInfo
Notes
Price information for the buy button of a vehicle row in the store table.
Used in the base game: 2 times in 2 files
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_window.tl:4152
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_table.tl:248
Fields
VehicleStore.VehicleCartApi¶
record base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:67
record VehicleCartApi
Notes
API of the store's shopping cart node; the browser and the table call it.
Used in the base game: 9 times in 2 files
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_window.tl:62
base/content/gui/gui/line_vehicle_mgmt/vehicle_store_table.tl:12
Functions
getVehiclesFromCart(index? : integer) : {{TransportVehiclePart}} base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:68
Notes
Parts of one cart entry, grouped per parts list (one list per single vehicle or multiple unit).
| Parameter | Type | Description |
|---|---|---|
index? |
integer |
One-based cart entry; default 1. |
Returns {{TransportVehiclePart}}: The parts lists, or nil if the cart is empty.
selectVehicleForBuying(modelId : integer, muFileName : string, color : Vec3f) base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:69
Notes
Remembers the model, multiple-unit file and colour that the "buy immediately" action will buy.
canBuyVehicle(modelId : integer, amount : integer) : CanBuy base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:70
Notes
Checks money and mission restrictions for buying amount vehicles of a model.
Returns CanBuy: A CanBuy record.
addVehicleToCart(modelId : integer, multipleUnit : boolean, multipleUnitFileName : string, color : Vec3f, buyImmediately : boolean, amount : integer) base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:71
Notes
Adds a vehicle or multiple unit to the cart, or buys it immediately.
| Parameter | Type | Description |
|---|---|---|
modelId |
integer |
Model id, or multiple-unit id if multipleUnit is true. |
multipleUnit |
boolean |
True if modelId is a multiple unit. |
multipleUnitFileName |
string |
File name of the multiple unit. |
color |
Vec3f |
Colour of the new parts. |
buyImmediately |
boolean |
If true, buys amount vehicles (or replaces all vehicles to replace) right away instead of adding to the cart. |
amount |
integer |
Number of vehicles to buy immediately. |
getReplaceAmount() : integer base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:79
Notes
Number of vehicles being replaced (1 outside Replace mode).
Returns integer
getCartInfo(canBuy : VehicleStore.CanBuy) : VehicleStore.CartInfo base/tealdef/gui/line_vehicle_mgmt/vehicle_store.d.tl:80
Notes
Builds price information from a CanBuy result.
Returns VehicleStore.CartInfo: CartInfo with totalPrice, refund, notEnoughMoney and viable set.