Here is the code I am using at the moment, which works but not as desired:
Code: Select all
if event.element.parent.name == "registry" then
e_registry = event.element.parent
e_schematic = event.element
...
local l_inventory = global.blueprinter.inventory[ l_player.index ].get_inventory( defines.inventory.player_main )
...
-- Update GUI
for xi, xv in ipairs(e_registry.children_names) do
local l_schematic = e_registry[xv]
if l_schematic.icons then
l_schematic.icons.destroy()
end
if l_inventory[xi] and l_inventory[xi].valid_for_read and
l_inventory[xi].type == "blueprint" and l_inventory[xi].is_blueprint_setup()
then
local icon_quad = l_schematic.add{type="table", name="icons", colspan=2, style="slot_table_style"}
for ik, iv in pairs(l_inventory[xi].blueprint_icons) do
icon_quad.add{type="button", name="icon_"..iv.name, style="bpr_gs_"..iv.name}
end
end
end