summaryrefslogtreecommitdiff
path: root/indra/newview/llmaniptranslate.cpp
diff options
context:
space:
mode:
authorChristian Goetze <cg@lindenlab.com>2007-10-10 00:01:43 +0000
committerChristian Goetze <cg@lindenlab.com>2007-10-10 00:01:43 +0000
commit5ec8bbbe2244ea70d8aa74b5c572351632699425 (patch)
tree12a4e92720c531105a21ef4f9f363b8572d72a3a /indra/newview/llmaniptranslate.cpp
parentb3b62c3b9ef32c4dbcae51cd3ef582734d5717bb (diff)
svn merge -r71238:71367 svn+ssh://svn/svn/linden/branches/maint-ui-qa3
Diffstat (limited to 'indra/newview/llmaniptranslate.cpp')
-rw-r--r--indra/newview/llmaniptranslate.cpp50
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;
+}