ID:1993919
 
Code:
obj
MouseEntered()
var/icon/I=new(icon='icon.dmi',icon_state="select", name="Sel")
src.overlays.Add(I)
MouseExited()
for(var/icon/I in src.overlays) if(I.name=="Sel")// error: I.name: undefined var
src.overlays.Remove(I)


Problem description:

Something like this is impossible, but is any other idea for this? I know icon don't support name var, i can do this with use obj's, but i'm not sure it's good way.
The image proc might be what you're looking for.
However, also, you can use the {} tags after declaring a new object to define properties.
Sorry, i resolve my all issues... i just use image proc.Thanks for (now useless) help :D

    MouseEntered(location,control,params)
if(control=="DBPaneTileset.DBPaneTileset") if(usr.client)
var/image/I=image('icons.dmi',src,"select",src.layer)
I.name="select";usr.client<<I
MouseExited(location,control,params)
if(control=="DBPaneTileset.DBPaneTileset") if(usr.client)
for(var/image/I in usr.client.images) if(I.name=="select") {usr.client.images-=I;del I}
Quick tip, the overlays list is always an internal type called an appearance. You can't iterate through the overlays list using an /image, /icon, or /atom filter, because the types in that list are none of those things.

Further, you should never be iterating through an entire list in order to find an object you want to remove.

To do what you are looking to do:

client
var/tmp
image/selection_icon
New()
. = ..()
if(.)
selection_icon = image('icon.dmi',"select")
src << selection_icon
Del()
selection_icon.loc = null
images -= selection_icon
selection_icon = null
..()

obj
MouseEntered()
usr.client.selection_icon.loc = src
MouseExited()
usr.client.selection_icon.loc = null


If you are ever looking through a list of objects for a specific object, odds are that you should have that object stored in a variable somewhere.