Overview
The Transit app puts the railway’s departure boards on every player’s phone. Open it and you see one card per station, sorted by how far away it is, each showing the next train, its status and how long until it arrives.
It does no scheduling of its own. It simply shows what dps-trains reports, so the times on the phone match what actually turns up on the platform.
Features
- One card per station, sorted by distance from the player and labelled in metres or kilometres.
- Each card shows the next service: its name, a status and an arrival time.
- Stations are tagged
REGIONALfor the mainline orLIGHT RAILfor the other lines. - Services have their own icons: Metro, Axsellya Express, Brown Streak and Freight.
- Status reads “boarding”, “delayed”, “next stop” or “N stops away”.
- Arrival time reads “Due” under 45 seconds, otherwise minutes; stations with nothing coming read “No service”.
- Refreshes every 5 seconds while open.
- Installed on every phone by default, and re-added automatically if lb-phone restarts.
- Keeps working, showing “No service”, if
dps-trainsis stopped.
How it works
- When lb-phone starts, the resource registers a custom app called Transit.
- A player opens it and the app asks the server for the arrival board.
- The server reads
getArrivalBoard()fromdps-trains, and the client sorts the stations by distance before showing them.
Requirements
lb-phonewith custom app supportox_libdps-trains(for itsgetArrivalBoard()export)
Installation
- Put the folder in your resources directory and keep the name
dps-transitapp. The app’s page calls back to the resource by that exact name. - In
server.cfg, ensure it afterlb-phoneanddps-trains. - Restart the server. No other setup is needed.
dps-trains is deliberately not a hard dependency: if it were, restarting the railway would remove the app from every phone.
Configuration
There is no config file. The app id (dps_transit), name (Transit), default install and icon are set in client.lua. The 5-second refresh and the 45-second “Due” threshold are in ui/index.html.
Credits
Written by DaemonAlex for Del Perro Sands.