I'm curious as to how you make an input box enabled only when you press a certain key. Also, how do you have the executed command affected by key press?
In response to FIREking
|
|
FIREking wrote:
There's only one problem with this, there's no escape hook to cancel the say if the user doesn't want to say anything. I'm not sure if there's a way to do that. It's super simple to hide the chat box if nothing is there. Just check to see if the argument is false; Meaning nothing was entered. mob |
In response to Lavitiz
|
|
Lavitiz wrote:
FIREking wrote: > mob No, by the time you've switched focus to the input control, your cursor is in the input box, and pressing escape will do nothing. Yeah, you can let the person type in a null message and bypass that, but that's not super intuitive. Most pc games would have you hit escape to back out of the say / command |
Another problem, I don't think starting a separate thread is ideal. I have 3 buttons, each of them change the chat command. However, none of them are working.
Here is the format for each of them: .winset(usr,"window1.chat","command="OOC"") |
change command to text
and if you're trying to change "command-text", that's just a variable on the client. also, you need \" to represent a quote in between two quotes "say \"" |
In response to BeignetLover
|
|
To place a quote inside a string, escape it with \. It is not adding \ to the string, you just escaped " in order to place it inside the string.
"\"" will be a string containing just the " character. |
.winset(usr,"window1.chat","text=Say \"")
I put the \ there, but it simply disappears everytime I look at it again. |
Yes. \ is not supposed to show. That's what escaping is about.
\" is a single character representing " You do that to differentiate it from your opening and closing quotes. |
Regardless, whenever my line as a command for my buttons, it doesn't work. Do you think I should replace it with a verb that has a null category?
|
It should be
winset(usr,"window1.chat","command=\"Say\"") If you want Say to be visible, add a !, i.e. winset(usr,"window1.chat","command=\"!Say\"") You can avoid depending on verbs by using .winset as a command for your button. Go to your skin, edit the button then set the command
.winset "window1.chat.command=\"!Say\""
|
Then
So user presses enter, and input is made visible and focused... next the user types text, it appears in the input box, user hits enter. This executes the say verb which will say the message and return the focus back to the map and make the input box invisible again.
There's only one problem with this, there's no escape hook to cancel the say if the user doesn't want to say anything. I'm not sure if there's a way to do that.