Repository navigation
API Add on windows
🇩🇪 Deutsche Version · ⬅ For mod authors
Note
New in 0.0.20.
An add-on can have its own section in the station window and its own tab in the UTL Manager. UTL creates the space, the add-on builds the content.
| Function | Effect |
|---|---|
register_gui_section{ mod, interface, build } |
section in the station window (right column or tab "Values", below the UTL sections) |
register_manager_tab{ mod, interface, build, caption } |
tab in the UTL Manager, after the UTL tabs; caption = label (LocalisedString) |
Register both in on_init and on_configuration_changed. If the function build does not exist in
the interface, registering returns false and "unknown-function".
| When | Call |
|---|---|
| the station window is opened or rebuilt |
remote.call(interface, build, flow, station_unit, player_index) – flow is an empty vertical flow. If it stays empty, it disappears again (e.g. for stations without your role). |
| the manager tab is selected or ⟲ is pressed |
remote.call(interface, build, flow, player_index) – flow is the cleared content of the tab (880 × 560). It is not refreshed on a timer. |
remote.add_interface("my-mod", {
station_section = function(flow, unit, player_index)
local data = remote.call("utl", "get_station_data", unit, "my-mod")
if not data then return end -- add nothing: the section disappears
flow.add({ type = "label", caption = { "my-mod.tracks", data.tracks } })
end,
manager_tab = function(flow, player_index)
flow.add({ type = "label", caption = "Sidings: …" })
end,
})
remote.call("utl", "register_gui_section", { mod = "my-mod", interface = "my-mod", build = "station_section" })
remote.call("utl", "register_manager_tab", { mod = "my-mod", interface = "my-mod", build = "manager_tab",
caption = { "my-mod.tab" } })Input (clicks, checkboxes, text fields) in your own elements is handled by the add-on itself with
its GUI events. The station window's flow carries the tag { utl_addon = mod }. If the content
should change after input, the add-on rebuilds it in its flow itself.
Unified Train Logistics · version / Version 0.0.27 · made with AI help, tested by Marcel / mit KI-Hilfe erstellt, von Marcel getestet · Mod portal · GitHub
🇬🇧 English
- Quick start
- Stations and roles
- Networks
- Mixed providers and job output
- How trains run
- Fuel, cleanup and depots
- Storage
- Blueprints with parameters
- Network combinator
- UTL Manager and alerts
- Settings
- Teams and surfaces
- Space elevator
- Scenarios and tips
- FAQ and troubleshooting
-
For mod authors
- Queries · Configuring · Events
- Windows and helpers
- Add-ons: roles and data · trips · rebuilding trains · windows
- Performance · Signal icons · Examples
🇩🇪 Deutsch
- Schnellstart
- Stationen und Rollen
- Netzwerke
- Gemischte Anbieter und Auftrags-Ausgabe
- Wie die Züge fahren
- Tanken, Cleanup und Depots
- Lager
- Blaupausen mit Parametern
- Netz-Kombinator
- UTL-Manager und Warnungen
- Einstellungen
- Teams und Oberflächen
- Weltraumaufzug
- Szenarien und Tipps
- Häufige Fragen und Fehlersuche
-
Für Mod-Autoren
- Abfragen · Einstellen · Ereignisse
- Fenster und Hilfen
- Add-ons: Rollen und Daten · Fahrten · Züge umbauen · Fenster
- Leistung · Signal-Symbole · Beispiele