ID:264737
 
Code:
obj/Plate
var
Amount
list/Images = list()


MouseEntered()
for(var/obj/Plate/p in adjacent(src))
if(!p.Amount) continue

if(p.Amount<usr.Value) //Here is the Issue
var/image/Take/I= new
Images += I
else
var/image/Take/J= new
J.icon_state = "NoTake"
Images += J

for(var/image/Take/T in Images)
p.overlays += T //...

MouseExited()
for(var/obj/Plate/p in adjacent(src))
for(var/image/Take/T in p.Images)
p.overlays -= T //Remove image


image/Take //My Image
icon='Plates.dmi'
icon_state="Take"


Problem description:
I'm having quite a few issues with overlays and images. Basically, when you move the mouse over a Plate, it should highlight the adjacent Plates and let you know wether or not you can take it depending on it's value.

When you move the mouse off the object, it should remove the images placed on the overlays. However it does not do that. If it matters, the plates also have other overlays which I do not want removed.

right here you are doing images.

The basic difference between images and overlays/underlays is how they are seen.

You must show each client the image by adding it to the client.images list.
If it is an overlay that you want all to see, you'll need to add it to the object's overlay list.
In response to Pirion
Ahh, sorted now.

MouseEntered()
for(var/obj/Plate/p in adjacent(src))
if(!p.Amount) continue
if(p.Amount<usr.Value)
var/image/i = image('Plates.dmi',p.loc,icon_state="Take")
usr.client.images += i
else
var/image/i = image('Plates.dmi',p.loc,icon_state="NoTake")
usr.client.images += i


MouseExited()
usr.client.images=null