Difference between revisions of "Texture Menu Management"

From Second Life Wiki
Jump to navigation Jump to search
Line 90: Line 90:
For technical support, requests, etc., use the Search under the Groups Tab and search for Skidz Partz - Open Source
For technical support, requests, etc., use the Search under the Groups Tab and search for Skidz Partz - Open Source


if you have any problems getting this script to work either contact me in-world [https://wiki.secondlife.com/wiki/User:Revolution_Perenti Revolution Perenti]
If you have any problems getting this script to work either contact me in-world [https://wiki.secondlife.com/wiki/User:Revolution_Perenti Revolution Perenti]
or visit our free scripts at our LSL scripts [http://www.dazzlemods.com www.dazzlemods.com] Open Source Section on our forum.
or visit our free scripts at our LSL scripts [http://www.dazzlesoftware.ca www.dazzlesoftware.ca] Secondlife Open Source Section on our Tutorials.
[http://slurl.com/secondlife/Skidz%20Isle/128/128/23 Skidz Isle]
[http://slurl.com/secondlife/Skidz%20Isle/128/128/23 Skidz Isle]


{{LSLC|Library}}{{LSLC|Examples}}
{{LSLC|Library}}{{LSLC|Examples}}

Revision as of 15:46, 19 May 2011

Texture Menu Management

(based on our previus script and released here for you as we did a custom edit for second-life community and i thought you may like to use this script as well.)

Introduction

Allows you to have dialog based navigation of textures. and browse the image you like to display on your prim from a dialog with simple and ease of navigation

Usage

Create a script and copy and paste the script below into your prim. and copy textures or photos from your inventory into the content tab of your prim click your prim containing the script and textures and select a texture or photo from the menu dialog

Main Script

<lsl> list MENU1 = []; list MENU2 = []; integer listener; integer MENU_CHANNEL = 1000;

// opens menu channel and displays dialog Dialog(key id, list menu) {

   llListenRemove(listener);
   listener = llListen(MENU_CHANNEL, "", NULL_KEY, "");
   llDialog(id, "Select one object below: ", menu, MENU_CHANNEL);

}

default {

   on_rez(integer num)
   {
       // reset scripts on rez
       llResetScript();
   }
   
   touch_start(integer total_number)
   {
       integer i = 0;
       MENU1 = [];
       MENU2 = [];
       // count the textures in the prim to see if we need pages
       integer c = llGetInventoryNumber(INVENTORY_TEXTURE);
       if (c <= 12)
       {
           for (; i < c; ++i)
               MENU1 += llGetInventoryName(INVENTORY_TEXTURE, i);
       }
       else
       {        
           for (; i < 11; ++i)
               MENU1 += llGetInventoryName(INVENTORY_TEXTURE, i);
           if(c > 22)
               c = 22;
           for (; i < c; ++i)
               MENU2 += llGetInventoryName(INVENTORY_TEXTURE, i); 
           MENU1 += ">>";
           MENU2 += "<<";                          
       }
       // display the dialog 
       Dialog(llDetectedKey(0), MENU1);
   }
   
   listen(integer channel, string name, key id, string message) 
   {
       if (channel == MENU_CHANNEL)
       {
           llListenRemove(listener);  
           if (message == ">>")
           {
               Dialog(id, MENU2);
           }
           else if (message == "<<")
           {
               Dialog(id, MENU1);
           }        
           else                    
           {
               // display the texture from menu selection 
               llSetTexture(message, ALL_SIDES);
               
           }      
       }
   }  

} </lsl>

For technical support, requests, etc., use the Search under the Groups Tab and search for Skidz Partz - Open Source

If you have any problems getting this script to work either contact me in-world Revolution Perenti or visit our free scripts at our LSL scripts www.dazzlesoftware.ca Secondlife Open Source Section on our Tutorials. Skidz Isle