diff options
author | Monroe Linden <monroe@lindenlab.com> | 2009-11-05 14:18:16 -0800 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2009-11-05 14:18:16 -0800 |
commit | 44fc2e5ba3a4aee321f13e0c0486a171725007a9 (patch) | |
tree | c50de74618cc81c5d6888f9931617040862516c3 | |
parent | 1bf5f1465d9c1620df2582b4bb8131bacb344c09 (diff) |
Restore the media focus ring. This fixes DEV-42166.
Media focus is still tracked separately from LLSelectMgr (which was a change made during a refactor a while ago), but LLViewerMediaFocus now keeps LLSelectMgr updated with the current media focus when it changes.
Added a special case for media focus to LLSelectMgr::deselectAllIfTooFar(), since it was making the focus ring not show up when media focus was on distant media.
-rw-r--r-- | indra/newview/llselectmgr.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llviewermediafocus.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llviewermediafocus.h | 2 |
3 files changed, 17 insertions, 15 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 26e668adb5..dd07a3c015 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3406,7 +3406,7 @@ void LLSelectMgr::deselectAll() { return; } - + // Zap the angular velocity, as the sim will set it to zero for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); iter != mSelectedObjects->end(); iter++ ) @@ -3496,6 +3496,7 @@ void LLSelectMgr::deselectAllIfTooFar() LLVector3d selectionCenter = getSelectionCenterGlobal(); if (gSavedSettings.getBOOL("LimitSelectDistance") && (!mSelectedObjects->getPrimaryObject() || !mSelectedObjects->getPrimaryObject()->isAvatar()) + && (mSelectedObjects->getPrimaryObject() != LLViewerMediaFocus::getInstance()->getFocusedObject()) && !mSelectedObjects->isAttachment() && !selectionCenter.isExactlyZero()) { @@ -4912,6 +4913,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) { inspect_item_id = inspect_instance->getSelectedUUID(); } + LLUUID focus_item_id = LLViewerMediaFocus::getInstance()->getFocusedObjectID(); for (S32 pass = 0; pass < 2; pass++) { for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); @@ -4925,7 +4927,11 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) { continue; } - if(objectp->getID() == inspect_item_id) + if (objectp->getID() == focus_item_id) + { + node->renderOneSilhouette(gFocusMgr.getFocusColor()); + } + else if(objectp->getID() == inspect_item_id) { node->renderOneSilhouette(sHighlightInspectColor); } @@ -4979,19 +4985,6 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) } } -#if 0 - // Hilight focused media object - { - LLViewerObject* objectp = LLViewerMediaFocus::getInstance()->getFocusedObject(); - if(objectp) - { - // FIXME: how do I construct a silhouette for an object that's not selected? - // Would we need to add another LLObjectSelectionHandle for this purpose? - node->renderOneSilhouette(gFocusMgr.getFocusColor()); - } - } -#endif - if (for_hud && avatar) { glMatrixMode(GL_PROJECTION); diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index 657c58364f..b2a0fa4b1c 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -77,6 +77,10 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac { old_media_impl->focus(false); } + + // Always clear the current selection. If we're setting focus on a face, we'll reselect the correct object below. + LLSelectMgr::getInstance()->deselectAll(); + mSelection = NULL; if (media_impl.notNull() && objectp.notNull()) { @@ -87,6 +91,9 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac mFocusedObjectFace = face; mFocusedObjectNormal = pick_normal; + // Set the selection in the selection manager so we can draw the focus ring. + mSelection = LLSelectMgr::getInstance()->selectObjectOnly(objectp, face); + // Focusing on a media face clears its disable flag. media_impl->setDisabled(false); diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index e5f36d341c..89ee0ae283 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -76,6 +76,7 @@ public: LLViewerMediaImpl* getFocusedMediaImpl(); LLViewerObject* getFocusedObject(); S32 getFocusedFace() { return mFocusedObjectFace; } + LLUUID getFocusedObjectID() { return mFocusedObjectID; } // These look up (by uuid) and return the values that were set with setHoverFace. They will return null if the objects have been destroyed. LLViewerMediaImpl* getHoverMediaImpl(); @@ -95,6 +96,7 @@ protected: private: LLHandle<LLPanelPrimMediaControls> mMediaControls; + LLObjectSelectionHandle mSelection; LLUUID mFocusedObjectID; S32 mFocusedObjectFace; |