ID:2400167
 
Code:
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.
Could use a separate list just for items as the list to show with stat() instead of contents, in addition to using contents for verbs.
One thing you should strongly consider is not setting suffix in the loop during Stat(), but only when the value in question changes. What you're doing currently causes a lot of text routines to run, along with potential appearance churn (or at least pointless lookups), which is going to cause more server strain with more players because you're doing this during every stat call.