summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2022-03-23 15:35:10 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2022-03-23 15:37:58 +0200
commitb3cd910e759bf2d0755526e0cc4972a19405ff6b (patch)
tree249122c203fe0292f1058d8e6b672eeada0de49f
parent4e536adea7acab1ea684ccb1945a6dbd1b52e546 (diff)
SL-17037 Center map on current location after teleporting
-rw-r--r--indra/newview/llfloaterworldmap.cpp16
-rw-r--r--indra/newview/llfloaterworldmap.h4
2 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 6ca134ecd3..3ec1e17bd8 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -61,6 +61,7 @@
#include "lltrans.h"
#include "llviewerinventory.h" // LLViewerInventoryItem
#include "llviewermenu.h"
+#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "llviewerstats.h"
#include "llviewertexture.h"
@@ -330,6 +331,8 @@ LLFloaterWorldMap::~LLFloaterWorldMap()
mFriendObserver = NULL;
gFloaterWorldMap = NULL;
+
+ mTeleportFinishConnection.disconnect();
}
//static
@@ -343,12 +346,16 @@ void LLFloaterWorldMap::onClose(bool app_quitting)
{
// While we're not visible, discard the overlay images we're using
LLWorldMap::getInstance()->clearImageRefs();
+ mTeleportFinishConnection.disconnect();
}
// virtual
void LLFloaterWorldMap::onOpen(const LLSD& key)
{
- bool center_on_target = (key.asString() == "center");
+ mTeleportFinishConnection = LLViewerParcelMgr::getInstance()->
+ setTeleportFinishedCallback(boost::bind(&LLFloaterWorldMap::onTeleportFinished, this));
+
+ bool center_on_target = (key.asString() == "center");
mIsClosing = FALSE;
@@ -1570,6 +1577,13 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
}
}
+void LLFloaterWorldMap::onTeleportFinished()
+{
+ if(isInVisibleChain())
+ {
+ LLWorldMapView::setPan(0, 0, TRUE);
+ }
+}
void LLFloaterWorldMap::onCommitSearchResult()
{
diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h
index 30cf1b9910..14a9c26fb9 100644
--- a/indra/newview/llfloaterworldmap.h
+++ b/indra/newview/llfloaterworldmap.h
@@ -151,7 +151,7 @@ protected:
void onCoordinatesCommit();
void onCommitSearchResult();
- void cacheLandmarkPosition();
+ void onTeleportFinished();
private:
LLPanel* mPanel; // Panel displaying the map
@@ -195,6 +195,8 @@ private:
LLCtrlListInterface * mListFriendCombo;
LLCtrlListInterface * mListLandmarkCombo;
LLCtrlListInterface * mListSearchResults;
+
+ boost::signals2::connection mTeleportFinishConnection;
};
extern LLFloaterWorldMap* gFloaterWorldMap;