ID:269067
 
How can u code a change icon state verb that allows u to see all the icon states in the icon instead of having to type in the icon_state you want?
Look up the icon_states() proc.
In response to Hell Ramen
I would like to add something to this. When you add all of your icon states to a list, make sure you add a "" state so you can set back to default. I've seen many people forget this and it gets annoying when you want to set back to default.

-Angel
In response to Angel of Flames
Angel of Flames wrote:
I would like to add something to this. When you add all of your icon states to a list, make sure you add a "" state so you can set back to default. I've seen many people forget this and it gets annoying when you want to set back to default.

-Angel

You could do
if("" in asdf) asdf+=" "
if(" ") src.icon_state=""
Or something, I dunno'
In response to Hell Ramen
Hell Ramen wrote:
You could do
if("" in asdf) asdf+=" "
if(" ") src.icon_state=""
Or something, I dunno'

I was just thinking more along the lines of:

var/list/IconState=iconstates(src.icon)
IconState+="\" \""
var/A = input("Please select the icon state please.") in IconState
switch(A)
if("\" \"") src.icon_state=""
else src.icon_state="[A]"
In response to Angel of Flames
What happens if the icon doesn't have a "" icon_state?
In response to Hell Ramen
then the only choice will be null!
In response to Against_The_Odds
A blank icon_state will basically mean the same thing as null. If there is no icon_state for the blank, or null state, the person can always switch to another, because I would take my best bet in saying that you can use this verb more than once. 0.o
In response to Against_The_Odds
Way to go, bump up a 5 month old topic, why don'tcha'. >_>