diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-12-18 06:33:57 +0200 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-12-18 06:33:57 +0200 |
| commit | aed6313d7c755ae1b980074fc27dfd98267fca24 (patch) | |
| tree | bce1767cdba0a920eac80bc2c78c71bbc9899e15 /indra/newview/llvoavatarself.cpp | |
| parent | a069a21d318abd4eded46556c3252fec08eea84c (diff) | |
| parent | a592292242e29d0379ee72572a434359e1e892d1 (diff) | |
Merge branch 'main' into DRTVWR-594-maint-Y
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
| -rw-r--r-- | indra/newview/llvoavatarself.cpp | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 34efb39848..f12fc3babc 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -964,7 +964,7 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) } //-------------------------------------------------------------------- -// draw tractor beam when editing objects +// draw tractor (selection) beam when editing objects //-------------------------------------------------------------------- //virtual void LLVOAvatarSelf::idleUpdateTractorBeam() @@ -1252,6 +1252,27 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) return FALSE; } +bool LLVOAvatarSelf::hasAttachmentsInTrash() +{ + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + + for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) + { + LLViewerJointAttachment *attachment = iter->second; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject *attached_object = attachment_iter->get(); + if (attached_object && gInventory.isObjectDescendentOf(attached_object->getAttachmentItemID(), trash_id)) + { + return true; + } + } + } + return false; +} + // static BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) { @@ -2803,12 +2824,14 @@ BOOL LLVOAvatarSelf::needsRenderBeam() LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); BOOL is_touching_or_grabbing = (tool == LLToolGrab::getInstance() && LLToolGrab::getInstance()->isEditing()); - if (LLToolGrab::getInstance()->getEditingObject() && - LLToolGrab::getInstance()->getEditingObject()->isAttachment()) - { - // don't render selection beam on hud objects - is_touching_or_grabbing = FALSE; - } + LLViewerObject* objp = LLToolGrab::getInstance()->getEditingObject(); + if (objp // might need to be "!objp ||" instead of "objp &&". + && (objp->isAttachment() || objp->isAvatar())) + { + // don't render grab tool's selection beam on hud objects, + // attachments or avatars + is_touching_or_grabbing = FALSE; + } return is_touching_or_grabbing || (getAttachmentState() & AGENT_STATE_EDITING && LLSelectMgr::getInstance()->shouldShowSelection()); } |
