ID:271785
 
its pretty hard to me to explain so i edit a picture that explain what i want
http://img227.imageshack.us/img227/6809/saytestkc5.jpg
i want to change the say verb into the say icon
how am i doing this?
You'll have to use an obj and statpanels instead of command panels. Normally when people use this method they create a "visual verb" for each character, when really you only need to create one global one. Here's an example of how to keep resources low and to have functioning visual commands/buttons.

var
GLOBAL_BUTTON_SAY
GLOBAL_BUTTON_WHO

proc
initialize()
GLOBAL_BUTTON_SAY=new/button/SayButton
GLOBAL_BUTTON_WHO=new/button/WhoButton


button
parent_type=/obj

Click()
// Avoid explicitly calling Click yourself.

clicked(usr)

proc
clicked(var/mob/player/p)
return istype(p)


SayButton
name="Speak"
icon='SayButton.dmi'
clicked(var/mob/player/p)
if(..()) //checking if passed argument is the right type
p.say_command()

WhoButton
name="Who"
icon='WhoButton.dmi'
clicked(var/mob/player/p)
if(..())
p.who_command()


mob/player
Stat()
..() //just in case you've got many stats all over the place
statpanel("Commands")
stat(GLOBAL_BUTTON_SAY)
stat(GLOBAL_BUTTON_WHO)

proc
say_command()
var text=input("What would you like to say: ")as text
world<<"[name]: [text]"

who_command()
for(var/client/c)
src<<"- [c.key]"

world
mob=/mob/player
New()
.=..()
initialize()


There's a quick demo on how to do it. Becareful, though, this code is untested and was written directly in my browser so you may have to fix some tabs. Good luck.
In response to Crashed
Crashed wrote:
You'll have to use an obj and statpanels instead of command panels. Normally when people use this method they create a "visual verb" for each character, when really you only need to create one global one. Here's an example of how to keep resources low and to have functioning visual commands/buttons.

> var
> GLOBAL_BUTTON_SAY
> GLOBAL_BUTTON_WHO
>
> proc
> initialize()
> GLOBAL_BUTTON_SAY=new/button/SayButton
> GLOBAL_BUTTON_WHO=new/button/WhoButton
>
>
> button
> parent_type=/obj
>
> Click()
> // Avoid explicitly calling Click yourself.
>
> clicked(usr)
>
> proc
> clicked(var/mob/player/p)
> return istype(p)
>
>
> SayButton
> name="Speak"
> icon='SayButton.dmi'
> clicked(var/mob/player/p)
> if(..()) //checking if passed argument is the right type
> p.say_command()
>
> WhoButton
> name="Who"
> icon='WhoButton.dmi'
> clicked(var/mob/player/p)
> if(..())
> p.who_command()
>
>
> mob/player
> Stat()
> ..() //just in case you've got many stats all over the place
> statpanel("Commands")
> stat(GLOBAL_BUTTON_SAY)
> stat(GLOBAL_BUTTON_WHO)
>
> proc
> say_command()
> var text=input("What would you like to say: ")as text
> world<<"[name]: [text]"
>
> who_command()
> for(var/client/c)
> src<<"- [c.key]"
>
> world
> mob=/mob/player
> New()
> .=..()
> initialize()
>

There's a quick demo on how to do it. Becareful, though, this code is untested and was written directly in my browser so you may have to fix some tabs. Good luck.
mob
verb
Say(msg as text)
set name = "Say"
icon='saybutton.dmi'
if(usr)
if(usr.muted)
alert("You are muted!")
return
if(msg == "")
return
if(usr.filter(msg,tags) == TRUE)
usr.html()
return
if(usr.filter(msg,profane) == TRUE)
usr.profane()
return
if(length(msg) >= 200)
alert("Your message is too long.")
return
else
if(usr.spamcheck == TRUE)
usr << "<b>Please wait before talking again!"
return
else
usr.spamcheck()
view(usr,8) << "<b><font color=silver>[usr]: [msg]"
text2file("[time2text(world.realtime)]:[usr] says, [msg]","log.txt")

i did it like you say but after i use the say verb my icon changed into the icon i putted its not changed the verb icon :S