diff options
author | Merov Linden <merov@lindenlab.com> | 2010-11-04 14:30:32 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2010-11-04 14:30:32 -0700 |
commit | f7af29ab40c2405504969a453eba3919be1af5c5 (patch) | |
tree | f31f6d31582e8ff89c769334cb70e1076c887ef7 /indra/newview/llfloatermap.cpp | |
parent | c2500f808cd8e1957054d5ec1b3555e30698c2b3 (diff) | |
parent | 889aff8d87a4dbf3ca43c43bdeed825f67fd5e60 (diff) |
merge with viewer-development
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; } |