diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 33736185c1abde13e49b618c507b4f467f1dc421..3dd57d11db3d114ed91100472b6a6e12f326ef3d 100755 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -64,6 +64,7 @@ #include "llspatialpartition.h" #include "llviewershadermgr.h" // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) +#include "rlvactions.h" #include "rlvhandler.h" // [/RLVa:KB] @@ -245,7 +246,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) } // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Added: RLVa-1.3.0c - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canEdit(vobjp)) ) + if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canEdit(vobjp)) ) { continue; } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 193f28b9d726b486d7eaab19b478aa5edf04a5a2..d4efc48c3c2e66623ed0b6caf7305a30a001f114 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -4313,7 +4313,7 @@ void LLSelectMgr::deselectAllIfTooFar() bool apply(LLSelectNode* pNode) { const LLViewerObject* pObj = pNode->getObject(); - return (!pNode->isTransient()) && (pObj) && (!gRlvHandler.canEdit(pObj)) && (pObj->getID() != LLViewerMediaFocus::getInstance()->getFocusedObjectID()); + return (!pNode->isTransient()) && (pObj) && (!RlvActions::canEdit(pObj)) && (pObj->getID() != LLViewerMediaFocus::getInstance()->getFocusedObjectID()); } } f; if (mSelectedObjects->getFirstRootNode(&f, TRUE)) diff --git a/indra/newview/lltoolface.cpp b/indra/newview/lltoolface.cpp index 4b02174009d2017d29b4580f6c6a0083eba8c8a4..c1707bba30d75a90eb4e157b12b7ef41038e0ed1 100755 --- a/indra/newview/lltoolface.cpp +++ b/indra/newview/lltoolface.cpp @@ -40,6 +40,7 @@ #include "llviewerwindow.h" #include "llfloatertools.h" // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) +#include "rlvactions.h" #include "rlvhandler.h" // [/RLVa:KB] @@ -95,7 +96,7 @@ void LLToolFace::pickCallback(const LLPickInfo& pick_info) // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c if ( (rlv_handler_t::isEnabled()) && - ( (!gRlvHandler.canEdit(hit_obj)) || + ( (!RlvActions::canEdit(hit_obj)) || ((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(hit_obj, pick_info.mObjectOffset))) ) ) { return; diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index e9d2d9a7b33f08315e2ff29d2f9ea823c42b1d04..5cdb5388c416fd58751fd0d3e803b165c42f44d9 100755 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -47,8 +47,9 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llworld.h" -// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.0 +#include "rlvactions.h" +#include "rlvhelper.h" #include "llfloaterreg.h" // [/RLVa:KB] @@ -86,9 +87,9 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi } // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c - if ( (object) && (rlv_handler_t::isEnabled()) ) + if ( (object) && (RlvActions::isRlvEnabled()) ) { - if (!gRlvHandler.canEdit(object)) + if (!RlvActions::canEdit(object)) { if (!temp_select) return LLSelectMgr::getInstance()->getSelection(); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 0afc7273d41bf1b8774ef78703baf404607d7818..638a0720f500da52310b83eef423c948bd762c97 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -103,6 +103,7 @@ #include "llfloaterperms.h" #include "llvocache.h" // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvactions.h" #include "rlvhandler.h" #include "rlvlocks.h" // [/RLVa:KB] @@ -5831,7 +5832,7 @@ BOOL LLViewerObject::permTransfer() const BOOL LLViewerObject::allowOpen() const { // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c - return !flagInventoryEmpty() && (permYouOwner() || permModify()) && ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canEdit(this))); + return !flagInventoryEmpty() && (permYouOwner() || permModify()) && ((!RlvActions::isRlvEnabled()) || (RlvActions::canEdit(this))); // [/RLVa:KB] // return !flagInventoryEmpty() && (permYouOwner() || permModify()); } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 01f2b0f2d726fa70fd90ee2285486d7b20eb965d..da74fad7d75601dd65a819a5cc49f28677cc39fa 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -77,8 +77,8 @@ #include "llvoavatar.h" #include "llvocache.h" #include "llmaterialmgr.h" -// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.0 +#include "rlvactions.h" #include "rlvlocks.h" // [/RLVa:KB] @@ -4434,10 +4434,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, // if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c const LLViewerObject* pObj = facep->getViewerObject(); - if ( (pObj->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) && - ( (!rlv_handler_t::isEnabled()) || - ( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) && - (gRlvHandler.canEdit(pObj)) ) ) ) + if ( (pObj->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) && + ( (!RlvActions::isRlvEnabled()) || + ( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) && + (RlvActions::canEdit(pObj)) ) ) ) // [/RVLa:KB] { return; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 586c803ce58bcbef2d7a458f3ec6c703e50b6e7a..04477a07ee2a00aeafeab21998d36eb2b43905fb 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -115,8 +115,8 @@ #include "llpathfindingpathtool.h" #include "llscenemonitor.h" #include "llprogressview.h" -// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.0 +#include "rlvactions.h" #include "rlvlocks.h" // [/RLVa:KB] @@ -3545,9 +3545,9 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) // [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f const LLViewerObject* pObj = drawablep->getVObj(); if ( (pObj) && (pObj->isSelected()) && - ( (!rlv_handler_t::isEnabled()) || + ( (!RlvActions::isRlvEnabled()) || ( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) && - (gRlvHandler.canEdit(pObj)) ) ) ) + (RlvActions::canEdit(pObj)) ) ) ) // [/RVLa:KB] { return; diff --git a/indra/newview/rlvactions.cpp b/indra/newview/rlvactions.cpp index cd8c32b369c043b9d649420602741cec61d75613..cec3d7946260813386f5febbb4da086a51140e0f 100644 --- a/indra/newview/rlvactions.cpp +++ b/indra/newview/rlvactions.cpp @@ -143,9 +143,21 @@ bool RlvActions::isLocalTp(const LLVector3d& posGlobal) // World interaction // -bool RlvActions::canSit(LLViewerObject* pObj, const LLVector3& posOffset /*= LLVector3::zero*/) +bool RlvActions::canEdit(const LLViewerObject* pObj) { - // The user can sit on the specified object if: + // User can edit the specified object if: + // - not generally restricted from editing (or the object's root is an exception) + // - not specifically restricted from editing this object's root + return + (pObj) && + ((!hasBehaviour(RLV_BHVR_EDIT)) || (gRlvHandler.isException(RLV_BHVR_EDIT, pObj->getRootEdit()->getID()))) && + ((!hasBehaviour(RLV_BHVR_EDITOBJ)) || (!gRlvHandler.isException(RLV_BHVR_EDITOBJ, pObj->getRootEdit()->getID()))); +} + + +bool RlvActions::canSit(const LLViewerObject* pObj, const LLVector3& posOffset /*= LLVector3::zero*/) +{ + // User can sit on the specified object if: // - not prevented from sitting // - not prevented from standing up or not currently sitting // - not standtp restricted or not currently sitting (if the user is sitting and tried to sit elsewhere the tp would just kick in) diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index 4857ead416e4c466e62da748d4739daee0f22bd6..11cadff5c3f3d7b25c3c74d9ecff4c1f410e2300 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -116,10 +116,15 @@ public: // World interaction // ================= public: + /* + * Returns true if the user can edit the specified object + */ + static bool canEdit(const LLViewerObject* pObj); + /* * Returns true if the user can sit up on the specified object */ - static bool canSit(LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero); + static bool canSit(const LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero); /* * Returns true if the user can stand up (returns true if the user isn't currently sitting) diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index a7922041f48d09fe3e819bc017a2458a76a81417..8215b5a434a84b00cfae4c4c1f1b32a76b3b5834 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -638,7 +638,7 @@ bool RlvSelectHasLockedAttach::apply(LLSelectNode* pNode) bool RlvSelectIsEditable::apply(LLSelectNode* pNode) { const LLViewerObject* pObj = pNode->getObject(); - return (pObj) && (!gRlvHandler.canEdit(pObj)); + return (pObj) && (!RlvActions::canEdit(pObj)); } // Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index 64acf59c5df94b8a901d62104b97ba0af39f94c7..fbaf33b3ffe924205abb6105388b54a15b2de55e 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -94,7 +94,6 @@ public: void setSitSource(const LLVector3d& posSource) { m_posSitSource = posSource; } // @standtp // Command specific helper functions - bool canEdit(const LLViewerObject* pObj) const; // @edit and @editobj bool canShowHoverText(const LLViewerObject* pObj) const; // @showhovertext* command family bool canTouch(const LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero) const; // @touch bool filterChat(std::string& strUTF8Text, bool fFilterEmote) const; // @sendchat, @recvchat and @redirchat @@ -226,18 +225,6 @@ extern rlv_handler_t gRlvHandler; // Inlined member functions // -// Checked: 2010-11-29 (RLVa-1.3.0c) | Added: RLVa-1.3.0c -inline bool RlvHandler::canEdit(const LLViewerObject* pObj) const -{ - // The specified object can be edited if: - // - not generally restricted from editing (or the object's root is an exception) - // - not specifically restricted from editing this object's root - return - (pObj) && - ((!hasBehaviour(RLV_BHVR_EDIT)) || (isException(RLV_BHVR_EDIT, pObj->getRootEdit()->getID()))) && - ((!hasBehaviour(RLV_BHVR_EDITOBJ)) || (!isException(RLV_BHVR_EDITOBJ, pObj->getRootEdit()->getID()))); -} - // Checked: 2010-03-27 (RLVa-1.4.0a) | Modified: RLVa-1.0.0f inline bool RlvHandler::canShowHoverText(const LLViewerObject *pObj) const {