Skip to content

API Signal icons

Marcel1853 edited this page Oct 21, 2026 · 3 revisions

🇩🇪 Deutsche Version · ⬅ For mod authors

Signal icons (data stage)

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).

UTL signals with your own icons

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"].

Own signals in the matching style

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".

Clone this wiki locally