From 34d95fdc01690fe65ac89136cbc4782a9a22af95 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 10 Jul 2012 18:29:22 -0700 Subject: PATH-807: BUGFIX Filtering which objects will contain the right-click context-sensitive menu option of "Show in linksets...". --- indra/newview/llselectmgr.cpp | 30 ++++++++++++++++++++++++++++++ indra/newview/llselectmgr.h | 2 ++ indra/newview/llviewermenu.cpp | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 71ea5d80a9..b9449e806f 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2786,6 +2786,36 @@ BOOL LLSelectMgr::selectGetRootsNonCharacter() } +//----------------------------------------------------------------------------- +// selectGetEditableLinksets() - return TRUE if all objects are editable +// pathfinding linksets +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetEditableLinksets() +{ + for (LLObjectSelection::iterator iter = getSelection()->begin(); + iter != getSelection()->end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !object || !node->mValid ) + { + return FALSE; + } + if (object->flagUsePhysics() || + object->flagTemporaryOnRez() || + object->flagCharacter() || + object->flagAnimSource() || + (!gAgent.isGodlike() && + !gAgent.canManageEstate() && + !object->permYouOwner() && + !object->permMove())) + { + return FALSE; + } + } + return TRUE; +} + //----------------------------------------------------------------------------- // selectGetRootsTransfer() - return TRUE if current agent can transfer all // selected root objects. diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index bf40ab458f..feab6ebdf8 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -584,6 +584,8 @@ public: BOOL selectGetRootsNonCharacter(); BOOL selectGetNonCharacter(); + BOOL selectGetEditableLinksets(); + // returns TRUE if selected objects can be transferred. BOOL selectGetRootsTransfer(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 06ffd2df92..3eb0538328 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2804,7 +2804,7 @@ bool enable_object_build() bool enable_object_select_in_pathfinding_linksets() { - return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetNonCharacter(); + return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetEditableLinksets(); } bool enable_object_select_in_pathfinding_characters() -- cgit v1.2.3