Skip to content

Commit

Permalink
Release 8.0.3
Browse files Browse the repository at this point in the history
>Fix a minor bug reported over discord by Anne Bloodrose where the animations menu and related chat command could not be used by public users if public is enabled.
  • Loading branch information
zontreck committed Mar 1, 2021
1 parent e9fdf65 commit 3f174bb
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 75 deletions.
41 changes: 20 additions & 21 deletions src/Apps/oc_detach.lsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

/*
This file is a part of OpenCollar.
Copyright ©2020
Copyright ©2021
: Contributors :
Expand Down Expand Up @@ -32,15 +32,15 @@ string Checkbox(integer iValue, string sLabel) {
//MESSAGE MAP
//integer CMD_ZERO = 0;
integer CMD_OWNER = 500;
//integer CMD_TRUSTED = 501;
//integer CMD_GROUP = 502;
integer CMD_TRUSTED = 501;
integer CMD_GROUP = 502;
integer CMD_WEARER = 503;
//integer CMD_EVERYONE = 504;
//integer CMD_RLV_RELAY = 507;
//integer CMD_SAFEWORD = 510;
//integer CMD_RELAY_SAFEWORD = 511;
integer CMD_EVERYONE = 504;
integer CMD_RLV_RELAY = 507;
integer CMD_SAFEWORD = 510;
integer CMD_RELAY_SAFEWORD = 511;

//integer NOTIFY = 1002;
integer NOTIFY = 1002;
integer REBOOT = -1000;

//integer LM_SETTING_SAVE = 2000;//scripts send messages on this channel to have settings saved
Expand All @@ -52,19 +52,19 @@ integer REBOOT = -1000;

integer MENUNAME_REQUEST = 3000;
integer MENUNAME_RESPONSE = 3001;
//integer MENUNAME_REMOVE = 3003;
integer MENUNAME_REMOVE = 3003;

//integer RLV_CMD = 6000;
//integer RLV_REFRESH = 6001;//RLV plugins should reinstate their restrictions upon receiving this message.
integer RLV_CMD = 6000;
integer RLV_REFRESH = 6001;//RLV plugins should reinstate their restrictions upon receiving this message.

//integer RLV_OFF = 6100; // send to inform plugins that RLV is disabled now, no message or key needed
//integer RLV_ON = 6101; // send to inform plugins that RLV is enabled now, no message or key needed
integer RLV_OFF = 6100; // send to inform plugins that RLV is disabled now, no message or key needed
integer RLV_ON = 6101; // send to inform plugins that RLV is enabled now, no message or key needed

integer DIALOG = -9000;
integer DIALOG_RESPONSE = -9001;
integer DIALOG_TIMEOUT = -9002;
string UPMENU = "BACK";
//string ALL = "ALL";
string ALL = "ALL";

Dialog(key kID, string sPrompt, list lChoices, list lUtilityButtons, integer iPage, integer iAuth, string sName) {
key kMenuID = llGenerateKey();
Expand All @@ -84,24 +84,23 @@ Menu(key kID, integer iAuth) {
}

UserCommand(integer iNum, string sStr, key kID) {
if (iNum<CMD_OWNER || iNum>CMD_WEARER) return;
if (llSubStringIndex(sStr,llToLower(g_sSubMenu)) && sStr != "menu "+g_sSubMenu) return;

if (sStr==g_sSubMenu || sStr == "menu "+g_sSubMenu) Menu(kID, iNum);
//else if (iNum!=CMD_OWNER && iNum!=CMD_TRUSTED && kID!=g_kWearer) RelayNotify(kID,"Access denied!",0);
else {
//integer iWSuccess = 0;
//string sChangetype = llList2String(llParseString2List(sStr, [" "], []),0);
//string sChangevalue = llList2String(llParseString2List(sStr, [" "], []),1);
//string sText;
integer iWSuccess = 0;
string sChangetype = llList2String(llParseString2List(sStr, [" "], []),0);
string sChangevalue = llList2String(llParseString2List(sStr, [" "], []),1);
string sText;

}
}

key g_kWearer;
list g_lMenuIDs;
integer g_iMenuStride;
//integer g_iLocked=FALSE;
integer g_iLocked=FALSE;
integer ALIVE = -55;
integer READY = -56;
integer STARTUP = -57;
Expand Down Expand Up @@ -143,7 +142,7 @@ state active
}
*/
link_message(integer iSender,integer iNum,string sStr,key kID){
if(iNum >= CMD_OWNER && iNum <= CMD_WEARER) UserCommand(iNum, sStr, kID);
if(iNum >= CMD_OWNER && iNum <= CMD_EVERYONE) UserCommand(iNum, sStr, kID);
else if(iNum == MENUNAME_REQUEST && sStr == g_sParentMenu)
llMessageLinked(iSender, MENUNAME_RESPONSE, g_sParentMenu+"|"+ g_sSubMenu,"");
else if(iNum == DIALOG_RESPONSE){
Expand Down
106 changes: 53 additions & 53 deletions src/collar/oc_anim.lsl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*
This file is a part of OpenCollar.
Copyright 2019
Copyright 2021
: Contributors :
Aria (Tashia Redrose)
* July 2020 - Rewrote oc_anim
* Dec 2020 - Fix bug where animations were not treated case insensitive, and where animations with a space in the name could not be played by chat command or menu button
* Feb 2021 - Fix Public Access
Felkami (Caraway Ohmai)
* Dec 2020 - Fixed #456, #462, #461, added LockMeister AO suppress
Expand Down Expand Up @@ -155,7 +156,6 @@ list GetPoseList(integer iType)

UserCommand(integer iNum, string sStr, key kID) {
string ssStr = llToLower(sStr);
if (iNum<CMD_OWNER || iNum>CMD_WEARER) return;
if (iNum == CMD_OWNER && ssStr == "runaway") {
g_lOwner = g_lTrust = g_lBlock = [];
return;
Expand Down Expand Up @@ -206,57 +206,60 @@ UserCommand(integer iNum, string sStr, key kID) {
llMessageLinked(LINK_SET, LM_SETTING_DELETE, "anim_pose","");
iRespringPoses=TRUE;
} else if(sChangetype == UP_ARROW || sChangetype == "up" || sChangetype == DOWN_ARROW || sChangetype == "down"){
// adjust current pose
//llOwnerSay(" up or down");
//sChangevalue="remenu";
integer iUp= FALSE;
iRespringPoses=TRUE;
if(sChangetype == UP_ARROW || sChangetype == "up")iUp=TRUE;
if(g_lCurrentAnimations == []){
// adjust standing
//llOwnerSay("up: "+(string)iUp+"; anims list blank");
if(iUp)g_fStandHover += g_fAdjustment;
else g_fStandHover-=g_fAdjustment;
if(g_fStandHover==0)llMessageLinked(LINK_SET,LM_SETTING_DELETE,"offset_standhover","");
else llMessageLinked(LINK_SET, LM_SETTING_SAVE, "offset_standhover="+(string)g_fStandHover,"");
llMessageLinked(LINK_SET, NOTIFY, "0The hover height for 'Standing' is now "+(string)g_fStandHover, g_kWearer);
} else {
integer iPos=llListFindList(g_lAdjustments,llList2List(g_lCurrentAnimations, 0, 0));
if(iPos==-1){
// llOwnerSay("up:"+(string)iUp+"; anim not found in adjustments");
// OK now we make a new entry

if(iUp)
g_lAdjustments+=[llList2String(g_lCurrentAnimations, 0), g_fAdjustment];
else
g_lAdjustments+=[llList2String(g_lCurrentAnimations, 0),-g_fAdjustment];


llMessageLinked(LINK_SET, NOTIFY, "0The hover height for '"+llList2String(g_lCurrentAnimations, 0)+"' is now "+(string)g_fAdjustment, g_kWearer);
// only owner or wearer
if(iNum == CMD_OWNER || iNum == CMD_WEARER){
// adjust current pose
//llOwnerSay(" up or down");
//sChangevalue="remenu";
integer iUp= FALSE;
iRespringPoses=TRUE;
if(sChangetype == UP_ARROW || sChangetype == "up")iUp=TRUE;
if(g_lCurrentAnimations == []){
// adjust standing
//llOwnerSay("up: "+(string)iUp+"; anims list blank");
if(iUp)g_fStandHover += g_fAdjustment;
else g_fStandHover-=g_fAdjustment;
if(g_fStandHover==0)llMessageLinked(LINK_SET,LM_SETTING_DELETE,"offset_standhover","");
else llMessageLinked(LINK_SET, LM_SETTING_SAVE, "offset_standhover="+(string)g_fStandHover,"");
llMessageLinked(LINK_SET, NOTIFY, "0The hover height for 'Standing' is now "+(string)g_fStandHover, g_kWearer);
} else {
integer iPos=llListFindList(g_lAdjustments,llList2List(g_lCurrentAnimations, 0, 0));
if(iPos==-1){
// llOwnerSay("up:"+(string)iUp+"; anim not found in adjustments");
// OK now we make a new entry

if(iUp)
g_lAdjustments+=[llList2String(g_lCurrentAnimations, 0), g_fAdjustment];
else
g_lAdjustments+=[llList2String(g_lCurrentAnimations, 0),-g_fAdjustment];


llMessageLinked(LINK_SET, NOTIFY, "0The hover height for '"+llList2String(g_lCurrentAnimations, 0)+"' is now "+(string)g_fAdjustment, g_kWearer);
} else {

//llOwnerSay("up:"+(string)iUp+"; anim update");
float fCurrent = (float)llList2String(g_lAdjustments, iPos+1);
if(iUp)
fCurrent+=g_fAdjustment;
else
fCurrent -= g_fAdjustment;


llMessageLinked(LINK_SET, NOTIFY, "0The hover height for '"+llList2String(g_lCurrentAnimations, 0)+"' is now "+(string)fCurrent, g_kWearer);
if(fCurrent!=0)
g_lAdjustments = llListReplaceList(g_lAdjustments, [fCurrent],iPos+1,iPos+1);
else
g_lAdjustments = llDeleteSubList(g_lAdjustments,iPos,iPos+1);
}
llMessageLinked(LINK_SET, LM_SETTING_SAVE, "offset_hovers="+llDumpList2String(g_lAdjustments,","),"");

//llOwnerSay("up:"+(string)iUp+"; anim update");
float fCurrent = (float)llList2String(g_lAdjustments, iPos+1);
if(iUp)
fCurrent+=g_fAdjustment;
else
fCurrent -= g_fAdjustment;
//llOwnerSay("up:"+(string)iUp+"; saved hover list");
if(llGetListLength(g_lCurrentAnimations)!=0)
PlayAnimation();


llMessageLinked(LINK_SET, NOTIFY, "0The hover height for '"+llList2String(g_lCurrentAnimations, 0)+"' is now "+(string)fCurrent, g_kWearer);
if(fCurrent!=0)
g_lAdjustments = llListReplaceList(g_lAdjustments, [fCurrent],iPos+1,iPos+1);
else
g_lAdjustments = llDeleteSubList(g_lAdjustments,iPos,iPos+1);
}
llMessageLinked(LINK_SET, LM_SETTING_SAVE, "offset_hovers="+llDumpList2String(g_lAdjustments,","),"");

//llOwnerSay("up:"+(string)iUp+"; saved hover list");
if(llGetListLength(g_lCurrentAnimations)!=0)
PlayAnimation();


}
}else llMessageLinked(LINK_SET, NOTIFY, "%NOACCESS% to changing height", kID);
} else if(sChangetype == "animlock"){
string text;
if(iNum == CMD_OWNER){
Expand Down Expand Up @@ -516,11 +519,8 @@ state active
}

link_message(integer iSender,integer iNum,string sStr,key kID){
if(iNum >= CMD_OWNER && iNum <= CMD_WEARER) UserCommand(iNum, sStr, kID);
else if(iNum == CMD_EVERYONE && (llToLower(sStr)==llToLower(g_sSubMenu) || llToLower(sStr) == "menu "+llToLower(g_sSubMenu)) ){
//Test if this is a denied auth
llMessageLinked(LINK_SET,NOTIFY,"0%NOACCESS% to animations.", kID);
}else if(iNum == MENUNAME_REQUEST && sStr == g_sParentMenu){
if(iNum >= CMD_OWNER && iNum <= CMD_EVERYONE) UserCommand(iNum, sStr, kID);
else if(iNum == MENUNAME_REQUEST && sStr == g_sParentMenu){
llMessageLinked(LINK_SET, MENUNAME_RESPONSE, g_sParentMenu+"|"+ g_sSubMenu,"");
llMessageLinked(LINK_SET, MENUNAME_REQUEST, g_sSubMenu, "");
}else if(iNum == MENUNAME_RESPONSE){
Expand Down
2 changes: 1 addition & 1 deletion web/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.2000
8.0.3000

0 comments on commit 3f174bb

Please sign in to comment.