Page 1 of 1

[2.1.11] Bar on "inventory" LuaGuiElement is not drawn with custom empty_slot sprite

Posted: Sun Jul 19, 2026 7:11 pm
by Shemp
Steps to reproduce:
  • Enter a world and place a Requester chest
  • Hover over the chest and run
  • /c chest = game.player.selected
  • Create a mod GUI inventory with the commands
  • /c frame = game.player.gui.screen.add{type = "frame", caption = "Test"}
  • /c inv = frame.add{type = "inventory", slots_per_row = 10, empty_slot_info = {sprite = "utility/empty_module_slot"}}
  • /c inv.inventory = chest.get_inventory(defines.inventory.chest)
Clicking the red X in either the mod GUI or the real chest followed by a corresponding inventory slot will successfully change the bar (the red slots limited from insertion).
inventory-bar-not-drawn.png
inventory-bar-not-drawn.png (220.14 KiB) Viewed 131 times
However, these slots are not drawn in the mod GUI because an empty slot sprite has been defined.
Clearing the sprite using /c inv.empty_slot_info = nil produces the expected behaviour:
inventory-bar-does-draw.png
inventory-bar-does-draw.png (20.06 KiB) Viewed 131 times
(Ignore that the bar is in a different place, I moved it.)

Re: [2.1.11] Bar on "inventory" LuaGuiElement is not drawn with custom empty_slot sprite

Posted: Sun Jul 19, 2026 8:31 pm
by Rseding91
Thanks for the report however I'm not sure if this is fixable. GUIs were never designed to have both bars and empty slot info at the same time - as such - the logic to handle it just doesn't exist. The bar color is part of the slot style and by having empty slot info defined *that* style is always drawn.