diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-02-07 18:10:55 -0800 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-02-07 18:10:55 -0800 |
commit | e21b685172046c4895a2a48376b485fbafedf66c (patch) | |
tree | c98f1183e867036e2edae75b833d2f3eea757c2c /indra | |
parent | 4a4752718e31b402e6bb6a99e94fb4d714b6ce3d (diff) |
PATH-245: Adding functionality to teleport avatar to the last known position of the character. Might still need to refresh the characters current position before teleport, as future enhancement.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterpathfindingcharacters.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index fe65ee3159..9788fe5760 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -343,7 +343,22 @@ void LLFloaterPathfindingCharacters::onDeleteCharactersClicked() void LLFloaterPathfindingCharacters::onTeleportCharacterToMeClicked()
{
- llwarns << "functionality has not yet been implemented to teleport me tothe character" << llendl;
+ std::vector<LLScrollListItem*> selectedItems = mCharactersScrollList->getAllSelected();
+ llassert(selectedItems.size() == 1);
+ if (selectedItems.size() == 1)
+ {
+ std::vector<LLScrollListItem*>::const_reference selectedItemRef = selectedItems.front();
+ const LLScrollListItem *selectedItem = selectedItemRef;
+ PathfindingCharacterMap::const_iterator characterIter = mPathfindingCharacters.find(selectedItem->getUUID().asString());
+ const LLPathfindingCharacter &character = characterIter->second;
+ LLVector3 characterLocation = character.getLocation();
+
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region != NULL)
+ {
+ gAgent.teleportRequest(region->getHandle(), characterLocation, true);
+ }
+ }
}
void LLFloaterPathfindingCharacters::updateCharactersList()
@@ -487,11 +502,11 @@ void LLFloaterPathfindingCharacters::updateActionFields() void LLFloaterPathfindingCharacters::setEnableActionFields(BOOL pEnabled)
{
mLabelActions->setEnabled(pEnabled);
- mShowBeaconCheckBox->setEnabled(pEnabled);
- mTakeBtn->setEnabled(pEnabled);
- mTakeCopyBtn->setEnabled(pEnabled);
- mReturnBtn->setEnabled(pEnabled);
- mDeleteBtn->setEnabled(pEnabled);
+ mShowBeaconCheckBox->setEnabled(false && pEnabled);
+ mTakeBtn->setEnabled(false && pEnabled);
+ mTakeCopyBtn->setEnabled(false && pEnabled);
+ mReturnBtn->setEnabled(false && pEnabled);
+ mDeleteBtn->setEnabled(false && pEnabled);
mTeleportBtn->setEnabled(pEnabled && (mCharactersScrollList->getNumSelected() == 1));
}
|