ID:146220
 
Code:
obj/clothes
DblClick()
usr.handleClothing(src.type,"[src.identifier]")

mob/proc/handleClothing(obj/clothes/C,clothing)
if(!src.vars["[clothing]"])
var/obj/clothes/S = new C()
src.vars["[clothing]"] = S
var/new_color = F_Color_Selector.Get_Color(src)
var/icon/I= icon(S.icon)
I.Blend(new_color)
S.icon = I
src.client.screen += S
src.Overlayers += S
else
src.client.screen -= src.vars["[clothing]"]
src.Overlayers -= src.vars["[clothing]"]
src.vars["[clothing]"] = null

turf
costume
base
c2
icon='CostumeSelect.dmi'
icon_state="c2"
desc = "OK"
Click()
var/mob/Player/M = new()
M.overlays = usr.overlays
M.name = usr.name
M.age =usr.age
for(var/obj/clothes/O in usr.Overlayers)
M.overlays+=O
usr.HUDOverlayRemove()
usr.client.mob = M
M.icon = 'Base.dmi'
M.loc=locate(1,1,1)
del(usr)


Problem description:

When I click the Okay button it brings me to 1,1,1 but the problem is my overlays are messed up. They are "stuck" in the North state. When ever I move any direction it acts like I am moving North. The icon would perform the North moving state, even if I am moving East.
I'd have to say your problem is your icon...I dont know what else it could be. Your icon must not have a south, east or a west direction set on it.
In response to Future Gohan426
Nope, it does. I know I had this problem one time, awhile ago. I don't rememeber how I solved it though.
In response to N1ghtW1ng
Now that I think of it, try defining the icon state to "", I think it might work then.
ob/proc/HUDOverlayRemove()
for(var/obj/clothes/O in src.client.screen)
src.client.screen -= O
//src.overlays += O.icon
src.move = 1


mob/proc/handleClothing(obj/clothes/C,clothing)
if(!src.vars["[clothing]"])
var/obj/clothes/S = new C()
src.vars["[clothing]"] = S
var/new_color = F_Color_Selector.Get_Color(src)
var/icon/I= icon(S.icon)
I.Blend(new_color)
world << "\icon[S.icon]"
S.icon = I
src.client.screen += S
src.Overlayers += S
for(var/x in Overlayers) world << "Overlayers\[[Overlayers.Find(x)]\] == [(isnull(x) ? "null":"[x]")]"
else
src.client.screen -= src.vars["[clothing]"]
src.Overlayers -= src.vars["[clothing]"]
src.vars["[clothing]"] = null


obj/clothes
var/identifier = ""
New()
src.screen_loc = "8,8"
DblClick()
usr.handleClothing(src.type,"[src.identifier]")
shortsleeve
icon = 'Base.dmi'
icon_state = "ss"
density = 1
identifier = "shortsleeve"
// There are a bunch more, but they are basically the same except for identifier + icon_state

turf
costume
base
c2
icon='CostumeSelect.dmi'
icon_state="c2"
desc = "OK"
Click()
var/mob/Player/M = new(null)
M.name = usr.name
M.age =usr.age
for(var/atom/O in usr.Overlayers)
world << "\icon[O.icon]"
M.overlays+=O.icon
usr.HUDOverlayRemove()
usr.client.mob = M
M.loc=locate(1,1,1)
del(usr)


This is all of the related code that is needed. This is what a few people on Wiz_Chat and I used. It still doesn't work. It returns that I have obj's in my Overlays list. Now, it doesn't put any overlays at all on my mob. All it has is the base icon.

Edit:

So, after staring at this for a few hours (taking breaks every 5 minutes,) I decided to add in/take out pieces which weren't doing what they were supposed to. Well, this is what I am left with, and I figured out a problem, the overlay's color blended with my mob's icons! So still, there are no are no overlays.