ID:158059
 
Iv seen on some games that when a button is pressed, the statpanel or whatever changes to what they asked for, for example when they press "Quests" , their quests appear on a statpanel and when they press "Items" their items appear on the same stat panel.. any help?
mob/verb/change_statpanel(var/statpanel as text)
set hidden = 1
client.statpanel = statpanel


When creating a button in the Interface, simply assign its command to:

change_statpanel("x")


Where x is the name of the statpanel to focus. So, to change to one's inventory, the button would be set with the following command:

change_statpanel("inventory")
In response to Sii
Sii wrote:

> mob/verb/change_statpanel(var/statpanel as text)
> set hidden = 1
> client.statpanel = statpanel
>


... why call it a verb and then hide it, when a proc would be better and require one less line of code? Efficiency, man, efficiency!

At the same, that's not what she means. I think she means like in the game Mafia, where in hte Icons there are categories. You select a category and everything else in that specific statpanel dissapears, except for the icon name and there're a list of icons instead.
In response to Delra
Well, I haven't been around the community for some time, and the last time I was, commands via interface could only be called from verb format.