Page 1 of 1

Add LuaGuiElement type for InventorySlot?

Posted: Tue Aug 11, 2026 8:47 pm
by PennyJim
This is a far fetched request, I understand. I'll give you my use case because I can see ways it'd be implemented with the currently existed Inventory element.

I'm trying to recreate the crafter gui (I fear the point where I start considering the remote GUI) because I have a compound entity that uses an offshore pump and chain of boilers to implement multiple energy sources (eg a "maintenance" that you need to regularly top up).

I've run into the problem of crafter inventories being filtered in an alternative way and not inheriting the faded sprite: 135616
Alongside the fact that I need to somehow add the FluidboxGuiSlots to the table.

Adding a separate element type for inventory slot would allow me to manually create the table so I can add arbitrary elements into it (like a sprite button for the fluidboxes), as well as manually control the styles of the input slots to use the red_inventory_slot for unsatisfied ingredients. At the same time, it would let me continue to let the engine handle the very basic inventory actions so they can be unaffected by latency.

I do see this being possible with the existing inventory element if the `add` were to add elements to the internal table instead of in the frame's vertical flow (after the scroll pane) and some method of individually defining styles for slots.

Re: Add LuaGuiElement type for InventorySlot?

Posted: Wed Aug 12, 2026 2:27 am
by protocol_1903
+1, pointing to specific inventory slots would be nice. Even if separated from the Inventory type for implementation reasons. I can think of trying to link to specific slots in the player's inventory/guns/ammo that would also benefit from the 1-slot approach.

Re: Add LuaGuiElement type for InventorySlot?

Posted: Wed Aug 12, 2026 6:59 pm
by Osmo
+1, inventories are great, and cover a lot of usecases, but they'tr not always enough, and having single slots would cover the rest of the usecases.
I can see it being a probelm to specify the slot though, since LuaItemStack doesn't always point at an inventory. But if it would only handle the rendering that'd also be good.

Re: Add LuaGuiElement type for InventorySlot?

Posted: Wed Aug 12, 2026 7:30 pm
by PennyJim
Osmo wrote: Wed Aug 12, 2026 6:59 pm I can see it being a probelm to specify the slot though, since LuaItemStack doesn't always point at an inventory.
I always imagined it being an inventory and slot index pair. Didn't even consider the idea of using LuaItemStacks.

I also was considering fluidbox slots.. We know there's an internal widget for them because of the gui debug tools, but I wonder how much more effort than inventory slots a fluidbox slot would be.