ID:261686
 
When I use the code below...

obj/button
icon = 'TopThings.dmi'
Whisper
icon_state = "Whisper"
layer = MOB_LAYER+58
New(client/C) screen_loc = "5,1",C.screen += src
Click(mob/M)
>>>>>>>>>>>> var/msg=input("What do you wish to whisper?") as null|text in view(1)
if(!msg)
return//So, if you hit cancel...it doesn't post any un neccessary text.
else
if(usr.Muted)
usr <<"You are muted!"
else
usr << "\icon[usr] <font color=red><<b>[usr]</b> says:> [msg]"
M << "\icon[usr] <font color=red><<b>[usr]</b> says:> [msg]"

It brings up no errors, but a warning...

Hud.dm:92:warning: it is recommended that you use an object filter or 'anything' when combining constant input types with lists

>>>>>>>>>>>>> = Line 92

Is there anyway to fix this?
obj/button
icon = 'TopThings.dmi'
Whisper
icon_state = "Whisper"
layer = MOB_LAYER+58
New(client/C) screen_loc = "5,1",C.screen += src
Click()
var/list/a=new()
for(var/mob/M in oview(2))a+=M
a+="Cancel"
var/mob/b=input("Whisper to whom?","Whisper")in a
if(b=="Cancel")return
else
var/msg=input("What do you wish to whisper?") as null|text
if(!msg)return
else if(usr.Muted)usr <<"You are muted!"
else
usr << "\icon[usr] <font color=red><<b>[usr]</b> says:> [msg]"
b << "\icon[usr] <font color=red><<b>[usr]</b> says:> [msg]"


RaeKwon
In response to RaeKwon
RaeKwon wrote:
a+="Cancel"
var/mob/b=input("Whisper to whom?","Whisper")in a
if(b=="Cancel")return

Actually this method of cancellation is unnecessary; it's easier to use this:
var/mob/b=input("Whisper to whom?","Whisper") as null|mob in a

Lummox JR