// when HUD touched, present a dialog with four color choices
integer CHANNEL = 808; // dialog channel
list MENU_MAIN = ["A", "B", "C", "D", "E"]; // the main menu
list MENU_A = ["0", "1", "2", "3", "4", "5", "Back"]; // a submenu
list MENU_B = ["0", "1", "2", "3", "4", "5", "Back"]; // a submenu
list MENU_C = ["0", "1", "2", "3", "4", "5", "Back"]; // a submenu
list MENU_D = ["0", "1", "2", "3", "4", "5", "Back"]; // a submenu
list MENU_E = ["0", "1", "2", "3", "4", "5", "Back"]; // a submenu
default {
state_entry()
{
llListen(CHANNEL, "", NULL_KEY, ""
; // listen for dialog answers (from multiple users)}
touch_start(integer total_number)
{
llDialog(llDetectedKey(0), "WALLPAPER MENU", MENU_MAIN, CHANNEL); // present dialog on click
}
listen(integer channel, string name, key id, string message)
{
string response_string;
if (llListFindList(MENU_MAIN + MENU_A, [message]) != -1) // verify dialog choice
{
if (message == "A"

llDialog(id, "SELECT A WALLPAPER", MENU_A, CHANNEL); // present submenu on request
if (message == "0"

llShout( 808, "0" ) ;
if (message == "1"

llShout( 808, "1" ) ;
if (message == "2"

llShout( 808, "2" ) ;
if (message == "3"

llShout( 808, "3" ) ;
if (message == "4"

llShout( 808, "4" ) ;
if (message == "5"

llShout( 808, "5" ) ;
else if (message == "Back"

llDialog(id, "WALLPAPER MENU", MENU_MAIN, CHANNEL); // present main menu on request to go back
// here you have the name and key of the user and can easily verify if they have the permission to use that option or not
if (message == "B"

llDialog(id, "SELECT A WALLPAPER", MENU_B, CHANNEL); // present submenu on request
if (message == "0"

llShout( 808, "0" ) ;
if (message == "1"

llShout( 808, "1" ) ;
if (message == "2"

llShout( 808, "2" ) ;
if (message == "3"

llShout( 808, "3" ) ;
if (message == "4"

llShout( 808, "4" ) ;
if (message == "5"

llShout( 808, "5" ) ;
else if (message == "Back"

llDialog(id, "WALLPAPER MENU", MENU_MAIN, CHANNEL); // present main menu on request to go back
// here you have the name and key of the user and can easily verify if they have the permission to use that option or not
else if (message == "C"

llDialog(id, "SELECT A WALLPAPER", MENU_C, CHANNEL); // present submenu on request
if (message == "0"

llShout( 808, "0" ) ;
if (message == "1"

llShout( 808, "1" ) ;
if (message == "2"

llShout( 808, "2" ) ;
if (message == "3"

llShout( 808, "3" ) ;
if (message == "4"

llShout( 808, "4" ) ;
if (message == "5"

llShout( 808, "5" ) ;
else if (message == "Back"

llDialog(id, "WALLPAPER MENU", MENU_MAIN, CHANNEL); // present main menu on request to go back
// here you have the name and key of the user and can easily verify if they have the permission to use that option or not
else if (message == "D"

llDialog(id, "SELECT A WALLPAPER", MENU_D, CHANNEL); // present submenu on request
if (message == "0"

llShout( 808, "0" ) ;
if (message == "1"

llShout( 808, "1" ) ;
if (message == "2"

llShout( 808, "2" ) ;
if (message == "3"

llShout( 808, "3" ) ;
if (message == "4"

llShout( 808, "4" ) ;
if (message == "5"

llShout( 808, "5" ) ;
else if (message == "Back"

llDialog(id, "WALLPAPER MENU", MENU_MAIN, CHANNEL); // present main menu on request to go back
// here you have the name and key of the user and can easily verify if they have the permission to use that option or not
else if (message == "E"

llDialog(id, "SELECT A WALLPAPER", MENU_E, CHANNEL); // present submenu on request
if (message == "0"

llShout( 808, "0" ) ;
if (message == "1"

llShout( 808, "1" ) ;
if (message == "2"

llShout( 808, "2" ) ;
if (message == "3"

llShout( 808, "3" ) ;
if (message == "4"

llShout( 808, "4" ) ;
if (message == "5"

llShout( 808, "5" ) ;
else if (message == "Back"

llDialog(id, "WALLPAPER MENU", MENU_MAIN, CHANNEL); // present main menu on request to go back
// here you have the name and key of the user and can easily verify if they have the permission to use that option or not
}
else
{
//llSay(0, name + " picked invalid option '" + llToLower(message) + "'."
; // not a valid dialog choiceresponse_string = name + " picked invalid option '" + llToLower(message) + "'.\n";
response_string = response_string + "Click HUD for dialog of options";
}
}
}

