dialogPlus

From Second Life Wiki
Revision as of 22:30, 23 May 2010 by Ugleh Ulrik (talk | contribs) (Created page with '{{LSL_Function |func=DialogPlus |mode=user |p1_type=key|p1_name=avatar|p1_desc |p2_type=string|p2_name=message|p2_desc=message to be displayed |p3_type=list|p3_name=buttons|p3_de...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Summary

Function: DialogPlus( key avatar, string message, list buttons, integer CurMenu, integer );

Creates a dialog menu for storing more then 12 buttons, very useful for Inventory items, Scanners, and just huge lists.

• key avatar
• string message message to be displayed
• list buttons button labels
• integer CurMenu Parsed menu index.
• integer

'CurMenu' will take place of an integer menuindex.
This requires a Listen even when using DialogPlus to allow the Back and Next button to work. See also: llDialog

Specification

<lsl> //Created by Ugleh Ulrik //This sort of script should cost, but for you free :) integer menuindex; DialogPlus(key avatar, string message, list buttons, integer channel, integer CurMenu) {

   if (llGetListLength(buttons) >12){
   list lbut = buttons;
   list Nbuttons = [];
   if(CurMenu == -1)
   {
       CurMenu = 0;
       menuindex = 0;
   }
   if((Nbuttons = (llList2List(buttons, (CurMenu * 10), ((CurMenu * 10) + 9)) + ["Back", "Next"])) == ["Back", "Next"])
       DialogPlus(avatar, message, lbut, channel, menuindex = 0);
   else
   {
       llDialog(avatar, message, Nbuttons, channel);
   }

}else{

   llDialog(avatar, message, buttons, channel);

} } </lsl>

Examples

<lsl> //Created by Ugleh Ulrik default {

   touch_start(integer total_number)
   {
       integer time = llGetUnixTime() - 180;
       llSay(0,  TimeAgo(time) + " ago");
       }

}


//integer time is the current unix time minus 180 seconds (3 minutes)

//The outcome will be "3 minutes ago"</lsl>