summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolpie.cpp
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-08-26 16:49:41 +0100
committerAimee Linden <aimee@lindenlab.com>2010-08-26 16:49:41 +0100
commit34a063ae5ae1c8b4be0de8a4448cb11a002a4c61 (patch)
treea3cdbe33c82c88bed128ee8d7717a9f7b868cdc0 /indra/newview/lltoolpie.cpp
parent1a8d917a6d0d2393a0f0248d0072dd7cfd487609 (diff)
VWR-20715 Double-click teleport
SNOW-352/SNOW-421/SNOW-462 Imported from Snowglobe 2 By Twisted Laws and Thickbrick Sleaford
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rw-r--r--indra/newview/lltoolpie.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index d8be70e546..864de018e0 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -619,6 +619,25 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
return TRUE;
}
}
+ else if (gSavedSettings.getBOOL("DoubleClickTeleport"))
+ {
+ LLViewerObject* objp = mPick.getObject();
+ LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL;
+
+ bool is_in_world = mPick.mObjectID.notNull() && objp && !objp->isHUDAttachment();
+ bool is_land = mPick.mPickType == LLPickInfo::PICK_LAND;
+ bool pos_non_zero = !mPick.mPosGlobal.isExactlyZero();
+ bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch());
+ bool has_click_action = final_click_action(objp);
+
+ if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action)))
+ {
+ LLVector3d pos = mPick.mPosGlobal;
+ pos.mdV[VZ] += gAgentAvatarp->getPelvisToFoot();
+ gAgent.teleportViaLocationLookAt(pos);
+ return TRUE;
+ }
+ }
return FALSE;
}