summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpathfindingcharacters.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-04-05 15:59:34 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-04-05 15:59:34 -0700
commit9d22b22d962321822a6be6a23150e6d5f939cd50 (patch)
tree0dfeab5f7d33c5de6ef8e67af59695529266dddf /indra/newview/llfloaterpathfindingcharacters.cpp
parentd23fbd0dd0dca9819965b850313dea92da913430 (diff)
PATH-482: BUGFIX Automatically reloading the character and linksets floaters on region crossing.
Diffstat (limited to 'indra/newview/llfloaterpathfindingcharacters.cpp')
-rw-r--r--indra/newview/llfloaterpathfindingcharacters.cpp94
1 files changed, 53 insertions, 41 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp
index d174d822cd..6fc1b8f051 100644
--- a/indra/newview/llfloaterpathfindingcharacters.cpp
+++ b/indra/newview/llfloaterpathfindingcharacters.cpp
@@ -47,6 +47,7 @@
#include "llviewerobjectlist.h"
#include "llviewermenu.h"
#include "llselectmgr.h"
+#include "llenvmanager.h"
//---------------------------------------------------------------------------
// LLFloaterPathfindingCharacters
@@ -112,10 +113,20 @@ void LLFloaterPathfindingCharacters::onOpen(const LLSD& pKey)
{
mSelectionUpdateSlot = LLSelectMgr::getInstance()->mUpdateSignal.connect(boost::bind(&LLFloaterPathfindingCharacters::updateControls, this));
}
+
+ if (!mRegionBoundarySlot.connected())
+ {
+ mRegionBoundarySlot = LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterPathfindingCharacters::onRegionBoundaryCross, this));
+ }
}
void LLFloaterPathfindingCharacters::onClose(bool pAppQuitting)
{
+ if (mRegionBoundarySlot.connected())
+ {
+ mRegionBoundarySlot.disconnect();
+ }
+
if (mSelectionUpdateSlot.connected())
{
mSelectionUpdateSlot.disconnect();
@@ -167,16 +178,6 @@ void LLFloaterPathfindingCharacters::openCharactersViewer()
LLFloaterReg::toggleInstanceOrBringToFront("pathfinding_characters");
}
-LLFloaterPathfindingCharacters::EMessagingState LLFloaterPathfindingCharacters::getMessagingState() const
-{
- return mMessagingState;
-}
-
-BOOL LLFloaterPathfindingCharacters::isMessagingInProgress() const
-{
- return (mMessagingState == kMessagingGetRequestSent);
-}
-
LLFloaterPathfindingCharacters::LLFloaterPathfindingCharacters(const LLSD& pSeed)
: LLFloater(pSeed),
mCharactersScrollList(NULL),
@@ -191,6 +192,7 @@ LLFloaterPathfindingCharacters::LLFloaterPathfindingCharacters(const LLSD& pSeed
mDeleteButton(NULL),
mTeleportButton(NULL),
mMessagingState(kMessagingUnknown),
+ mMessagingRequestId(0U),
mCharacterListPtr(),
mCharacterSelection(),
mSelectionUpdateSlot()
@@ -201,6 +203,11 @@ LLFloaterPathfindingCharacters::~LLFloaterPathfindingCharacters()
{
}
+LLFloaterPathfindingCharacters::EMessagingState LLFloaterPathfindingCharacters::getMessagingState() const
+{
+ return mMessagingState;
+}
+
void LLFloaterPathfindingCharacters::setMessagingState(EMessagingState pMessagingState)
{
mMessagingState = pMessagingState;
@@ -209,22 +216,42 @@ void LLFloaterPathfindingCharacters::setMessagingState(EMessagingState pMessagin
void LLFloaterPathfindingCharacters::requestGetCharacters()
{
- llassert(!isMessagingInProgress());
- if (!isMessagingInProgress())
+ switch (LLPathfindingManager::getInstance()->requestGetCharacters(++mMessagingRequestId, boost::bind(&LLFloaterPathfindingCharacters::handleNewCharacters, this, _1, _2, _3)))
+ {
+ case LLPathfindingManager::kRequestStarted :
+ setMessagingState(kMessagingGetRequestSent);
+ break;
+ case LLPathfindingManager::kRequestCompleted :
+ clearCharacters();
+ setMessagingState(kMessagingComplete);
+ break;
+ case LLPathfindingManager::kRequestNotEnabled :
+ clearCharacters();
+ setMessagingState(kMessagingNotEnabled);
+ break;
+ case LLPathfindingManager::kRequestError :
+ setMessagingState(kMessagingGetError);
+ break;
+ default :
+ setMessagingState(kMessagingGetError);
+ llassert(0);
+ break;
+ }
+}
+
+void LLFloaterPathfindingCharacters::handleNewCharacters(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::ERequestStatus pCharacterRequestStatus, LLPathfindingCharacterListPtr pCharacterListPtr)
+{
+ llassert(pRequestId <= mMessagingRequestId);
+ if (pRequestId == mMessagingRequestId)
{
- switch (LLPathfindingManager::getInstance()->requestGetCharacters(boost::bind(&LLFloaterPathfindingCharacters::handleNewCharacters, this, _1, _2)))
+ mCharacterListPtr = pCharacterListPtr;
+ updateScrollList();
+
+ switch (pCharacterRequestStatus)
{
- case LLPathfindingManager::kRequestStarted :
- setMessagingState(kMessagingGetRequestSent);
- break;
case LLPathfindingManager::kRequestCompleted :
- clearCharacters();
setMessagingState(kMessagingComplete);
break;
- case LLPathfindingManager::kRequestNotEnabled :
- clearCharacters();
- setMessagingState(kMessagingNotEnabled);
- break;
case LLPathfindingManager::kRequestError :
setMessagingState(kMessagingGetError);
break;
@@ -236,26 +263,6 @@ void LLFloaterPathfindingCharacters::requestGetCharacters()
}
}
-void LLFloaterPathfindingCharacters::handleNewCharacters(LLPathfindingManager::ERequestStatus pCharacterRequestStatus, LLPathfindingCharacterListPtr pCharacterListPtr)
-{
- mCharacterListPtr = pCharacterListPtr;
- updateScrollList();
-
- switch (pCharacterRequestStatus)
- {
- case LLPathfindingManager::kRequestCompleted :
- setMessagingState(kMessagingComplete);
- break;
- case LLPathfindingManager::kRequestError :
- setMessagingState(kMessagingGetError);
- break;
- default :
- setMessagingState(kMessagingGetError);
- llassert(0);
- break;
- }
-}
-
void LLFloaterPathfindingCharacters::onCharactersSelectionChange()
{
mCharacterSelection.clear();
@@ -345,6 +352,11 @@ void LLFloaterPathfindingCharacters::onTeleportCharacterToMeClicked()
}
}
+void LLFloaterPathfindingCharacters::onRegionBoundaryCross()
+{
+ requestGetCharacters();
+}
+
void LLFloaterPathfindingCharacters::selectAllCharacters()
{
mCharactersScrollList->selectAll();