summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-02-09 10:16:24 -0800
committerTodd Stinson <stinson@lindenlab.com>2012-02-09 10:16:24 -0800
commitbf7ef74f1e736ee3c098dd193022953113ca204f (patch)
treeca114802c3cb4e0f3aaa463ab630e6aa1234e93b /indra
parent537749509d9afcbc0606f30ea7452416cf5fb6d6 (diff)
PATH-245: Fixing an issue with character selection.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterpathfindingcharacters.cpp45
-rw-r--r--indra/newview/llfloaterpathfindingcharacters.h3
2 files changed, 38 insertions, 10 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp
index de431bbf89..33fc1efd8e 100644
--- a/indra/newview/llfloaterpathfindingcharacters.cpp
+++ b/indra/newview/llfloaterpathfindingcharacters.cpp
@@ -45,6 +45,7 @@
#include "lluuid.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
+#include "llviewermenu.h"
#include "llselectmgr.h"
//---------------------------------------------------------------------------
@@ -81,7 +82,6 @@ BOOL LLFloaterPathfindingCharacters::postBuild()
mCharactersScrollList = findChild<LLScrollListCtrl>("pathfinding_characters");
llassert(mCharactersScrollList != NULL);
mCharactersScrollList->setCommitCallback(boost::bind(&LLFloaterPathfindingCharacters::onCharactersSelectionChange, this));
- mCharactersScrollList->setCommitOnSelectionChange(true);
mCharactersScrollList->sortByColumnIndex(0, true);
mCharactersStatus = findChild<LLTextBase>("characters_status");
@@ -123,6 +123,35 @@ BOOL LLFloaterPathfindingCharacters::postBuild()
void LLFloaterPathfindingCharacters::onOpen(const LLSD& pKey)
{
sendCharactersDataGetRequest();
+ selectNoneCharacters();
+ mCharactersScrollList->setCommitOnSelectionChange(true);
+}
+
+void LLFloaterPathfindingCharacters::onClose(bool app_quitting)
+{
+ mCharactersScrollList->setCommitOnSelectionChange(false);
+ selectNoneCharacters();
+ if (mCharacterSelection.notNull())
+ {
+ std::vector<LLViewerObject *> selectedObjects;
+
+ LLObjectSelection *charactersSelected = mCharacterSelection.get();
+ for (LLObjectSelection::valid_iterator characterIter = charactersSelected->valid_begin();
+ characterIter != charactersSelected->valid_end(); ++characterIter)
+ {
+ LLSelectNode *characterNode = *characterIter;
+ selectedObjects.push_back(characterNode->getObject());
+ }
+
+ for (std::vector<LLViewerObject *>::const_iterator selectedObjectIter = selectedObjects.begin();
+ selectedObjectIter != selectedObjects.end(); ++selectedObjectIter)
+ {
+ LLViewerObject *selectedObject = *selectedObjectIter;
+ LLSelectMgr::getInstance()->deselectObjectAndFamily(selectedObject);
+ }
+
+ mCharacterSelection.clear();
+ }
}
LLFloaterPathfindingCharacters::EMessagingState LLFloaterPathfindingCharacters::getMessagingState() const
@@ -163,7 +192,7 @@ LLFloaterPathfindingCharacters::LLFloaterPathfindingCharacters(const LLSD& pSeed
mReturnBtn(NULL),
mDeleteBtn(NULL),
mTeleportBtn(NULL),
- mSelection()
+ mCharacterSelection()
{
mSelfHandle.bind(this);
}
@@ -171,7 +200,7 @@ LLFloaterPathfindingCharacters::LLFloaterPathfindingCharacters(const LLSD& pSeed
LLFloaterPathfindingCharacters::~LLFloaterPathfindingCharacters()
{
mPathfindingCharacters.clear();
- mSelection.clear();
+ mCharacterSelection.clear();
}
void LLFloaterPathfindingCharacters::sendCharactersDataGetRequest()
@@ -268,10 +297,10 @@ void LLFloaterPathfindingCharacters::setMessagingState(EMessagingState pMessagin
void LLFloaterPathfindingCharacters::onCharactersSelectionChange()
{
-#if 0
- std::vector<LLScrollListItem*> selectedItems = mCharactersScrollList->getAllSelected();
-
+ mCharacterSelection.clear();
LLSelectMgr::getInstance()->deselectAll();
+
+ std::vector<LLScrollListItem*> selectedItems = mCharactersScrollList->getAllSelected();
if (!selectedItems.empty())
{
int numSelectedItems = selectedItems.size();
@@ -287,17 +316,15 @@ void LLFloaterPathfindingCharacters::onCharactersSelectionChange()
LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID());
if (viewerObject != NULL)
{
- viewerObject->setSelected(true);
viewerObjects.push_back(viewerObject);
}
}
if (!viewerObjects.empty())
{
- mSelection = LLSelectMgr::getInstance()->selectObjectAndFamily(viewerObjects);
+ mCharacterSelection = LLSelectMgr::getInstance()->selectObjectAndFamily(viewerObjects);
}
}
-#endif
updateCharactersStatusMessage();
updateActionFields();
diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h
index 689d2ff418..53d22a8951 100644
--- a/indra/newview/llfloaterpathfindingcharacters.h
+++ b/indra/newview/llfloaterpathfindingcharacters.h
@@ -64,6 +64,7 @@ public:
virtual BOOL postBuild();
virtual void onOpen(const LLSD& pKey);
+ virtual void onClose(bool app_quitting);
EMessagingState getMessagingState() const;
BOOL isMessagingInProgress() const;
@@ -85,7 +86,7 @@ private:
LLButton *mReturnBtn;
LLButton *mDeleteBtn;
LLButton *mTeleportBtn;
- LLObjectSelectionHandle mSelection;
+ LLObjectSelectionHandle mCharacterSelection;
// Does its own instance management, so clients not allowed
// to allocate or destroy.