diff --git a/indra/newview/fsareasearch.cpp b/indra/newview/fsareasearch.cpp index aeecbe4734..29e56b129a 100644 --- a/indra/newview/fsareasearch.cpp +++ b/indra/newview/fsareasearch.cpp @@ -1626,6 +1626,59 @@ void FSPanelAreaSearchList::updateName(const LLUUID& id, const std::string& name } } +bool FSPanelAreaSearchList::onContextMenuItemEnableRLV(const LLSD& userdata) +{ + if (!RlvActions::isRlvEnabled()) + { + return true; + } + + if (RlvActions::hasBehaviour(RLV_BHVR_INTERACT)) + { + return false; + } + + const std::string& parameter = userdata.asStringRef(); + + std::vector selected = mResultList->getAllSelected(); + + for (const auto item : selected) + { + const LLUUID& object_id = item->getUUID(); + LLViewerObject* objectp = gObjectList.findObject(object_id); + if (!objectp) + { + return false; + } + + if (parameter == "delete") + { + if (!rlvCanDeleteOrReturn(objectp)) + { + return false; + } + } + else if (parameter == "touch") + { + if (!RlvActions::canTouch(objectp)) return false; + } + else if (parameter == "edit") + { + if (!RlvActions::canEdit(objectp)) return false; + } + else if (parameter == "sit") + { + if (!RlvActions::canSit(objectp)) return false; + } + else if (parameter == "teleport") + { + if (!RlvActions::canTeleportToLocal(objectp->getPositionGlobal())) return false; + } + } + + return true; +} + bool FSPanelAreaSearchList::onContextMenuItemEnable(const LLSD& userdata) { const std::string& parameter = userdata.asStringRef(); diff --git a/indra/newview/fsareasearch.h b/indra/newview/fsareasearch.h index 44a67c0f87..8b768a5919 100644 --- a/indra/newview/fsareasearch.h +++ b/indra/newview/fsareasearch.h @@ -305,6 +305,7 @@ private: bool onContextMenuItemClick(const LLSD& userdata); bool onContextMenuItemEnable(const LLSD& userdata); + bool onContextMenuItemEnableRLV(const LLSD& userdata); void onColumnVisibilityChecked(const LLSD& userdata); bool onEnableColumnVisibilityChecked(const LLSD& userdata); diff --git a/indra/newview/fsareasearchmenu.cpp b/indra/newview/fsareasearchmenu.cpp index bbef3c73ed..f47159dd06 100644 --- a/indra/newview/fsareasearchmenu.cpp +++ b/indra/newview/fsareasearchmenu.cpp @@ -41,6 +41,7 @@ LLContextMenu* FSAreaSearchMenu::createMenu() registrar.add("AreaSearch.Action", boost::bind(&FSAreaSearchMenu::onContextMenuItemClick, this, _2)); enable_registrar.add("AreaSearch.Enable", boost::bind(&FSAreaSearchMenu::onContextMenuItemEnable, this, _2)); + enable_registrar.add("AreaSearch.RLV", boost::bind(&FSAreaSearchMenu::onContextMenuItemEnableRLV, this, _2)); return createFromFile("menu_fs_area_search.xml"); } @@ -63,3 +64,13 @@ bool FSAreaSearchMenu::onContextMenuItemEnable(const LLSD& userdata) } return false; } + +bool FSAreaSearchMenu::onContextMenuItemEnableRLV(const LLSD& userdata) +{ + FSAreaSearch* search = LLFloaterReg::findTypedInstance("area_search"); + if (search && search->getPanelList()) + { + return search->getPanelList()->onContextMenuItemEnableRLV(userdata); + } + return false; +} diff --git a/indra/newview/fsareasearchmenu.h b/indra/newview/fsareasearchmenu.h index 2853c015f7..014691e7de 100644 --- a/indra/newview/fsareasearchmenu.h +++ b/indra/newview/fsareasearchmenu.h @@ -37,6 +37,7 @@ public: private: void onContextMenuItemClick(const LLSD& userdata); bool onContextMenuItemEnable(const LLSD& userdata); + bool onContextMenuItemEnableRLV(const LLSD& userdata); }; extern FSAreaSearchMenu gFSAreaSearchMenu; diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index b264df085a..d4d5808e46 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -64,6 +64,9 @@ #include "v3math.h" #include "v4color.h" +#include "rlvactions.h" // Respect RLVa restrictions +#include "rlvcommon.h" // Respect RLVa restrictions + #define DEFAULT_BEACON_WIDTH 6 //--------------------------------------------------------------------------- @@ -819,6 +822,29 @@ void LLFloaterPathfindingObjects::updateStateOnActionControls() int numSelectedItems = mObjectsScrollList->getNumSelected(); bool isEditEnabled = (numSelectedItems > 0); + // Respect RLVa restrictions + if (RlvActions::isRlvEnabled()) + { + if ( + !rlvCanDeleteOrReturn() + || RlvActions::hasBehaviour(RLV_BHVR_FARTOUCH) + || RlvActions::hasBehaviour(RLV_BHVR_TOUCHALL) + || RlvActions::hasBehaviour(RLV_BHVR_TOUCHWORLD) + || RlvActions::hasBehaviour(RLV_BHVR_TOUCHME) + || RlvActions::hasBehaviour(RLV_BHVR_TOUCHTHIS) + || RlvActions::hasBehaviour(RLV_BHVR_INTERACT) + ) + { + isEditEnabled = false; + } + + if (RlvActions::hasBehaviour(RLV_BHVR_TPLOCAL)) + { + numSelectedItems = 0; + } + } + // + mShowBeaconCheckBox->setEnabled(isEditEnabled); mTakeButton->setEnabled(isEditEnabled && visible_take_object()); mTakeCopyButton->setEnabled(isEditEnabled && enable_object_take_copy()); diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index 1d93c91a32..3bc91a7aad 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -787,16 +787,16 @@ bool rlvMenuEnableIfNot(const LLSD& sdParam) // Checked: 2011-05-28 (RLVa-1.4.6) | Modified: RLVa-1.4.0 bool rlvCanDeleteOrReturn(const LLViewerObject* pObj) { - // Block if: @rez=n restricted and owned by us or a group *or* @unsit=n restricted and being sat on by us + // Block if: @rez=n or @edit=n restricted and owned by us or a group *or* @unsit=n restricted and being sat on by us return - ( (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || ((!pObj->permYouOwner()) && (!pObj->permGroupOwner())) ) && + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT) && !gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || ((!pObj->permYouOwner()) && (!pObj->permGroupOwner())) ) && ( (!gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (!isAgentAvatarValid()) || (!pObj->getRootEdit()->isChild(gAgentAvatarp)) ); } // Checked: 2011-05-28 (RLVa-1.4.6) | Modified: RLVa-1.4.0 bool rlvCanDeleteOrReturn() { - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) ) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) ) { struct RlvCanDeleteOrReturn : public LLSelectedObjectFunctor { diff --git a/indra/newview/skins/default/xui/en/menu_fs_area_search.xml b/indra/newview/skins/default/xui/en/menu_fs_area_search.xml index 2215bfece5..e820312582 100644 --- a/indra/newview/skins/default/xui/en/menu_fs_area_search.xml +++ b/indra/newview/skins/default/xui/en/menu_fs_area_search.xml @@ -12,6 +12,9 @@ + + + + + + + + + + + + @@ -106,6 +142,12 @@ + +