Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sub menuing in llDialog

Arrekusu Muromachi
SL Fighter Ace
Join date: 20 Feb 2005
Posts: 32
03-23-2006 23:34
It's got to the point where I wanna work on menus and submenus for my aircraft. I understand how to setup a simple menu using the llDialog but what puzzles me is how to break into a sub menu and then return from it using a back button. Moreso a sub-sub menu that gives me additional features such as issuing a command to change color, turn a certain thing on or of, or provide basic help. How would I go about writing code to drop into a sub and sub-sub menus, then have the option of going back from the sub-sub or back to the main itself?

To verify what I'm talking about.
  1. Main Menu
  2. Color

  3. Wings

  4. Color or custom

  5. Body

  6. Color or custom

  7. Combat System

  8. TCS (On/Off)

  9. CCC (On/Off)

  10. Autostart

  11. On

  12. Off

  13. Start/Stop

  14. Camera

  15. Camera Positions

  16. Eject


Basically that type of menu system except using buttons.
Jabador Jimador
happy submissive
Join date: 28 Sep 2005
Posts: 15
03-24-2006 01:26
There's probably a smarter way out there, but what i do is putting the menu in a function or seperate script, then calling it using a state variables something like:

CODE

integer igHandler; //Listen handler

menu (integer ilState) {
if (ilState == 0) {
llDialog (llGetOwner (), "Main menu", ["Options"], 1);
} else if (ilState == 1) {
llDialog (llGetOwner (), "Options", ["Main"], 1);
}
if (igHandler)
llListenRemove (igHandler);
llListen (1, "", llGetOwner (), "");
}

default {
touch_end (ilDetected) {
if (llGetDetectedKey (0) == llGetOwner ()) {
menu (0);
}
}

listen (integer ilChan, string slName, key klId, string slData) {
if (slData == "Options") {
menu (1);
else if (slData == "Main") {
menu (0);
llListenRemove (igHandler);
}
}


NOTE: This has not been tested in any way - Use with caution
_____________________
Jabador Jimador
Owned and collared by Master Spiritfire Musketeer
Any questions or complaints are to be directed to Him
FireEyes Fauna
Registered User
Join date: 26 Apr 2004
Posts: 138
03-24-2006 12:06
GeneralMenuEngine