Version 1
if(items_tab_on)
statpanel("Items")
if(statpanel("Items")) if(!afk)
for(var/obj/Resources/A in src)
A.suffix="[Commas(A.Value)]"
stat(A)
for(var/obj/Mana/M in src)
M.suffix="[Commas(M.Value)]"
stat(M)
for(var/obj/items/O in src)
stat(O)
Version 2
if(items_tab_on)
statpanel("Items")
if(statpanel("Items")) if(!afk)
for(var/obj/A in src)
if(istype(A,/obj/Resources))
A.suffix="[Commas(A.Value)]"
stat(A)
if(istype(A,/obj/Mana))
A.suffix="[Commas(A.Value)]"
stat(A)
if(istype(A,/obj/items))
stat(A)
Hypothetical Version 3
if(items_tab_on)
statpanel("Items")
if(statpanel("Items")) if(!afk)
stat(contents)
Problem description:
Several iterations of the inventory code for my game. Goal is to minimize usage of for lists, I want to do this by just calling (contents) as is for the inventory output. Issue is, that skills are stored as objs within characters as well and in order to safely display contents without improper entries, I need a way to set the src of a verb as a list; i.e. src set = usr.SkillList
If you know of a way for me to do so, or another way to reduce the impact of item display, please let me know.