[2.0.71] duplicate custom_tooltip_fields on equipment prototypes

Post your bugs and problems so we can fix them.
User avatar
Quezler
Filter Inserter
Filter Inserter
Posts: 290
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

[2.0.71] duplicate custom_tooltip_fields on equipment prototypes

Post by Quezler »

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.

Code: Select all

data.raw["solar-panel-equipment"]["solar-panel-equipment"].custom_tooltip_fields = {{
  name = "foo",
  value = "bar",
}}
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:

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
Attachments
Screenshot 2025-10-19 at 14.38.49.png
Screenshot 2025-10-19 at 14.38.49.png (39.39 KiB) Viewed 180 times
Screenshot 2025-10-19 at 14.38.01.png
Screenshot 2025-10-19 at 14.38.01.png (12.99 KiB) Viewed 180 times
Post Reply

Return to “Bug Reports”