ID:178355
 
I'm using the following code for an inventory panel:

mob
Stat()
statpanel("Inventory")
for(var/obj/Items/M in src.contents)
stat(M)
return ..()

I want to make the panel display only one instance of each type of item while also showing the total number of each type of item in the inventory (eg: [item]X1, [item]X2, etc.). This isn't a really hard thing to code, but I couldn't think of an efficient way to do it, and since the statpanel would be updated every 0.1 seconds per person playing, I don't want to add anything too elaborate. Any suggestions would be greatly appreciated. Thanks.

- Gakumerasara