proc/UpdateInventory()
var/itemCount = 0
winset(src, "default.winInventory", "current-cell=1,1")
src << output("Inventory:", "default.winInventory")
for (var/obj/item/I in src.inventory)
++itemCount
winset(src, "default.winInventory", "current-cell=[itemCount+1],1")
src << output(I, "default.winInventory")
Problem description:
Alright, so I've seen there's alot of issues with implementing interactive inventory in a grid, but I am still unsure of the cause.
Currently, The item is output to the inventory grid properly; however, I want access to it's popup menu and Click() proc.
I was reading that there is a common mistake of making an object variable with a limited scope, which inevitably gets destroyed at the end of the proc. I think that might be what I'm doing here, I'm just not really sure if I is a reference or a shallow copy of the actual item in src.inventory.
Here is the code for anyone else who might run into this problem.