From 73b8ee092e6f8a450e5bf71c43a0362c4986a005 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Sat, 11 Jul 2009 12:25:27 +0200 Subject: Teleport by double clicking into the viewer window. Port and bugfix of cv port of emerald greenlife viewer feature. TODO: find a nice place in prefs to switch off (defaults to on). (cherry picked from commit 86e186e40f6a128abab1c3a44f33520508b37f16) --- linden/indra/newview/app_settings/settings.xml | 11 ++++++ linden/indra/newview/lltoolpie.cpp | 2 +- linden/indra/newview/llviewermenu.cpp | 51 +++++++++++++++----------- 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 5c76185..a080be2 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -2245,6 +2245,17 @@ Value 0 + DoubleClickTeleport + + Comment + Enable double-click teleport + Persist + 1 + Type + Boolean + Value + 1 + DragAndDropToolTipDelay Comment diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp index 27d1c4c..7f3bd82 100644 --- a/linden/indra/newview/lltoolpie.cpp +++ b/linden/indra/newview/lltoolpie.cpp @@ -635,7 +635,7 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl; } - if (gSavedSettings.getBOOL("DoubleClickAutoPilot")) + if (gSavedSettings.getBOOL("DoubleClickAutoPilot") || gSavedSettings.getBOOL("DoubleClickTeleport")) { if (mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 2940bdd..51953b09 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -2106,32 +2106,41 @@ class LLObjectMute : public view_listener_t bool handle_go_to() { - // JAMESDEBUG try simulator autopilot - std::vector strings; - std::string val; LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; - val = llformat("%g", pos.mdV[VX]); - strings.push_back(val); - val = llformat("%g", pos.mdV[VY]); - strings.push_back(val); - val = llformat("%g", pos.mdV[VZ]); - strings.push_back(val); - send_generic_message("autopilot", strings); - - LLViewerParcelMgr::getInstance()->deselectLand(); - - if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera")) + if (gSavedSettings.getBOOL("DoubleClickTeleport")) { - gAgent.setFocusGlobal(gAgent.getFocusTargetGlobal(), gAgent.getAvatarObject()->getID()); + LLVector3d hips_offset(0.0f, 0.0f, 1.2f); + gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); + gAgent.teleportViaLocation(pos + hips_offset); } - else + else { - // Snap camera back to behind avatar - gAgent.setFocusOnAvatar(TRUE, ANIMATE); - } + // JAMESDEBUG try simulator autopilot + std::vector strings; + std::string val; + val = llformat("%g", pos.mdV[VX]); + strings.push_back(val); + val = llformat("%g", pos.mdV[VY]); + strings.push_back(val); + val = llformat("%g", pos.mdV[VZ]); + strings.push_back(val); + send_generic_message("autopilot", strings); + + LLViewerParcelMgr::getInstance()->deselectLand(); - // Could be first use - LLFirstUse::useGoTo(); + if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera")) + { + gAgent.setFocusGlobal(gAgent.getFocusTargetGlobal(), gAgent.getAvatarObject()->getID()); + } + else + { + // Snap camera back to behind avatar + gAgent.setFocusOnAvatar(TRUE, ANIMATE); + } + + // Could be first use + LLFirstUse::useGoTo(); + } return true; } -- cgit v1.1