ID:1675661
 
(See the best response by Kaiochao.)
Is it possible to partition the inventory tab? I tried by using istype then even lists to displaying whats in them but I can only do it using for and it causes problems. If doesn't seem to work.
If you want control over every item listed in a tab, you shouldn't be using statpanel("Inventory", contents), you should be using stat(item).
mob/Stat()
..()
// basic list
// can also be written as statpanel("Inventory", contents)
statpanel("Inventory")
for(var/item in src)
stat(item)

If you need more help, you're going to have to explain better what exactly you're trying to do.
mob/Stat()
if(statpanel("Inventory"))
for(var/resources in src)
stat("Resources")
stat(resources)



I want to be able to partition (with a title for each) the inventory tab while having control over whats being put in. It becomes a problem because when I'm using for it does it for every single item. I want to know if I can make a header for it without it repeating, and disappears when there is no item under the specific header.
In response to Gluscap
Best response
If you want something to not repeat, then... don't put it in the loop. Code tabbed under for() is generally repeated a number of times, in case you didn't know.

if(locate(/obj/resource) in src)
stat("Resources")
for(var/obj/resource/r in src)
stat(r)
Yeah, I realized that it was a loop. Which is why I was trying to use if() instead, didn't realize I could use locate though. Thanks!