|
Feral Mistwalker
Registered User
Join date: 2 Mar 2009
Posts: 88
|
03-27-2009 03:36
I'm working on a single prim vendor for multiple items using llDetectedTouchUV() to zelect the item but I have hit a snag. Is there any way to display the pay dialog from a touch event? I still need touch to set values like price and item clicked but I'd rather not require the avatar to also have to right click a second time just to pay for the item.
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
I was there
03-27-2009 04:10
I found that I had to toggle between 'action touch' and 'action pay'. And if not payed I needed a timer to reset to 'action touch' Snippet: money(key customer, integer amount) { llSetTimerEvent( 0.0 ); llSetClickAction( CLICK_ACTION_TOUCH ); // give customer stuff and make record }
touch_start(integer n) { if ( llDetectedTouchFace(0) == -1 ) llInstantMessage( llDetectedKey(0), "Sorry, your viewer doesn't support touched faces."); if ( Info(llDetectedTouchUV(0))) { // something } else if ( Pay(llDetectedTouchUV(0))) { llSetClickAction( CLICK_ACTION_PAY ); llSetTimerEvent( 4.0 ); llInstantMessage( llDetectedKey(0), "Double click to Buy" ); } else if ( llDetectedKey(0) == llGetOwner() ) { // something else } }
timer() { llSetTimerEvent( 0.0 ); llSetClickAction( CLICK_ACTION_TOUCH ); }
Do anyone know a smarter scheme? Note: Don't get scared over me using llInstantMessage. The 2 seconds delay is after not before the command, so the message is instant 
_____________________
From Studio Dora
|
|
Feral Mistwalker
Registered User
Join date: 2 Mar 2009
Posts: 88
|
03-28-2009 10:17
Worked great, thanks for the tip!
|