From 16ba7ae82cb2e9323e7bf527a57079bf4cfeb634 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 26 Jun 2012 14:47:50 -0700 Subject: Updating the teleport-me-to-it behavior for the characters and linksets. Firstly, to remove the direct call to gAgent.teleportRequest() which is being made into a private function. Secondly, to check the viewer object list to see if the object exists there, and if so, to use that location as the teleport destination. --- indra/newview/llfloaterpathfindingobjects.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'indra/newview/llfloaterpathfindingobjects.cpp') diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index 9bfbc582bd..eb18fa00d5 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -57,9 +57,10 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "v4color.h" #include "pipeline.h" -#include "llfloaterreg.h" +#include "v3dmath.h" +#include "v3math.h" +#include "v4color.h" #define DEFAULT_BEACON_WIDTH 6 @@ -488,14 +489,20 @@ void LLFloaterPathfindingObjects::teleportToSelectedObject() std::vector::const_reference selectedItemRef = selectedItems.front(); const LLScrollListItem *selectedItem = selectedItemRef; llassert(mObjectList != NULL); - const LLPathfindingObjectPtr objectPtr = mObjectList->find(selectedItem->getUUID().asString()); - const LLVector3 &objectLocation = objectPtr->getLocation(); - - LLViewerRegion* region = gAgent.getRegion(); - if (region != NULL) + LLVector3d teleportLocation; + LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID()); + if (viewerObject == NULL) + { + // If we cannot find the object in the viewer list, teleport to the last reported position + const LLPathfindingObjectPtr objectPtr = mObjectList->find(selectedItem->getUUID().asString()); + teleportLocation = gAgent.getPosGlobalFromAgent(objectPtr->getLocation()); + } + else { - gAgent.teleportRequest(region->getHandle(), objectLocation, true); + // If we can find the object in the viewer list, teleport to the known current position + teleportLocation = viewerObject->getPositionGlobal(); } + gAgent.teleportViaLocationLookAt(teleportLocation); } } -- cgit v1.2.3 From 78910cf3016fc55eaf8214640b348df0f8bcdeda Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 26 Jun 2012 18:04:19 -0700 Subject: Updating the header licensing comments. --- indra/newview/llfloaterpathfindingobjects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterpathfindingobjects.cpp') diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index eb18fa00d5..da664038cf 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -1,6 +1,6 @@ /** * @file llfloaterpathfindingobjects.cpp -* @brief Implementation of llfloaterpathfindingobjects +* @brief Base class for both the pathfinding linksets and characters floater. * @author Stinson@lindenlab.com * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ -- cgit v1.2.3 From 685a672b74550ca0dbf8a816257c84c9c44fd34d Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 28 Jun 2012 15:37:55 -0700 Subject: Cleaning up new files in preparation for merge into viewer-release. --- indra/newview/llfloaterpathfindingobjects.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llfloaterpathfindingobjects.cpp') diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index da664038cf..847997836b 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -57,7 +57,6 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "pipeline.h" #include "v3dmath.h" #include "v3math.h" #include "v4color.h" @@ -835,4 +834,3 @@ LLPathfindingObjectPtr LLFloaterPathfindingObjects::findObject(const LLScrollLis return objectPtr; } - -- cgit v1.2.3 From 9366a7775c811b8f2e0ac24872d7d744ff2b54c5 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 29 Jun 2012 17:36:40 -0700 Subject: PATH-797: BUGFIX Altering how the rows are being added to the scrolllist widget to avoid a regression that occurred after merging from viewer-release recently caused the time to load a large number of elements to increase substainally. --- indra/newview/llfloaterpathfindingobjects.cpp | 36 ++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterpathfindingobjects.cpp') diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index 847997836b..e246265be9 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -41,10 +41,12 @@ #include "llcheckboxctrl.h" #include "llenvmanager.h" #include "llfloater.h" +#include "llfontgl.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llpathfindingmanager.h" #include "llresmgr.h" +#include "llscrolllistcell.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" #include "llselectmgr.h" @@ -346,10 +348,38 @@ void LLFloaterPathfindingObjects::rebuildObjectsScrollList() { LLSD scrollListData = convertObjectsIntoScrollListData(mObjectList); llassert(scrollListData.isArray()); - for (LLSD::array_const_iterator elementIter = scrollListData.beginArray(); elementIter != scrollListData.endArray(); ++elementIter) + + LLScrollListCell::Params cellParams; + cellParams.font = LLFontGL::getFontSansSerif(); + + for (LLSD::array_const_iterator rowElementIter = scrollListData.beginArray(); rowElementIter != scrollListData.endArray(); ++rowElementIter) { - const LLSD &element = *elementIter; - mObjectsScrollList->addElement(element); + const LLSD &rowElement = *rowElementIter; + + LLScrollListItem::Params rowParams; + llassert(rowElement.has("id")); + llassert(rowElement.get("id").isString()); + rowParams.value = rowElement.get("id"); + + llassert(rowElement.has("column")); + llassert(rowElement.get("column").isArray()); + const LLSD &columnElement = rowElement.get("column"); + for (LLSD::array_const_iterator cellIter = columnElement.beginArray(); cellIter != columnElement.endArray(); ++cellIter) + { + const LLSD &cellElement = *cellIter; + + llassert(cellElement.has("column")); + llassert(cellElement.get("column").isString()); + cellParams.column = cellElement.get("column").asString(); + + llassert(cellElement.has("value")); + llassert(cellElement.get("value").isString()); + cellParams.value = cellElement.get("value").asString(); + + rowParams.columns.add(cellParams); + } + + mObjectsScrollList->addRow(rowParams); } } -- cgit v1.2.3