UpdateOverlays()
for(var/obj/i in src.overlays)
i.icon_state=src.icon_state
equipment
layer=FLY_LAYER
var
uname
ename
robe
icon='robe.dmi'
icon_state="stand"
uname="Robe"
ename="Robe - Equipped"
Click(mob/players/p)
p=usr
if((src in p.contents) && (!src.suffix))
src.suffix="Equipped"
src.name=ename
p.overlays+=src
p.UpdateInventory()
else if((src in p.contents) && (src.suffix=="Equipped"))
src.suffix=""
src.ename=src.uname
p.overlays-=src
src.layer=OBJ_LAYER
p.UpdateInventory()
else if(src in oview(1,p))
p.contents+=src
src.icon_state=""
p.UpdateInventory()
else
return
Problem description:
I'm trying to make it so when the player icon state is updated, their overlays icon state will update to the players icon state as well, but it's not updating. On top of that, the overlay isn't being removed. I switched the p.overlays to o.icon and it removed, but it shows underneath the the player when being equipped. And doing a cross of the two doesn't work. What's wrong?
This is a list of icons which are displayed on top of the object's main icon.
The individual items in the list may not be directly accessed, since they are stored in a special internal format. However, the list operators +=, -=, and the procedures Add, Remove, and Cut work normally.
IE: You can't edit an overlay once it has been added, you must remove it and add the new state that you want.