diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 816515426a..90f8f84ea4 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3864,6 +3864,14 @@ BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& r return TRUE; } +BOOL LLSelectMgr::isSelfAvatarSelected() +{ + if (mAllowSelectAvatar) + { + return (getSelection()->getObjectCount() == 1) && (getSelection()->getFirstRootObject() == gAgentAvatarp); + } + return FALSE; +} //-------------------------------------------------------------------- // Duplicate objects @@ -3886,6 +3894,17 @@ void LLSelectMgr::selectDuplicate(const LLVector3& offset, BOOL select_copy) make_ui_sound("UISndInvalidOp"); return; } + if (!canDuplicate()) + { + LLSelectNode* node = getSelection()->getFirstRootNode(NULL, true); + if (node) + { + LLSD args; + args["OBJ_NAME"] = node->mName; + LLNotificationsUtil::add("NoCopyPermsNoObject", args); + return; + } + } LLDuplicateData data; data.offset = offset; @@ -6765,8 +6784,28 @@ void LLSelectMgr::pauseAssociatedAvatars() mSelectedObjects->mSelectType = getSelectTypeForObject(object); + bool is_attached = false; if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT && - isAgentAvatarValid() && object->getParent() != NULL) + isAgentAvatarValid()) + { + // Selection can be obsolete, confirm that this is an attachment + LLViewerObject* parent = (LLViewerObject*)object->getParent(); + while (parent != NULL) + { + if (parent->isAvatar()) + { + is_attached = true; + break; + } + else + { + parent = (LLViewerObject*)parent->getParent(); + } + } + } + + + if (is_attached) { if (object->isAnimatedObject()) { @@ -6784,14 +6823,12 @@ void LLSelectMgr::pauseAssociatedAvatars() mPauseRequests.push_back(gAgentAvatarp->requestPause()); } } - else + else if (object && object->isAnimatedObject() && object->getControlAvatar()) { - if (object && object->isAnimatedObject() && object->getControlAvatar()) - { - // Is a non-attached animated object. Pause the control avatar. - mPauseRequests.push_back(object->getControlAvatar()->requestPause()); - } + // Is a non-attached animated object. Pause the control avatar. + mPauseRequests.push_back(object->getControlAvatar()->requestPause()); } + } } |