diff options
Diffstat (limited to 'indra/newview/llmaniptranslate.cpp')
-rw-r--r-- | indra/newview/llmaniptranslate.cpp | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index c43ef73090..1f52f30c88 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -261,7 +261,7 @@ LLManipTranslate::~LLManipTranslate() void LLManipTranslate::handleSelect() { gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); - gFloaterTools->setStatusText("Drag to move, shift-drag to copy"); + gFloaterTools->setStatusText("move"); LLManip::handleSelect(); } @@ -269,7 +269,6 @@ void LLManipTranslate::handleDeselect() { mHighlightedPart = LL_NO_PART; mManipPart = LL_NO_PART; - gFloaterTools->setStatusText(""); LLManip::handleDeselect(); } @@ -296,14 +295,7 @@ BOOL LLManipTranslate::handleMouseDown(S32 x, S32 y, MASK mask) // Assumes that one of the arrows on an object was hit. BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) { - BOOL can_move = mObjectSelection->getObjectCount() != 0; - for (LLViewerObject* objectp = mObjectSelection->getFirstObject(); - objectp; - objectp = mObjectSelection->getNextObject()) - { - can_move = can_move && objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); - } - + BOOL can_move = canAffectSelection(); if (!can_move) { return FALSE; @@ -431,8 +423,6 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) } } - LLViewerObject *object; - // Suppress processing if mouse hasn't actually moved. // This may cause problems if the camera moves outside of the // rotation above. @@ -491,7 +481,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) return TRUE; } - object = selectNode->getObject(); + LLViewerObject* object = selectNode->getObject(); if (!object) { // somehow we lost the object! @@ -654,11 +644,11 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) LLVector3d clamped_relative_move = axis_magnitude * axis_d; // scalar multiply LLVector3 clamped_relative_move_f = (F32)axis_magnitude * axis_f; // scalar multiply - for(selectNode = mObjectSelection->getFirstNode(); - selectNode; - selectNode = mObjectSelection->getNextNode() ) + for (LLObjectSelection::iterator iter = mObjectSelection->begin(); + iter != mObjectSelection->end(); iter++) { - object = selectNode->getObject(); + LLSelectNode* selectNode = *iter; + LLViewerObject* object = selectNode->getObject(); // Only apply motion to root objects and objects selected // as "individual". @@ -1739,12 +1729,8 @@ void LLManipTranslate::renderText() } else { - LLViewerObject* objectp = mObjectSelection->getFirstRootObject(); - if(!objectp) - { - objectp = mObjectSelection->getFirstObject(); - } - + const BOOL children_ok = TRUE; + LLViewerObject* objectp = mObjectSelection->getFirstRootObject(children_ok); if (objectp) { renderXYZ(objectp->getPositionEdit()); @@ -2264,3 +2250,21 @@ void LLManipTranslate::renderGridVert(F32 x_trans, F32 y_trans, F32 r, F32 g, F3 } } + +// virtual +BOOL LLManipTranslate::canAffectSelection() +{ + BOOL can_move = mObjectSelection->getObjectCount() != 0; + if (can_move) + { + struct f : public LLSelectedObjectFunctor + { + virtual bool apply(LLViewerObject* objectp) + { + return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + } + } func; + can_move = mObjectSelection->applyToObjects(&func); + } + return can_move; +} |