aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorArmin Weatherwax2009-07-11 12:25:27 +0200
committerMcCabe Maxsted2009-09-04 13:53:32 -0700
commit73b8ee092e6f8a450e5bf71c43a0362c4986a005 (patch)
tree80329c527545c180dcb35f4249f7809a817fe369 /linden/indra
parentLinux middle mouse button paste/primary selection support and gtk clipboard h... (diff)
downloadmeta-impy-73b8ee092e6f8a450e5bf71c43a0362c4986a005.zip
meta-impy-73b8ee092e6f8a450e5bf71c43a0362c4986a005.tar.gz
meta-impy-73b8ee092e6f8a450e5bf71c43a0362c4986a005.tar.bz2
meta-impy-73b8ee092e6f8a450e5bf71c43a0362c4986a005.tar.xz
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)
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/lltoolpie.cpp2
-rw-r--r--linden/indra/newview/llviewermenu.cpp51
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 @@
2245 <key>Value</key> 2245 <key>Value</key>
2246 <integer>0</integer> 2246 <integer>0</integer>
2247 </map> 2247 </map>
2248 <key>DoubleClickTeleport</key>
2249 <map>
2250 <key>Comment</key>
2251 <string>Enable double-click teleport</string>
2252 <key>Persist</key>
2253 <integer>1</integer>
2254 <key>Type</key>
2255 <string>Boolean</string>
2256 <key>Value</key>
2257 <integer>1</integer>
2258 </map>
2248 <key>DragAndDropToolTipDelay</key> 2259 <key>DragAndDropToolTipDelay</key>
2249 <map> 2260 <map>
2250 <key>Comment</key> 2261 <key>Comment</key>
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)
635 llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl; 635 llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl;
636 } 636 }
637 637
638 if (gSavedSettings.getBOOL("DoubleClickAutoPilot")) 638 if (gSavedSettings.getBOOL("DoubleClickAutoPilot") || gSavedSettings.getBOOL("DoubleClickTeleport"))
639 { 639 {
640 if (mPick.mPickType == LLPickInfo::PICK_LAND 640 if (mPick.mPickType == LLPickInfo::PICK_LAND
641 && !mPick.mPosGlobal.isExactlyZero()) 641 && !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
2106 2106
2107bool handle_go_to() 2107bool handle_go_to()
2108{ 2108{
2109 // JAMESDEBUG try simulator autopilot
2110 std::vector<std::string> strings;
2111 std::string val;
2112 LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; 2109 LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal;
2113 val = llformat("%g", pos.mdV[VX]); 2110 if (gSavedSettings.getBOOL("DoubleClickTeleport"))
2114 strings.push_back(val);
2115 val = llformat("%g", pos.mdV[VY]);
2116 strings.push_back(val);
2117 val = llformat("%g", pos.mdV[VZ]);
2118 strings.push_back(val);
2119 send_generic_message("autopilot", strings);
2120
2121 LLViewerParcelMgr::getInstance()->deselectLand();
2122
2123 if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera"))
2124 { 2111 {
2125 gAgent.setFocusGlobal(gAgent.getFocusTargetGlobal(), gAgent.getAvatarObject()->getID()); 2112 LLVector3d hips_offset(0.0f, 0.0f, 1.2f);
2113 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
2114 gAgent.teleportViaLocation(pos + hips_offset);
2126 } 2115 }
2127 else 2116 else
2128 { 2117 {
2129 // Snap camera back to behind avatar 2118 // JAMESDEBUG try simulator autopilot
2130 gAgent.setFocusOnAvatar(TRUE, ANIMATE); 2119 std::vector<std::string> strings;
2131 } 2120 std::string val;
2121 val = llformat("%g", pos.mdV[VX]);
2122 strings.push_back(val);
2123 val = llformat("%g", pos.mdV[VY]);
2124 strings.push_back(val);
2125 val = llformat("%g", pos.mdV[VZ]);
2126 strings.push_back(val);
2127 send_generic_message("autopilot", strings);
2128
2129 LLViewerParcelMgr::getInstance()->deselectLand();
2132 2130
2133 // Could be first use 2131 if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera"))
2134 LLFirstUse::useGoTo(); 2132 {
2133 gAgent.setFocusGlobal(gAgent.getFocusTargetGlobal(), gAgent.getAvatarObject()->getID());
2134 }
2135 else
2136 {
2137 // Snap camera back to behind avatar
2138 gAgent.setFocusOnAvatar(TRUE, ANIMATE);
2139 }
2140
2141 // Could be first use
2142 LLFirstUse::useGoTo();
2143 }
2135 return true; 2144 return true;
2136} 2145}
2137 2146