Repository navigation
API Signal icons
🇩🇪 Deutsche Version · ⬅ For mod authors
UTL has two styles for its signals, chosen with the startup setting "Signal style"
(utl-signal-style): "classic" (composed from vanilla images) and "flat" (flat like the vanilla
signals).
Other mods may replace the icons of the UTL signals. For this UTL creates the mod-data prototype
named utl-signal-icons. In data.lua or data-updates.lua of your mod (with a dependency on
UTLogistics):
local icons = data.raw["mod-data"]["utl-signal-icons"].data
-- one icon for both styles
icons["utl-max-trains"] = { { icon = "__my-mod__/graphics/max-trains.png", icon_size = 64 } }
-- a separate one per style (new in 0.0.20); if one is missing, UTL's icon stays there
icons["utl-loading"] = {
classic = { { icon = "__my-mod__/graphics/loading-classic.png", icon_size = 64 } },
flat = { { icon = "__my-mod__/graphics/loading-flat.png", icon_size = 64 } },
}Key = name of a UTL signal (utl-…), value = an icons list as for any prototype, or a table with
classic and/or flat. UTL applies the entries in data-final-fixes.lua; unknown signals or invalid
lists are skipped with a note in the log. At runtime the entries are in
prototypes.mod_data["utl-signal-icons"].
An add-on with its own signals (e.g. for its own role) can read the style in its data stage itself – other mods' startup settings are readable there:
local flat = settings.startup["utl-signal-style"] and settings.startup["utl-signal-style"].value == "flat"
data:extend({ {
type = "virtual-signal",
name = "my-mod-siding",
icon = flat and "__my-mod__/graphics/siding-flat.png" or "__my-mod__/graphics/siding.png",
icon_size = 64,
subgroup = "virtual-signal",
} })The signal can then be shown in the rich text of the role's caption:
caption = "[virtual-signal=my-mod-siding] Siding".
Unified Train Logistics · version / Version 0.0.25 · 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