STORM-420 : allow teleport when double clicking the minimap if doubleclick teleport is on, allow beacon setting if not

master
Merov Linden 2010-10-29 15:42:29 -07:00
parent 8209e35643
commit 398b8564e1
3 changed files with 30 additions and 4 deletions

View File

@ -127,6 +127,7 @@ Alissa Sabre
VWR-12617
VWR-12620
VWR-12789
SNOW-322
Angus Boyd
VWR-592
Ann Congrejo
@ -143,6 +144,7 @@ Asuka Neely
Balp Allen
VWR-4157
Be Holder
SNOW-322
SNOW-397
Benja Kepler
VWR-746

View File

@ -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;
}

View File

@ -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();