summaryrefslogtreecommitdiff
path: root/indra/newview/llteleporthistorystorage.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-02-09 01:59:15 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-02-09 01:59:15 +0200
commitd12514af8193888f9eb66bb92a9c2ac3d4e0e56e (patch)
tree5aa45a1a417b80e236eed7bee5417cbc338270e5 /indra/newview/llteleporthistorystorage.cpp
parent74d3f9d017a424d69bfc256ecc1062fdaa3b18c3 (diff)
SL-14797 Normalize right-click menus on Landmarks & Picks Part#3
Diffstat (limited to 'indra/newview/llteleporthistorystorage.cpp')
-rw-r--r--indra/newview/llteleporthistorystorage.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp
index 8a5704939a..93fa457bd0 100644
--- a/indra/newview/llteleporthistorystorage.cpp
+++ b/indra/newview/llteleporthistorystorage.cpp
@@ -33,6 +33,8 @@
#include "lldir.h"
#include "llteleporthistory.h"
#include "llagent.h"
+#include "llfloaterreg.h"
+#include "llfloaterworldmap.h"
// Max offset for two global positions to consider them as equal
const F64 MAX_GLOBAL_POS_OFFSET = 5.0f;
@@ -253,3 +255,23 @@ void LLTeleportHistoryStorage::goToItem(S32 idx)
gAgent.teleportViaLocation(mItems[idx].mGlobalPos);
}
+void LLTeleportHistoryStorage::showItemOnMap(S32 idx)
+{
+ // Validate specified index.
+ if (idx < 0 || idx >= (S32)mItems.size())
+ {
+ LL_WARNS() << "Invalid teleport history index (" << idx << ") specified" << LL_ENDL;
+ dump();
+ return;
+ }
+
+ LLVector3d landmark_global_pos = mItems[idx].mGlobalPos;
+
+ LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance();
+ if (!landmark_global_pos.isExactlyZero() && worldmap_instance)
+ {
+ worldmap_instance->trackLocation(landmark_global_pos);
+ LLFloaterReg::showInstance("world_map", "center");
+ }
+}
+