From e1ca383cf4023b3a8b16a681e1d433c38ba836e8 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 3 Oct 2009 22:21:18 -0700 Subject: Added confirmation alerts for double-click tp and auto-pilot --- linden/indra/newview/llviewermenu.cpp | 73 ++++++++++++++-------- .../newview/skins/default/xui/en-us/alerts.xml | 32 +++++++++- 2 files changed, 77 insertions(+), 28 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index f9ae401..d11bc02 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -494,6 +494,7 @@ BOOL enable_detach(void*); BOOL enable_region_owner(void*); void menu_toggle_attached_lights(void* user_data); void menu_toggle_attached_particles(void* user_data); +static void handle_go_to_callback(S32 option, void *userdata); class LLMenuParcelObserver : public LLParcelObserver { @@ -2392,45 +2393,63 @@ bool handle_go_to() } // [/RLVa:KB] - // JAMESDEBUG try simulator autopilot - std::vector strings; - std::string val; - LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; if (gSavedSettings.getBOOL("DoubleClickTeleport")) { - LLVector3d hips_offset(0.0f, 0.0f, 1.2f); - gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); - gAgent.teleportViaLocation(pos + hips_offset); + gViewerWindow->alertXml("ConfirmDoubleClickTP", handle_go_to_callback, (void*)LLToolPie::getInstance()); } - else + else if (gSavedSettings.getBOOL("DoubleClickAutoPilot")) + { + gViewerWindow->alertXml("ConfirmAutoPilot", handle_go_to_callback, (void*)LLToolPie::getInstance()); + } + return true; +} + +//static +void handle_go_to_callback(S32 option, void *userdata) +{ + if (option == 0) { + LLToolPie* pie = (LLToolPie*)userdata; + // 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(); - - if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera")) + LLVector3d pos = pie->getPick().mPosGlobal; + 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(); + + 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(); + // Could be first use + LLFirstUse::useGoTo(); + } } - return true; } class LLGoToObject : public view_listener_t diff --git a/linden/indra/newview/skins/default/xui/en-us/alerts.xml b/linden/indra/newview/skins/default/xui/en-us/alerts.xml index acac138..d0ac192 100644 --- a/linden/indra/newview/skins/default/xui/en-us/alerts.xml +++ b/linden/indra/newview/skins/default/xui/en-us/alerts.xml @@ -5093,7 +5093,37 @@ Would you like to visit the Second Life website to set this up? - + + + Are you sure you want to move here? + + + When using auto-pilot + + + + + + + + Are you sure you want to teleport here? + + + When double-click teleporting + + + + + + Are you sure you want to teleport home? -- cgit v1.1