[2.0.71] duplicate custom_tooltip_fields on equipment prototypes
Posted: Sun Oct 19, 2025 12:41 pm
I was trying to update the Jetpack mod to have the thrust description in a custom tooltip instead of hardcoded into the locale.
It appears that custom tooltips applied to equipment prototypes show up twice in the description of the item instead of once.
Originally i figured i would have had to apply them to both seperately but it looks like descriptions merge them automatically,
in the end i'll probably only have to set it on the jetpack_equipment (battery) for it to show on items as well, but even then it would show twice:
It appears that custom tooltips applied to equipment prototypes show up twice in the description of the item instead of once.
Code: Select all
data.raw["solar-panel-equipment"]["solar-panel-equipment"].custom_tooltip_fields = {{
name = "foo",
value = "bar",
}}in the end i'll probably only have to set it on the jetpack_equipment (battery) for it to show on items as well, but even then it would show twice:
Code: Select all
for _, prototype in pairs({jetpack_item, jetpack_equipment}) do
prototype.custom_tooltip_fields = prototype.custom_tooltip_fields or {}
table.insert(prototype.custom_tooltip_fields, {
name = {"description.thrust"},
value = tostring(jep.thrust) .. " i am from " .. prototype.type,
})
end