diff options
Diffstat (limited to 'indra/newview/llfloaterpathfindingcharacters.cpp')
-rw-r--r-- | indra/newview/llfloaterpathfindingcharacters.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 99d262344c..4cf82d162c 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -134,26 +134,20 @@ void LLFloaterPathfindingCharacters::requestGetObjects() LLPathfindingManager::getInstance()->requestGetCharacters(getNewRequestId(), boost::bind(&LLFloaterPathfindingCharacters::handleNewObjectList, this, _1, _2, _3)); } -LLSD LLFloaterPathfindingCharacters::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) +void LLFloaterPathfindingCharacters::buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr) { llassert(pObjectListPtr != NULL); llassert(!pObjectListPtr->isEmpty()); - LLSD scrollListData = LLSD::emptyArray(); - for (LLPathfindingObjectList::const_iterator objectIter = pObjectListPtr->begin(); objectIter != pObjectListPtr->end(); ++objectIter) { - const LLPathfindingCharacter *characterPtr = dynamic_cast<const LLPathfindingCharacter *>(objectIter->second.get()); - LLSD element = buildCharacterScrollListData(characterPtr); - scrollListData.append(element); + const LLPathfindingObjectPtr objectPtr = objectIter->second; + const LLPathfindingCharacter *characterPtr = dynamic_cast<const LLPathfindingCharacter *>(objectPtr.get()); + llassert(characterPtr != NULL); - if (characterPtr->hasOwner() && !characterPtr->hasOwnerName()) - { - rebuildScrollListAfterAvatarNameLoads(characterPtr->getUUID()); - } + LLSD scrollListItemData = buildCharacterScrollListItemData(characterPtr); + addObjectToScrollList(objectPtr, scrollListItemData); } - - return scrollListData; } void LLFloaterPathfindingCharacters::updateControlsOnScrollListChange() @@ -201,9 +195,9 @@ void LLFloaterPathfindingCharacters::onShowPhysicsCapsuleClicked() } } -LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListData(const LLPathfindingCharacter *pCharacterPtr) const +LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListItemData(const LLPathfindingCharacter *pCharacterPtr) const { - LLSD columns; + LLSD columns = LLSD::emptyArray(); columns[0]["column"] = "name"; columns[0]["value"] = pCharacterPtr->getName(); @@ -231,11 +225,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListData(const LLPathfi columns[4]["column"] = "altitude"; columns[4]["value"] = llformat("%1.0f m", pCharacterPtr->getLocation()[2]); - LLSD element; - element["id"] = pCharacterPtr->getUUID().asString(); - element["column"] = columns; - - return element; + return columns; } void LLFloaterPathfindingCharacters::updateStateOnDisplayControls() |