Skip to content
Snippets Groups Projects
Commit 33a527dd authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files
parents 152ce1e4 95680620
Branches
Tags
No related merge requests found
...@@ -894,13 +894,30 @@ void LLPanelPeople::updateNearbyList() ...@@ -894,13 +894,30 @@ 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)
{ {
mNearbyCountText->setTextArg("[REGION]", cur_region->getName()); 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)
{
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