I'm currently developing a mod in Factorio and I've run into an issue I haven't been able to solve for a couple of days now. I have a list of entity prototypes in an array in control.lua obtained from a selection or a blueprint object list. My goal is to count the number of entities by type and create a table where one of the cells in each row contains a button with the entity's icon (be it an entity or a tile).
Here's a snippet of my code:
Code: Select all
for type, count in pairs(entities) do
local prototype = defines.prototypes.entity[type]
if prototype ~= nil then
-- ...
end
end
Does anyone know where I can obtain the entity's icon? Any help would be greatly appreciated!
Thank you!