I am currently working on a script to identify items or entities that cannot have their own elem_tooltip. I have implemented the following code:
Code: Select all
local function filter_unknown_prototype_name(prototype_name)
if prototype_name == "elevated-straight-rail"
or prototype_name == "straight-rail"
or prototype_name == "elevated-curved-rail-a"
or prototype_name == "elevated-curved-rail-b"
or prototype_name == "curved-rail-a"
or prototype_name == "curved-rail-b"
or prototype_name == "elevated-half-diagonal-rail"
or prototype_name == "half-diagonal-rail"
then return "rail" end
return prototype_name
end
...
gui.add{
...
elem_tooltip = {
type = 'item-with-quality',
name = filter_unknown_prototype_name(prototype.name),
quality = quality.name,
}
}
Does anyone have suggestions on how to achieve this? Any guidance or tips would be greatly appreciated!
Thank you in advance for your help.