ID:160788
 
Ok so ive made a simple IM system for my game that uses another popup output and input (like an AIM window) but there are some flaws in my system and was wondering how to fix them.
1. I can only have one pop-up window( this is solved i found the winclone() command im just blind i guess and couldnt find it before)

2. You can only use the input to respond to the last person who sent you an IM.

So i was able to fix the the multiple window thing but now I am trying to get the respond to work. I need the input line in the window to only show up to the two users. Ive updated the code below.

mob/verb
Instant_Message()
var/varPeople = list()
for(var/mob/T in world)
if(T.key)
varPeople += T
var/mob/M=input("Who would you like to whisper to?","") in varPeople +list("Cancel")
if(M=="Cancel")
return
else
var/msg=input("") as text
if(winget(M,"[usr][M]","id")||winget(usr,"[usr][M]","id"))
winclone(M, "Messager","[usr][M]")
winclone(usr, "Messager","[usr][M]")
M << output("\blue([usr.Nation])</FONT>--[usr.name]: [html_encode(msg)]", "[usr][M].IMout")
usr << output("\blue([usr.Nation])</FONT>--[usr.name]: [html_encode(msg)]", "[usr][M].IMout")
winshow(M, "[usr][M]",1)
winshow(usr, "[usr][M]",1)
else
winclone(M, "Messager","[M][usr]")
winclone(usr, "Messager","[M][usr]")
M << output("\blue([usr.Nation])</FONT>--[usr.name]: [html_encode(msg)]", "[M][usr].IMout")
usr << output("\blue([usr.Nation])</FONT>--[usr.name]: [html_encode(msg)]", "[M][usr].IMout")
winshow(M, "[M][usr]",1)
winshow(usr, "[M][usr]",1)

This is used to initiate the IM chat

send(msg as text)
set hidden=1
if(usr.sender)
var/mob/M=usr.sender
M << output("\blue([usr.Nation])</FONT>--[usr.name]: [html_encode(msg)]", "IMout")
usr << output("\blue([usr.Nation])</FONT>--[usr.name]: [html_encode(msg)]", "IMout")
winshow(M, "Messager",1)
winshow(usr, "Messager",1)

This is hidden but assisgned to the input on the IM window see the fact that im using a variable "sender" to define who the message goes to makes it so it can be changed by someone else sending you an IM. Also i dont have the sender assigned anymore in my current IM code because of this problem. Any help would be appreciated
You should popup a skin window.

That way you can have several popups.
In response to Andre-g1
Thats what im doing but how do you pop up several windows with the same skin window is what im asking im still learning how to work with the skin.
In response to NightJumper88
Winshow(), look it up.
In response to Andre-g1
Ok i found winclone() which is what i really want to be using