aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-10-03 22:21:18 -0700
committerMcCabe Maxsted2009-10-03 22:21:18 -0700
commite1ca383cf4023b3a8b16a681e1d433c38ba836e8 (patch)
tree186ef8433370c52b888f2f0062c3b5dd918d84ef /linden/indra/newview/llviewermenu.cpp
parentFixed extern C issue in llmediaimplgstreamer.h for Windows (diff)
downloadmeta-impy-e1ca383cf4023b3a8b16a681e1d433c38ba836e8.zip
meta-impy-e1ca383cf4023b3a8b16a681e1d433c38ba836e8.tar.gz
meta-impy-e1ca383cf4023b3a8b16a681e1d433c38ba836e8.tar.bz2
meta-impy-e1ca383cf4023b3a8b16a681e1d433c38ba836e8.tar.xz
Added confirmation alerts for double-click tp and auto-pilot
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r--linden/indra/newview/llviewermenu.cpp73
1 files changed, 46 insertions, 27 deletions
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*);
494BOOL enable_region_owner(void*); 494BOOL enable_region_owner(void*);
495void menu_toggle_attached_lights(void* user_data); 495void menu_toggle_attached_lights(void* user_data);
496void menu_toggle_attached_particles(void* user_data); 496void menu_toggle_attached_particles(void* user_data);
497static void handle_go_to_callback(S32 option, void *userdata);
497 498
498class LLMenuParcelObserver : public LLParcelObserver 499class LLMenuParcelObserver : public LLParcelObserver
499{ 500{
@@ -2392,45 +2393,63 @@ bool handle_go_to()
2392 } 2393 }
2393// [/RLVa:KB] 2394// [/RLVa:KB]
2394 2395
2395 // JAMESDEBUG try simulator autopilot
2396 std::vector<std::string> strings;
2397 std::string val;
2398 LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal;
2399 if (gSavedSettings.getBOOL("DoubleClickTeleport")) 2396 if (gSavedSettings.getBOOL("DoubleClickTeleport"))
2400 { 2397 {
2401 LLVector3d hips_offset(0.0f, 0.0f, 1.2f); 2398 gViewerWindow->alertXml("ConfirmDoubleClickTP", handle_go_to_callback, (void*)LLToolPie::getInstance());
2402 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
2403 gAgent.teleportViaLocation(pos + hips_offset);
2404 } 2399 }
2405 else 2400 else if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
2401 {
2402 gViewerWindow->alertXml("ConfirmAutoPilot", handle_go_to_callback, (void*)LLToolPie::getInstance());
2403 }
2404 return true;
2405}
2406
2407//static
2408void handle_go_to_callback(S32 option, void *userdata)
2409{
2410 if (option == 0)
2406 { 2411 {
2412 LLToolPie* pie = (LLToolPie*)userdata;
2413
2407 // JAMESDEBUG try simulator autopilot 2414 // JAMESDEBUG try simulator autopilot
2408 std::vector<std::string> strings; 2415 std::vector<std::string> strings;
2409 std::string val; 2416 std::string val;
2410 val = llformat("%g", pos.mdV[VX]); 2417 LLVector3d pos = pie->getPick().mPosGlobal;
2411 strings.push_back(val); 2418 if (gSavedSettings.getBOOL("DoubleClickTeleport"))
2412 val = llformat("%g", pos.mdV[VY]);
2413 strings.push_back(val);
2414 val = llformat("%g", pos.mdV[VZ]);
2415 strings.push_back(val);
2416 send_generic_message("autopilot", strings);
2417
2418 LLViewerParcelMgr::getInstance()->deselectLand();
2419
2420 if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera"))
2421 { 2419 {
2422 gAgent.setFocusGlobal(gAgent.getFocusTargetGlobal(), gAgent.getAvatarObject()->getID()); 2420 LLVector3d hips_offset(0.0f, 0.0f, 1.2f);
2421 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
2422 gAgent.teleportViaLocation(pos + hips_offset);
2423 } 2423 }
2424 else 2424 else
2425 { 2425 {
2426 // Snap camera back to behind avatar 2426 // JAMESDEBUG try simulator autopilot
2427 gAgent.setFocusOnAvatar(TRUE, ANIMATE); 2427 std::vector<std::string> strings;
2428 } 2428 std::string val;
2429 val = llformat("%g", pos.mdV[VX]);
2430 strings.push_back(val);
2431 val = llformat("%g", pos.mdV[VY]);
2432 strings.push_back(val);
2433 val = llformat("%g", pos.mdV[VZ]);
2434 strings.push_back(val);
2435 send_generic_message("autopilot", strings);
2436
2437 LLViewerParcelMgr::getInstance()->deselectLand();
2438
2439 if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera"))
2440 {
2441 gAgent.setFocusGlobal(gAgent.getFocusTargetGlobal(), gAgent.getAvatarObject()->getID());
2442 }
2443 else
2444 {
2445 // Snap camera back to behind avatar
2446 gAgent.setFocusOnAvatar(TRUE, ANIMATE);
2447 }
2429 2448
2430 // Could be first use 2449 // Could be first use
2431 LLFirstUse::useGoTo(); 2450 LLFirstUse::useGoTo();
2451 }
2432 } 2452 }
2433 return true;
2434} 2453}
2435 2454
2436class LLGoToObject : public view_listener_t 2455class LLGoToObject : public view_listener_t