Skip to content

Commit

Permalink
Merge pull request #1093 from NikkiLacrima/NikkiLacrima-Minorclean-Rl…
Browse files Browse the repository at this point in the history
…vsuite

Nikki lacrima minorclean rlvsuite
  • Loading branch information
SilkieSabra authored Sep 18, 2024
2 parents a7b26e9 + 55e1e45 commit c62a3ce
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions src/collar/oc_rlvsuite.lsl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ medea (medea destiny)
ApplyCommand if there is a command following that is not "on" or "off" to avoid collision
with RLV menu
- Removed double menu for (prefix) restrictions
Jun 2024 - Extended chat command function above to allow for capitalization of individual restriction names.
Jun 2024 - Extended chat command function above to allow for capitalization of individual restriction names.
Nikki Lacrima
Sept 2024 - Remove superflous llOwnerSay commands and replace g_lMenuIDs (Yosty patch PR #963)
*/
string g_sScriptVersion = "8.3";
Expand Down Expand Up @@ -250,16 +252,8 @@ integer g_bForceMouselook = FALSE;

integer g_iRLV = FALSE;

list g_lMenuIDs;
integer g_iMenuStride;

Dialog(key kID, string sPrompt, list lChoices, list lUtilityButtons, integer iPage, integer iAuth, string sName) {
key kMenuID = llGenerateKey();
llMessageLinked(LINK_SET, DIALOG, (string)kID + "|" + sPrompt + "|" + (string)iPage + "|" + llDumpList2String(lChoices, "`") + "|" + llDumpList2String(lUtilityButtons, "`") + "|" + (string)iAuth, kMenuID);

integer iIndex = llListFindList(g_lMenuIDs, [kID]);
if (~iIndex) g_lMenuIDs = llListReplaceList(g_lMenuIDs, [kID, kMenuID, sName], iIndex, iIndex + g_iMenuStride - 1);
else g_lMenuIDs += [kID, kMenuID, sName];
llMessageLinked(LINK_SET, DIALOG, (string)kID + "|" + sPrompt + "|" + (string)iPage + "|" + llDumpList2String(lChoices, "`") + "|" + llDumpList2String(lUtilityButtons, "`") + "|" + (string)iAuth, sName+"~"+llGetScriptName());
}

list ListRestrictions(integer r1, integer r2)
Expand Down Expand Up @@ -546,17 +540,14 @@ UserCommand(integer iNum, string sStr, key kID) {
if (iIndex > -1) {
if (iNum == CMD_OWNER || iNum==CMD_TRUSTED){
if (sChangekey == "add") {
llMessageLinked(LINK_SET, NOTIFY, "0"+"Restriction preset added: '"+sChangevalue+"'", kID);
llMessageLinked(LINK_SET, NOTIFY, "1"+"Restriction preset added: '"+sChangevalue+"'", kID);
ApplyAll(g_iRestrictions1 | llList2Integer(g_lMacros,iIndex+1),g_iRestrictions2 | llList2Integer(g_lMacros,iIndex+2),FALSE);
llOwnerSay("Button '"+llList2String(g_lMacros,iIndex)+"' has been added!");
} else if (sChangekey == "replace") {
llMessageLinked(LINK_SET, NOTIFY, "0"+"Replaced current restrictions with preset '"+sChangevalue+"'", kID);
llMessageLinked(LINK_SET, NOTIFY, "1"+"Replaced current restrictions with preset '"+sChangevalue+"'", kID);
ApplyAll(llList2Integer(g_lMacros,iIndex+1),llList2Integer(g_lMacros,iIndex+2),FALSE);
llOwnerSay("Preset '"+llList2String(g_lMacros,iIndex)+"' replaced your Restrictions!");
} else if (sChangekey == "clear") {
llMessageLinked(LINK_SET, NOTIFY, "0"+"Restriction presets cleared '"+sChangevalue+"'", kID);
llMessageLinked(LINK_SET, NOTIFY, "1"+"Restriction presets cleared '"+sChangevalue+"'", kID);
ApplyAll(g_iRestrictions1 ^ (g_iRestrictions1 & llList2Integer(g_lMacros,iIndex+1)),g_iRestrictions2 ^ (g_iRestrictions2 & llList2Integer(g_lMacros,iIndex+2)),FALSE);
llOwnerSay("Restriction preset '"+llList2String(g_lMacros,iIndex)+"' has been cleared!");
}
} else llMessageLinked(LINK_SET, NOTIFY, "0"+"Insufficient authority to set restrictions!", kID);
} else llInstantMessage(kID,"Restriction preset '"+sChangevalue+"' does not exist!");
Expand Down Expand Up @@ -648,10 +639,9 @@ state active
llMessageLinked(LINK_SET, MENUNAME_RESPONSE, g_sParentMenu+"|"+ g_sSubMenu,""); // Register menu "Restrictions"
}
} else if(iNum == DIALOG_RESPONSE){
integer iMenuIndex = llListFindList(g_lMenuIDs, [kID]);
if(iMenuIndex!=-1){
string sMenu = llList2String(g_lMenuIDs, iMenuIndex+1);
g_lMenuIDs = llDeleteSubList(g_lMenuIDs, iMenuIndex-1, iMenuIndex-2+g_iMenuStride);
integer iPos = llSubStringIndex(kID, "~"+llGetScriptName());
if(iPos>0){
string sMenu = llGetSubString(kID, 0, iPos-1);
list lMenuParams = llParseString2List(sStr, ["|"],[]);
key kAv = llList2Key(lMenuParams,0);
string sMsg = llList2String(lMenuParams,1);
Expand Down

0 comments on commit c62a3ce

Please # to comment.