aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-30 15:24:29 -0700
committerMcCabe Maxsted2009-09-30 18:57:37 -0700
commit34b9ef2f04a6e48bf31d130497dfe83e20a12b68 (patch)
tree17203f62657a9fd57c72cb3e38198de73ce65092 /linden/indra/newview/llviewermenu.cpp
parentFixed Join Call button truncated in group IMs (regression) (diff)
downloadmeta-impy-34b9ef2f04a6e48bf31d130497dfe83e20a12b68.zip
meta-impy-34b9ef2f04a6e48bf31d130497dfe83e20a12b68.tar.gz
meta-impy-34b9ef2f04a6e48bf31d130497dfe83e20a12b68.tar.bz2
meta-impy-34b9ef2f04a6e48bf31d130497dfe83e20a12b68.tar.xz
Fixed Unlink not enabling when Edit Linked Parts enabled
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewermenu.cpp44
1 files changed, 37 insertions, 7 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index ba24c16..f9ae401 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -169,6 +169,7 @@
169#include "lltool.h" 169#include "lltool.h"
170#include "lltoolbar.h" 170#include "lltoolbar.h"
171#include "lltoolcomp.h" 171#include "lltoolcomp.h"
172#include "lltoolface.h"
172#include "lltoolfocus.h" 173#include "lltoolfocus.h"
173#include "lltoolgrab.h" 174#include "lltoolgrab.h"
174#include "lltoolmgr.h" 175#include "lltoolmgr.h"
@@ -4594,15 +4595,44 @@ class LLToolsEnableUnlink : public view_listener_t
4594 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4595 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4595 { 4596 {
4596 bool new_value = false; 4597 bool new_value = false;
4597 if (LLSelectMgr::getInstance()->selectGetAllRootsValid() && 4598 if (LLToolMgr::getInstance()->getCurrentTool() != LLToolFace::getInstance())
4598 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
4599 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment())
4600 { 4599 {
4601 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 0 && 4600 if (LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
4602 LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 4601 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
4603 LLSelectMgr::getInstance()->getSelection()->getObjectCount()) 4602 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment())
4604 { 4603 {
4605 new_value = true; 4604 // LL's viewer unlinks the last linkset selected,
4605 // regardless of how many linksets or prims are selected total.
4606 // Preserve that behavior when enabling the unlink option.
4607 if (gSavedSettings.getBOOL("EditLinkedParts"))
4608 {
4609 struct f : public LLSelectedNodeFunctor
4610 {
4611 virtual bool apply(LLSelectNode* pNode)
4612 {
4613 // Return the first selection node that is
4614 // 1) not a root prim
4615 // 2) or a root prim that has child prims
4616 // or in other words: any prim that is part of a linkset
4617 return (pNode->getObject() != pNode->getObject()->getRootEdit()) ||
4618 (pNode->getObject()->numChildren() != 0);
4619 }
4620 } func;
4621
4622 if (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(&func, TRUE))
4623 {
4624 // the selection contains at least one prim (child or root) that is part of a linkset
4625 new_value = true;
4626 }
4627 }
4628 else
4629 {
4630 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() !=
4631 LLSelectMgr::getInstance()->getSelection()->getObjectCount())
4632 {
4633 new_value = true;
4634 }
4635 }
4606 } 4636 }
4607 } 4637 }
4608 4638