|
Cramer Widdershins
Registered User
Join date: 1 Feb 2007
Posts: 13
|
03-31-2007 13:10
I've been playing with llDialog and llListen and have a couple questions that I hope someone can answer.
When using llDialog, is there a way to determine if "ignore" was clicked? This leads me to my next question;
When using llListen, how and when would you stop llListen when using it within a Menu (llDialog)? I would think you would stop it when "ignore" is clicked.
I don't want my menu to be a resource hog and I would also like to be responsible with my scripting. Any help would be great.
|
|
Sys Slade
Registered User
Join date: 15 Feb 2007
Posts: 626
|
03-31-2007 13:18
There is no way to detect the ignore, so most dialogs use a timer set to around 15 seconds to clear the listener. You need to store the return of llListen to an integer that can later be used with llListenRemove(). If your integer is called "handle", you would use handle=llListen() for the dialog and llListenRemove(handle) in the timer.
|
|
Cramer Widdershins
Registered User
Join date: 1 Feb 2007
Posts: 13
|
04-01-2007 10:49
OK, I have that and I got it to work without a timer just for the sake of making it work but I'm confused as to when to use it. My menu has a bunch of if's and else if's with many to have a llDialog. When would I add the llSetTimerEvent, in state entry or with each if statement? And if it's set in state entry, how does it get called after the listener was closed? It's very very possible I am just confusing my self. 
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
04-01-2007 11:51
I would suggest: Immediately prior to issuing an llDialog you can set up the listen: llListen Immediately following an llDialog you can start the timer: llSetTimerEvent At the beginning of the listen Event Handler you can turn off the timer: llSetTimerEvent(0), and remove the listen: llListenRemove(handle) If you're careful with your code there need only be one instance of each of these happening. 
|
|
Cramer Widdershins
Registered User
Join date: 1 Feb 2007
Posts: 13
|
04-01-2007 12:10
Thanks. I rearranged the code a bit and added the llListen to the Touch event and set the timer. It all worked out great. Thanks again for you help
|