Makes dialog functional

This commit is contained in:
zontreck 2024-08-01 18:29:30 -07:00
parent c617d999c8
commit ddde32ec5d
2 changed files with 21 additions and 3 deletions

View file

@ -29,6 +29,7 @@ integer LINK_SIGNAL_QUERY_MENU = 0602241;
integer LINK_SIGNAL_REGISTER_MENU = 0602242;
integer LINK_SIGNAL_RESET = 0602243;
integer LINK_SIGNAL_MENU_DATA = 0602244;
integer LINK_SIGNAL_MENU_BACK = 0801241;
@ -41,6 +42,12 @@ string NEXT_MENU = "-->";
integer g_iDebugIndent=0;
returnMenu(key kID, string sMenu, integer iPage, string sReply) {
llMessageLinked(LINK_SET, LINK_SIGNAL_MENU_BACK, llList2Json(JSON_OBJECT, ["menu", sMenu, "page", iPage, "reply", sReply]), kID);
}
DEBUG_FUNC(integer iEnter, string sLabel, list lParams) {
if(iEnter){
llOwnerSay(MakeIndent() + "ENTER " + sLabel + " [" + llList2CSV(lParams) + "]");
@ -501,18 +508,21 @@ default
string sButton = llList2String(lButtons, x);
if(IsLikelyAvatarID(sButton)) {
if(iIDNum == iID) {
llOwnerSay("Send button response signal over LM");
returnMenu(i, sMenuID, iPage, sButton);
jump epr;
}
iID ++;
}
}
} else {
llOwnerSay("Send button response signal over LM");
// Send reply signal
returnMenu(i, sMenuID, iPage, m);
}
@epr;
stopListen(i);
DEBUG_STMT(FALSE, "Process Response");
}

View file

@ -7,6 +7,7 @@ integer LINK_SIGNAL_QUERY_MENU = 0602241;
integer LINK_SIGNAL_REGISTER_MENU = 0602242;
integer LINK_SIGNAL_RESET = 0602243;
integer LINK_SIGNAL_MENU_DATA = 0602244;
integer LINK_SIGNAL_MENU_BACK = 0801241;
string PREVIOUS_MENU = "<--";
@ -43,6 +44,9 @@ string decodeLM(integer iSignal) {
case LINK_SIGNAL_MENU_DATA: {
return "LINK_SIGNAL_MENU_DATA";
}
case LINK_SIGNAL_MENU_BACK: {
return "LINK_SIGNAL_MENU_BACK";
}
default: {
return (string)iSignal;
}
@ -61,6 +65,10 @@ showMenu(key kID, string sMenu, integer iPage) {
llMessageLinked(LINK_SET, LINK_SIGNAL_SHOW_MENU, llList2Json(JSON_OBJECT, ["menu", sMenu, "page", iPage]), kID);
}
returnMenu(key kID, string sMenu, integer iPage, string sReply) {
llMessageLinked(LINK_SET, LINK_SIGNAL_MENU_BACK, llList2Json(JSON_OBJECT, ["menu", sMenu, "page", iPage, "reply", sReply]), kID);
}
integer g_iDebugIndent=0;
DEBUG_FUNC(integer iEnter, string sLabel, list lParams) {
if(iEnter){