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.
meow-7.2.2
Monroe Linden 2009-11-05 14:18:16 -08:00
parent 1bf5f1465d
commit 44fc2e5ba3
3 changed files with 17 additions and 15 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;