diff options
| author | Mark Palange (Mani) <palange@lindenlab.com> | 2010-11-10 14:28:54 -0800 |
|---|---|---|
| committer | Mark Palange (Mani) <palange@lindenlab.com> | 2010-11-10 14:28:54 -0800 |
| commit | 7eed962a6237f74ec980e06d53886259ef225c55 (patch) | |
| tree | 6f90cd7736c74164f5cfaff071ecfc9f63b7a46f /indra/newview/llfloatermap.cpp | |
| parent | b2e84d739b4f5c00b497e57e892fc10d78af8b76 (diff) | |
| parent | 9d33a548b636fa739de2aa11ba9ed02b301c53a5 (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; } |
