diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-11-12 17:34:30 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-11-12 17:34:30 -0500 |
commit | 3ea3d4cf16894c928cd60c19429dbec158185f96 (patch) | |
tree | c6331ca9eb06764e1d8109b6d90002ee34507d04 /indra/newview/llfloatermap.cpp | |
parent | d9c0e0ba74d3f042ae7f3a7310f0c0bf23e6eaa9 (diff) | |
parent | 63466f0ecae64cad8d2f74ccd1ade29121a26a95 (diff) |
merge
Diffstat (limited to 'indra/newview/llfloatermap.cpp')
-rw-r--r-- | indra/newview/llfloatermap.cpp | 33 |
1 files changed, 30 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; } |