ID:1691249
 
I noticed I've been asking a lot of questions lately but i really don't know if im doing things the optimal way.

I want to put objs in a tab that aren't made yet. I've already did this with clothes and hair but is it really the best way to go about it?

mob
Stat()
.=..()
if(aes == 1)
statpanel("Aesthetics")
stat("Clothes")
for(var/obj/o in clothes)
stat(o)
stat("Hair")
for(var/obj/o in hair)
stat(o)


var
list/clothes = list(new/obj/Inventory/overlays/clothes/Shirt, etc..)


Problem is I have to add every single clothes to the list and anytime I have to do something a bunch of times I feel like its ineffective. Is there any way to place a whole type of obj in a tab without listing them all like that?
I do it like this.
var/list/Clothes=typesof(/obj/Inventory/overlays/clothes)-/obj/Inventory/overlays/clothes
proc/PopulateClothes()
for(var/v in Clothes)
Clothes+=new v
Clothes-=v

And now we must start our proc.
world
New()
spawn() PopulateClothes()


mob
Stat()
statpanel("Aesthetics")
stat("Clothes")
for(var/obj/o in Clothes)
stat(o)