ID:1665906
 
(See the best response by Albro1.)
I want to make it so that within the same statpanel I have headers that list stats. When the header is clicked, the stats can be retracted into the header.

Like:

Attributes
~~
HP
MP
Attack
Defense

and when you click attributes it just shows

Attributes

What kinda stuff can you do with it that isn't stated explicitly in the DM guide?
Best response
The only things that you can click in a statpanel are objects, so you would have to output an object in the panel that is set up to toggle a variable when clicked. The contents below that object would only show if the object's variable in question is TRUE.
http://www.byond.com/forum/?post=36411#stat

What I like to do is, for (very little) efficiency reasons and decreasing overhead, only have the "substats" appear only if the panel is active by using if() on the statpanel.

mob/player
var/Spells = list("Destructive" = newlist(/Spell/Fire/Fireball), "Healing" = newlist(/Spell/Heal/Minor), "Mindblowing" = list(/Spell/Mental/HeadBlast)) // An example for one of the items below.

Stat() // client/Stat() appears as soon as the client logs on to the server. If you want it to show when the player logs in instead, set it to the player path. Ex: /mob/player/Stat()
if(statpanel("Stats")) // Displays the following when this statpanel is active
stat("Attributes\n~~~") // \n = new line
stat("HP", src.HP)
...etc...

statpanel("Inventory", src.contents) // Displays the contents under the Inventory panel
// No if() used here since there's no stat() to add

if(statpanel("Spells"))
for(var/S in src.Spells) // Each entry of the list() is outputed like Destructive, Healing, etc.
stat("[S] Spells\n~~~")
stat(src.Spells[S]) // Honestly I do not know if THIS will work... theoretically it should output the list.


Edit: Evidently, I did not read the post thoroughly