diff options
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 126 |
1 files changed, 73 insertions, 53 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index f9ae401..ceb5d5f 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -494,6 +494,7 @@ BOOL enable_detach(void*); | |||
494 | BOOL enable_region_owner(void*); | 494 | BOOL enable_region_owner(void*); |
495 | void menu_toggle_attached_lights(void* user_data); | 495 | void menu_toggle_attached_lights(void* user_data); |
496 | void menu_toggle_attached_particles(void* user_data); | 496 | void menu_toggle_attached_particles(void* user_data); |
497 | static void handle_go_to_callback(S32 option, void *userdata); | ||
497 | 498 | ||
498 | class LLMenuParcelObserver : public LLParcelObserver | 499 | class LLMenuParcelObserver : public LLParcelObserver |
499 | { | 500 | { |
@@ -952,7 +953,7 @@ void init_client_menu(LLMenuGL* menu) | |||
952 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e | 953 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e |
953 | #ifdef RLV_ADVANCED_TOGGLE_RLVA | 954 | #ifdef RLV_ADVANCED_TOGGLE_RLVA |
954 | if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) | 955 | if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) |
955 | menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvDbgToggleEnabled, NULL, &rlvDbgGetEnabled, NULL)); | 956 | menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvToggleEnabled, NULL, &rlvGetEnabled, NULL)); |
956 | #endif // RLV_ADVANCED_TOGGLE_RLVA | 957 | #endif // RLV_ADVANCED_TOGGLE_RLVA |
957 | // [/RLVa:KB] | 958 | // [/RLVa:KB] |
958 | 959 | ||
@@ -1406,30 +1407,24 @@ void init_debug_baked_texture_menu(LLMenuGL* menu) | |||
1406 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g | 1407 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g |
1407 | void init_debug_rlva_menu(LLMenuGL* menu) | 1408 | void init_debug_rlva_menu(LLMenuGL* menu) |
1408 | { | 1409 | { |
1409 | // Experimental feature toggles | 1410 | // Debug options |
1410 | { | 1411 | { |
1411 | /* | 1412 | LLMenuGL* pDbgMenu = new LLMenuGL("Debug"); |
1412 | #ifdef RLV_EXPERIMENTAL | ||
1413 | LLMenuGL* sub_menu = new LLMenuGL("Experimental"); | ||
1414 | 1413 | ||
1415 | menu->appendMenu(sub_menu); | 1414 | if (gSavedSettings.controlExists(RLV_SETTING_DEBUG)) |
1416 | #endif // RLV_EXPERIMENTAL | 1415 | pDbgMenu->append(new LLMenuItemCheckGL("Show Debug Messages", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_DEBUG)); |
1417 | */ | 1416 | pDbgMenu->appendSeparator(); |
1418 | } | 1417 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) |
1418 | pDbgMenu->append(new LLMenuItemCheckGL("Enable Legacy Naming", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLELEGACYNAMING)); | ||
1419 | 1419 | ||
1420 | // Unit tests | 1420 | menu->appendMenu(pDbgMenu); |
1421 | { | 1421 | menu->appendSeparator(); |
1422 | #ifdef RLV_DEBUG_TESTS | ||
1423 | init_debug_rlva_tests_menu(menu); | ||
1424 | #endif // RLV_DEBUG_TESTS | ||
1425 | } | 1422 | } |
1426 | 1423 | ||
1427 | #ifdef RLV_EXTENSION_ENABLE_WEAR | 1424 | #ifdef RLV_EXTENSION_ENABLE_WEAR |
1428 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) | 1425 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) |
1429 | { | ||
1430 | menu->append(new LLMenuItemCheckGL("Enable Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); | 1426 | menu->append(new LLMenuItemCheckGL("Enable Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); |
1431 | menu->appendSeparator(); | 1427 | menu->appendSeparator(); |
1432 | } | ||
1433 | #endif // RLV_EXTENSION_ENABLE_WEAR | 1428 | #endif // RLV_EXTENSION_ENABLE_WEAR |
1434 | 1429 | ||
1435 | #ifdef RLV_EXTENSION_HIDELOCKED | 1430 | #ifdef RLV_EXTENSION_HIDELOCKED |
@@ -1443,6 +1438,12 @@ void init_debug_rlva_menu(LLMenuGL* menu) | |||
1443 | } | 1438 | } |
1444 | #endif // RLV_EXTENSION_HIDELOCKED | 1439 | #endif // RLV_EXTENSION_HIDELOCKED |
1445 | 1440 | ||
1441 | if (gSavedSettings.controlExists(RLV_SETTING_FORBIDGIVETORLV)) | ||
1442 | menu->append(new LLMenuItemCheckGL("Forbid Give to #RLV", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_FORBIDGIVETORLV)); | ||
1443 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) | ||
1444 | menu->append(new LLMenuItemCheckGL("Show Name Tags", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_SHOWNAMETAGS)); | ||
1445 | menu->appendSeparator(); | ||
1446 | |||
1446 | #ifdef RLV_EXTENSION_FLOATER_RESTRICTIONS | 1447 | #ifdef RLV_EXTENSION_FLOATER_RESTRICTIONS |
1447 | // TODO-RLVa: figure out a way to tell if floater_rlv_behaviour.xml exists | 1448 | // TODO-RLVa: figure out a way to tell if floater_rlv_behaviour.xml exists |
1448 | menu->append(new LLMenuItemCallGL("Restrictions...", RlvFloaterBehaviour::show, NULL, NULL)); | 1449 | menu->append(new LLMenuItemCallGL("Restrictions...", RlvFloaterBehaviour::show, NULL, NULL)); |
@@ -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 | ||
2408 | void 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 | ||
2436 | class LLGoToObject : public view_listener_t | 2455 | class LLGoToObject : public view_listener_t |
@@ -6026,9 +6045,9 @@ private: | |||
6026 | 6045 | ||
6027 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | 6046 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) |
6028 | if ( (rlv_handler_t::isEnabled()) && | 6047 | if ( (rlv_handler_t::isEnabled()) && |
6029 | ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point | 6048 | ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point |
6030 | ((index > 0) && (!gRlvHandler.isDetachable(attachment_point->getObject()))) || // Can't replace locked attachment | 6049 | ((index > 0) && (!gRlvHandler.isDetachable(attachment_point))) || // Can't replace locked attachment |
6031 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" | 6050 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" |
6032 | { | 6051 | { |
6033 | setObjectSelection(NULL); // Clear the selection or it'll get stuck | 6052 | setObjectSelection(NULL); // Clear the selection or it'll get stuck |
6034 | return true; | 6053 | return true; |
@@ -6315,6 +6334,8 @@ class LLAttachmentEnableDrop : public view_listener_t | |||
6315 | { | 6334 | { |
6316 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6335 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
6317 | { | 6336 | { |
6337 | if (gDisconnected) | ||
6338 | return true; | ||
6318 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); | 6339 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); |
6319 | BOOL can_build = gAgent.isGodlike() || (parcel && parcel->getAllowModify()); | 6340 | BOOL can_build = gAgent.isGodlike() || (parcel && parcel->getAllowModify()); |
6320 | 6341 | ||
@@ -6365,7 +6386,6 @@ class LLAttachmentEnableDrop : public view_listener_t | |||
6365 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | 6386 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) |
6366 | bool new_value = enable_detach(NULL) && can_build && item && (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)); | 6387 | bool new_value = enable_detach(NULL) && can_build && item && (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)); |
6367 | // [/RLVa:KB] | 6388 | // [/RLVa:KB] |
6368 | |||
6369 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 6389 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
6370 | return true; | 6390 | return true; |
6371 | } | 6391 | } |
@@ -6430,9 +6450,9 @@ BOOL object_selected_and_point_valid(void *user_data) | |||
6430 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] | 6450 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] |
6431 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] | 6451 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] |
6432 | LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; | 6452 | LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; |
6433 | if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point | 6453 | if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point |
6434 | ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt->getObject()))) || // Don't allow replacing of locked attachment | 6454 | ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt))) || // Don't allow replacing of locked attachment |
6435 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" | 6455 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" |
6436 | { | 6456 | { |
6437 | return FALSE; | 6457 | return FALSE; |
6438 | } | 6458 | } |
@@ -10357,7 +10377,7 @@ class RLVaMainToggle : public view_listener_t | |||
10357 | { | 10377 | { |
10358 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 10378 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
10359 | { | 10379 | { |
10360 | rlvDbgToggleEnabled(NULL); | 10380 | rlvToggleEnabled(NULL); |
10361 | return true; | 10381 | return true; |
10362 | } | 10382 | } |
10363 | }; | 10383 | }; |
@@ -10366,7 +10386,7 @@ class RLVaMainCheck : public view_listener_t | |||
10366 | { | 10386 | { |
10367 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 10387 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
10368 | { | 10388 | { |
10369 | bool new_value = rlvDbgGetEnabled(NULL); | 10389 | bool new_value = rlvGetEnabled(NULL); |
10370 | std::string control_name = userdata["control"].asString(); | 10390 | std::string control_name = userdata["control"].asString(); |
10371 | gMenuHolder->findControl(control_name)->setValue(new_value); | 10391 | gMenuHolder->findControl(control_name)->setValue(new_value); |
10372 | return true; | 10392 | return true; |