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

We are aware of them, but do not have solutions that don't cause other issues. They go here in order not to take space in the main bug thread list.
User avatar
Shemp
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Mon Jan 19, 2026 6:51 pm
Contact:

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

Post 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 129 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 129 times
(Ignore that the bar is in a different place, I moved it.)
Rseding91
Factorio Staff
Factorio Staff
Posts: 17240
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Minor issues”