diff options
Diffstat (limited to 'indra/newview/lltooldraganddrop.cpp')
-rw-r--r-- | indra/newview/lltooldraganddrop.cpp | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 14f17e8917..6910b8eced 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -57,6 +57,7 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llworld.h" +#include "llclipboard.h" // syntactic sugar #define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember)) @@ -802,7 +803,7 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info) LLViewerObject* hit_obj = pick_info.getObject(); LLSelectMgr::getInstance()->unhighlightAll(); - + bool highlight_object = false; // Treat attachments as part of the avatar they are attached to. if (hit_obj != NULL) { @@ -844,16 +845,7 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info) { target = DT_OBJECT; hit_face = pick_info.mObjectFace; - // if any item being dragged will be applied to the object under our cursor - // highlight that object - for (S32 i = 0; i < (S32)mCargoIDs.size(); i++) - { - if (mCargoTypes[i] != DAD_OBJECT || (pick_info.mKeyMask & MASK_CONTROL)) - { - LLSelectMgr::getInstance()->highlightObjectAndFamily(hit_obj); - break; - } - } + highlight_object = true; } } else if (pick_info.mPickType == LLPickInfo::PICK_LAND) @@ -899,6 +891,19 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info) } } + if (highlight_object && mLastAccept > ACCEPT_NO_LOCKED) + { + // if any item being dragged will be applied to the object under our cursor + // highlight that object + for (S32 i = 0; i < (S32)mCargoIDs.size(); i++) + { + if (mCargoTypes[i] != DAD_OBJECT || (pick_info.mKeyMask & MASK_CONTROL)) + { + LLSelectMgr::getInstance()->highlightObjectAndFamily(hit_obj); + break; + } + } + } ECursorType cursor = acceptanceToCursor( mLastAccept ); gViewerWindow->getWindow()->setCursor( cursor ); @@ -1652,6 +1657,13 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( return ACCEPT_NO; } + const LLUUID &outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + if(gInventory.isObjectDescendentOf(item->getUUID(), outbox_id)) + { + return ACCEPT_NO; + } + + if( drop ) { if(mSource == SOURCE_LIBRARY) @@ -2055,6 +2067,12 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory( return ACCEPT_NO; } + const LLUUID &outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + if(gInventory.isObjectDescendentOf(category->getUUID(), outbox_id)) + { + return ACCEPT_NO; + } + if(drop) { BOOL append = ( (mask & MASK_SHIFT) ? TRUE : FALSE ); @@ -2482,6 +2500,10 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory( item = (LLViewerInventoryItem*)preview->getDragItem(); } } + else if(mSource == SOURCE_VIEWER) + { + item = (LLViewerInventoryItem*)gClipboard.getSourceObject(); + } if(item) return item; if(cat) return cat; return NULL; |