summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpathfindingcharacters.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-08-23 15:11:10 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-08-23 15:11:10 -0700
commit6d84272d38a4d09819ae03f4d967195ec3bd660b (patch)
treef020454f9144a769081e44ee7cd4acae7042394b /indra/newview/llfloaterpathfindingcharacters.cpp
parentff95dd4a43fd888a9b7353abcbfa701e4844a3a5 (diff)
parentfcfc686d9c4125c7bf35fcc97cb40b18dd9a4fc1 (diff)
Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-beta.
Diffstat (limited to 'indra/newview/llfloaterpathfindingcharacters.cpp')
-rw-r--r--indra/newview/llfloaterpathfindingcharacters.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp
index 99d262344c..69c9d94dfa 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()
@@ -168,6 +162,22 @@ S32 LLFloaterPathfindingCharacters::getNameColumnIndex() const
return 0;
}
+S32 LLFloaterPathfindingCharacters::getOwnerNameColumnIndex() const
+{
+ return 2;
+}
+
+std::string LLFloaterPathfindingCharacters::getOwnerName(const LLPathfindingObject *pObject) const
+{
+ return (pObject->hasOwner()
+ ? (pObject->hasOwnerName()
+ ? (pObject->isGroupOwned()
+ ? (pObject->getOwnerName() + " " + getString("character_owner_group"))
+ : pObject->getOwnerName())
+ : getString("character_owner_loading"))
+ : getString("character_owner_unknown"));
+}
+
const LLColor4 &LLFloaterPathfindingCharacters::getBeaconColor() const
{
return mBeaconColor;
@@ -201,9 +211,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();
@@ -212,13 +222,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListData(const LLPathfi
columns[1]["value"] = pCharacterPtr->getDescription();
columns[2]["column"] = "owner";
- columns[2]["value"] = (pCharacterPtr->hasOwner()
- ? (pCharacterPtr->hasOwnerName()
- ? (pCharacterPtr->isGroupOwned()
- ? (pCharacterPtr->getOwnerName() + " " + getString("character_owner_group"))
- : pCharacterPtr->getOwnerName())
- : getString("character_owner_loading"))
- : getString("character_owner_unknown"));
+ columns[2]["value"] = getOwnerName(pCharacterPtr);
S32 cpuTime = llround(pCharacterPtr->getCPUTime());
std::string cpuTimeString = llformat("%d", cpuTime);
@@ -231,11 +235,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()