summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2010-11-02 17:27:39 -0700
committerMerov Linden <merov@lindenlab.com>2010-11-02 17:27:39 -0700
commite9640296d32beb529b4af16d34c06808edde4916 (patch)
treeeeeb1f4d0085feb5da3d497165ec72a2fc922e6e /indra/newview
parent37b97d2f6dbb1b9031202aba982a116e0f8fa2bf (diff)
parent87e2b01fbbab1927a83d305edfc454ac05050742 (diff)
STORM-420 : merge to viewer-development
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloatermap.cpp33
-rw-r--r--indra/newview/llnetmap.h2
2 files changed, 32 insertions, 3 deletions
diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp
index a1d291fea6..351b9ac5da 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,36 @@ 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);
+ 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
+ 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
+ {
+ LLFloaterReg::showInstance("world_map");
+ }
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();