What I'm having a problem with is getting the menu to come up again after a selection is made.
In my opinion, all i need to do is to put the command that is used on touch into all the option commands. But its not working. Here is the code for the options. If anybody can point me in the direction I need to go, thank you.
CODE
// Menu demo program
//---Menu Library interface-------------
integer LM_DOMENU = 10001;
integer LM_OPTIONDATA = 10002;
integer LM_MENULOADED = 10003;
integer LM_RESETMENUSYSTEM = 10004;
integer LM_READSTRING = 10005;
integer LM_READSTRINGDATA = 10006;
resetMenu() {
llMessageLinked(llGetLinkNumber(),LM_RESETMENUSYSTEM,"",NULL_KEY);
}
doMenu( key user, string menuname ) {
llMessageLinked(llGetLinkNumber(),LM_DOMENU,menuname,user);
}
readString( key user, string var, string prompt ) {
llMessageLinked(llGetLinkNumber(),LM_READSTRING,var+" "+prompt,user);
}
//---Menu Library interface End----------
default
{
state_entry()
{
}
link_message(integer sender_num, integer num, string str, key id) {
if (num==LM_OPTIONDATA) {
// menu result? let's process it!
if (str=="MCOLOR|Red")
{
llShout (113,"red");
doMenu(llDetectedKey(0),"DEFAULT");
}
if (str=="MCOLOR|Green")
{
llShout (113,"green");
doMenu(llDetectedKey(0),"DEFAULT");
}
if (str=="MCOLOR|Blue")
{
llShout (113,"blue");
doMenu(llDetectedKey(0),"DEFAULT");
}
if (str=="MCOLOR|Purple")
{
llShout (113,"purple");
doMenu(llDetectedKey(0),"DEFAULT");
}
if (str=="MCOLOR|White")
{
llShout (113,"white");
doMenu(llDetectedKey(0),"DEFAULT");
}
}
if (num==LM_MENULOADED) llSay(0,"Menu ready");
}
touch_start(integer total_number)
{
doMenu(llDetectedKey(0),"DEFAULT");
}
}
