[2.0.23] Crash with sprite-button elem_tooltip and virtual signals
Posted: Fri Nov 29, 2024 1:23 am
Consider this code:
crashes with
}} basically, it expects a "signal_type" key in the elem_tooltip element. Which is defined as an ElemID (https://lua-api.factorio.com/latest/con ... lemID.html) that has no such thing.
(I won't comment on the identity confusion of virtual signals, that are called 'virtual', 'signal' or 'virtual-signal' in various places of the API ... )
Code: Select all
local button = {
type = "sprite-button",
sprite = 'virtual-signal'/" .. signal_name,
number = signal.count,
tooltip = prototypes.virtual_signal[signal_name].localised_name,
button.elem_tooltip = {
type = 'signal',
name = signal_name,
},
}
}} basically, it expects a "signal_type" key in the elem_tooltip element. Which is defined as an ElemID (https://lua-api.factorio.com/latest/con ... lemID.html) that has no such thing.
(I won't comment on the identity confusion of virtual signals, that are called 'virtual', 'signal' or 'virtual-signal' in various places of the API ... )