Skip to content
Snippets Groups Projects
Unverified Commit 9bbb5724 authored by Rye Mutt's avatar Rye Mutt :bread: Committed by GitHub
Browse files

Merge pull request #14 from afallenhope/FLN-fix-people-nearby-panel

FLN: Nearby List Fix
parents 60f40ab0 5b1d0e3a
Branches
Tags
No related merge requests found
...@@ -894,13 +894,31 @@ void LLPanelPeople::updateNearbyList() ...@@ -894,13 +894,31 @@ void LLPanelPeople::updateNearbyList()
// [/RLVa:KB] // [/RLVa:KB]
LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), ALControlCache::NearMeRange); LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), ALControlCache::NearMeRange);
int count_in_region = 0;
LLViewerRegion* cur_region = gAgent.getRegion(); LLViewerRegion* cur_region = gAgent.getRegion();
mNearbyCountText->setTextArg("[COUNT]", std::to_string(mNearbyList->size()));
if (cur_region) if (!cur_region)
{
LL_WARNS() << "Current region is null" << LL_ENDL;
return;
}
// Iterate through avatars in the region.
// The nearby list reports the avatars in 4096m range (ALControlCache::NearMeRange)
// Reported UUIDs may not be in same region.
// Also the TOTAL changes based on your filter results --FLN
for (size_t i = 0; i < positions.size(); ++i)
{ {
mNearbyCountText->setTextArg("[REGION]", cur_region->getName()); mNearbyCountText->setTextArg("[REGION]", cur_region->getName());
if (cur_region->pointInRegionGlobal(positions[i]))
{
count_in_region++;
}
} }
mNearbyCountText->setTextArg("[TOTAL]", std::to_string(mNearbyList->size()));
mNearbyCountText->setTextArg("[COUNT]", std::to_string(count_in_region));
mNearbyCountText->setTextArg("[REGION]", RlvActions::canShowLocation() ? cur_region->getName() : "[REDACTED]");
// [RLVa:KB] - Checked: RLVa-2.0.3 // [RLVa:KB] - Checked: RLVa-2.0.3
} }
else else
......
...@@ -184,7 +184,7 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip ...@@ -184,7 +184,7 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip
use_ellipses="true" use_ellipses="true"
skip_link_underline="true" skip_link_underline="true"
name="nearbycount"> name="nearbycount">
There are [COUNT] avatars in [REGION]. There are [TOTAL] avatars total and [COUNT] in [REGION].
</text> </text>
<layout_stack <layout_stack
clip="false" clip="false"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment