From 398b8564e19deacc27a631e4668b00ed4a6ffe12 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 29 Oct 2010 15:42:29 -0700 Subject: STORM-420 : allow teleport when double clicking the minimap if doubleclick teleport is on, allow beacon setting if not --- indra/newview/llfloatermap.cpp | 30 ++++++++++++++++++++++++++---- indra/newview/llnetmap.h | 2 ++ 2 files changed, 28 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index a1d291fea6..8a48265313 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -43,6 +43,8 @@ #include "lldraghandle.h" #include "lltextbox.h" #include "llviewermenu.h" +#include "llfloaterworldmap.h" +#include "llagent.h" // // Constants @@ -122,11 +124,31 @@ BOOL LLFloaterMap::postBuild() return TRUE; } -BOOL LLFloaterMap::handleDoubleClick( S32 x, S32 y, MASK mask ) +BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask) { - // If floater is minimized, minimap should be shown on doubleclick (STORM-299) - std::string floater_to_show = this->isMinimized() ? "mini_map" : "world_map"; - LLFloaterReg::showInstance(floater_to_show); + LLVector3d pos_global = mMap->viewPosToGlobal(x, y); + + // If we're not tracking a beacon already, double-click will set one + if (!LLTracker::isTracking(NULL)) + { + LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance(); + if (world_map) + { + world_map->trackLocation(pos_global); + } + } + + if (gSavedSettings.getBOOL("DoubleClickTeleport")) + { + // If DoubleClickTeleport is on, double clicking the minimap will teleport there + gAgent.teleportViaLocationLookAt(pos_global); + } + else + { + // If floater is minimized, minimap should be shown on doubleclick (STORM-299) + std::string floater_to_show = this->isMinimized() ? "mini_map" : "world_map"; + LLFloaterReg::showInstance(floater_to_show); + } return TRUE; } diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 650bce0da4..e053b1c177 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -38,6 +38,7 @@ class LLColor4U; class LLCoordGL; class LLImageRaw; class LLViewerTexture; +class LLFloaterMap; class LLNetMap : public LLUICtrl { @@ -55,6 +56,7 @@ public: protected: LLNetMap (const Params & p); friend class LLUICtrlFactory; + friend class LLFloaterMap; public: virtual ~LLNetMap(); -- cgit v1.2.3 From 87e2b01fbbab1927a83d305edfc454ac05050742 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 1 Nov 2010 17:28:28 -0700 Subject: STORM-420 : Took Andrew's comment into account, fixing the issue when minimap was minimized --- indra/newview/llfloatermap.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 8a48265313..351b9ac5da 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -126,6 +126,13 @@ BOOL LLFloaterMap::postBuild() BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask) { + // If floater is minimized, minimap should be shown on doubleclick (STORM-299) + if (isMinimized()) + { + setMinimized(FALSE); + return TRUE; + } + LLVector3d pos_global = mMap->viewPosToGlobal(x, y); // If we're not tracking a beacon already, double-click will set one @@ -145,9 +152,7 @@ BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask) } else { - // If floater is minimized, minimap should be shown on doubleclick (STORM-299) - std::string floater_to_show = this->isMinimized() ? "mini_map" : "world_map"; - LLFloaterReg::showInstance(floater_to_show); + LLFloaterReg::showInstance("world_map"); } return TRUE; } -- cgit v1.2.3