Removed redundant double-click-teleport logic.

This commit is contained in:
Shyotl
2012-06-09 02:28:42 -05:00
parent 1a217b23c6
commit 5ce477c7cc
2 changed files with 26 additions and 74 deletions

View File

@@ -779,38 +779,26 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl; llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl;
} }
if (gSavedSettings.getBOOL("DoubleClickAutoPilot") || gSavedSettings.getBOOL("DoubleClickTeleport")) if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
{ {
if (mPick.mPickType == LLPickInfo::PICK_LAND if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) ||
&& !mPick.mPosGlobal.isExactlyZero()) (mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero()))
{ {
handle_go_to(); handle_go_to();
return TRUE; return TRUE;
} }
else if (mPick.mObjectID.notNull()
&& !mPick.mPosGlobal.isExactlyZero())
{
// Hit an object
// Do not go to attachments...
if (mPick.getObject() && !mPick.getObject()->isHUDAttachment())
{
// HACK: Call the last hit position the point we hit on the object
//gLastHitPosGlobal += gLastHitObjectOffset;
handle_go_to();
return TRUE;
} }
} else if (gSavedSettings.getBOOL("DoubleClickTeleport"))
} else
/* code added to support double click teleports */
if (gSavedSettings.getBOOL("DoubleClickTeleport"))
{ {
LLViewerObject* objp = mPick.getObject(); LLViewerObject* objp = mPick.getObject();
LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL; LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL;
bool is_in_world = mPick.mObjectID.notNull() && objp && !objp->isHUDAttachment(); bool is_in_world = mPick.mObjectID.notNull() && objp && !objp->isHUDAttachment();
bool is_land = mPick.mPickType == LLPickInfo::PICK_LAND; bool is_land = mPick.mPickType == LLPickInfo::PICK_LAND;
bool pos_non_zero = !mPick.mPosGlobal.isExactlyZero(); bool pos_non_zero = !mPick.mPosGlobal.isExactlyZero();
bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch()); bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch());
bool has_click_action = final_click_action(objp); bool has_click_action = final_click_action(objp);
if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action))) if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action)))
{ {
LLVector3d pos = mPick.mPosGlobal; LLVector3d pos = mPick.mPosGlobal;
@@ -821,30 +809,6 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
} }
return FALSE; return FALSE;
/* JC - don't do go-there, because then double-clicking on physical
objects gets you into trouble.
// If double-click on object or land, go there.
LLViewerObject *object = gViewerWindow->getLastPick().getObject();
if (object)
{
if (object->isAvatar())
{
LLFloaterAvatarInfo::showFromAvatar(object->getID());
}
else
{
handle_go_to(NULL);
}
}
else if (!gLastHitPosGlobal.isExactlyZero())
{
handle_go_to(NULL);
}
return TRUE;
*/
} }

View File

@@ -2751,21 +2751,10 @@ bool handle_go_to()
*/ */
// [/RLVa:KB] // [/RLVa:KB]
// JAMESDEBUG try simulator autopilot // try simulator autopilot
std::vector<std::string> strings; std::vector<std::string> strings;
std::string val; std::string val;
LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal;
if (gSavedSettings.getBOOL("DoubleClickTeleport")
)
{
LLVector3d hips_offset(0.0f, 0.0f, 1.2f);
gAgent.teleportViaLocation(pos + hips_offset);
}
else
{
// JAMESDEBUG try simulator autopilot
std::vector<std::string> strings;
std::string val;
val = llformat("%g", pos.mdV[VX]); val = llformat("%g", pos.mdV[VX]);
strings.push_back(val); strings.push_back(val);
val = llformat("%g", pos.mdV[VY]); val = llformat("%g", pos.mdV[VY]);
@@ -2776,7 +2765,7 @@ bool handle_go_to()
LLViewerParcelMgr::getInstance()->deselectLand(); LLViewerParcelMgr::getInstance()->deselectLand();
if (gAgentAvatarp && !gSavedSettings.getBOOL("AutoPilotLocksCamera")) if (isAgentAvatarValid() && !gSavedSettings.getBOOL("AutoPilotLocksCamera"))
{ {
gAgentCamera.setFocusGlobal(gAgentCamera.getFocusTargetGlobal(), gAgentAvatarp->getID()); gAgentCamera.setFocusGlobal(gAgentCamera.getFocusTargetGlobal(), gAgentAvatarp->getID());
} }
@@ -2788,7 +2777,6 @@ bool handle_go_to()
// Could be first use // Could be first use
LLFirstUse::useGoTo(); LLFirstUse::useGoTo();
}
return true; return true;
} }