Fix radar popping up on right click focus if not announce when closed.

This commit is contained in:
Lirusaito
2019-01-15 17:36:28 -05:00
parent 9c06bbb8eb
commit 0b52275e53
2 changed files with 11 additions and 2 deletions

View File

@@ -315,7 +315,7 @@ namespace
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLFloaterAvatarList::instance().setFocusAvatar(get_focused_list_id_selected());
LLFloaterAvatarList::setFocusAvatar(get_focused_list_id_selected());
return true;
}
};
@@ -1149,9 +1149,16 @@ void LLFloaterAvatarList::removeFocusFromAll()
}
}
// static
void LLFloaterAvatarList::setFocusAvatar(const LLUUID& id)
{
if (!gAgentCamera.lookAtObject(id, false) && !lookAtAvatar(id)) return;
if (auto inst = getIfExists())
inst->setFocusAvatarInternal(id);
}
void LLFloaterAvatarList::setFocusAvatarInternal(const LLUUID& id)
{
av_list_t::iterator iter = std::find_if(mAvatars.begin(),mAvatars.end(),LLAvatarListEntry::uuidMatch(id));
if (iter == mAvatars.end()) return;
removeFocusFromAll();

View File

@@ -264,7 +264,7 @@ public:
/**
* @brief Focus camera on specified avatar
*/
void setFocusAvatar(const LLUUID& id);
static void setFocusAvatar(const LLUUID& id);
/**
* @brief Focus camera on previous avatar
@@ -332,6 +332,8 @@ public:
void updateAvatarSorting();
private:
void setFocusAvatarInternal(const LLUUID& id);
/**
* @brief Pointer to the avatar scroll list
*/