diff options
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 102 |
1 files changed, 59 insertions, 43 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 6ec7e46..524654a 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -241,10 +241,8 @@ void init_debug_ui_menu(LLMenuGL* menu); | |||
241 | void init_debug_xui_menu(LLMenuGL* menu); | 241 | void init_debug_xui_menu(LLMenuGL* menu); |
242 | void init_debug_avatar_menu(LLMenuGL* menu); | 242 | void init_debug_avatar_menu(LLMenuGL* menu); |
243 | void init_debug_baked_texture_menu(LLMenuGL* menu); | 243 | void init_debug_baked_texture_menu(LLMenuGL* menu); |
244 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | 244 | // [RLVa:KB] |
245 | #ifdef RLV_DEBUG_TESTS | 245 | #include "rlvhandler.h" |
246 | #include "rlvtest.h" | ||
247 | #endif // RLV_DEBUG_TESTS | ||
248 | #include "rlvfloaterbehaviour.h" | 246 | #include "rlvfloaterbehaviour.h" |
249 | void init_debug_rlva_menu(LLMenuGL* menu); | 247 | void init_debug_rlva_menu(LLMenuGL* menu); |
250 | // [/RLVa:KB] | 248 | // [/RLVa:KB] |
@@ -860,7 +858,7 @@ void init_client_menu(LLMenuGL* menu) | |||
860 | init_debug_world_menu(sub_menu); | 858 | init_debug_world_menu(sub_menu); |
861 | menu->appendMenu(sub_menu); | 859 | menu->appendMenu(sub_menu); |
862 | 860 | ||
863 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1b | 861 | // [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1b |
864 | #ifdef RLV_ADVANCED_MENU | 862 | #ifdef RLV_ADVANCED_MENU |
865 | if (rlv_handler_t::isEnabled()) | 863 | if (rlv_handler_t::isEnabled()) |
866 | { | 864 | { |
@@ -970,7 +968,7 @@ void init_client_menu(LLMenuGL* menu) | |||
970 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e | 968 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e |
971 | #ifdef RLV_ADVANCED_TOGGLE_RLVA | 969 | #ifdef RLV_ADVANCED_TOGGLE_RLVA |
972 | if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) | 970 | if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) |
973 | menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvToggleEnabled, NULL, &rlvGetEnabled, NULL)); | 971 | menu->append(new LLMenuItemCheckGL("RestrainedLove API", &rlvToggleEnabled, NULL, &rlvGetEnabled, NULL)); |
974 | #endif // RLV_ADVANCED_TOGGLE_RLVA | 972 | #endif // RLV_ADVANCED_TOGGLE_RLVA |
975 | // [/RLVa:KB] | 973 | // [/RLVa:KB] |
976 | 974 | ||
@@ -1433,7 +1431,7 @@ void init_debug_baked_texture_menu(LLMenuGL* menu) | |||
1433 | menu->createJumpKeys(); | 1431 | menu->createJumpKeys(); |
1434 | } | 1432 | } |
1435 | 1433 | ||
1436 | // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g | 1434 | // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-11-17 (RLVa-1.1.0d) | Modified: RLVa-1.1.0d |
1437 | void init_debug_rlva_menu(LLMenuGL* menu) | 1435 | void init_debug_rlva_menu(LLMenuGL* menu) |
1438 | { | 1436 | { |
1439 | // Debug options | 1437 | // Debug options |
@@ -1442,26 +1440,31 @@ void init_debug_rlva_menu(LLMenuGL* menu) | |||
1442 | 1440 | ||
1443 | if (gSavedSettings.controlExists(RLV_SETTING_DEBUG)) | 1441 | if (gSavedSettings.controlExists(RLV_SETTING_DEBUG)) |
1444 | pDbgMenu->append(new LLMenuItemCheckGL("Show Debug Messages", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_DEBUG)); | 1442 | pDbgMenu->append(new LLMenuItemCheckGL("Show Debug Messages", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_DEBUG)); |
1443 | pDbgMenu->append(new LLMenuItemCallGL("Dump Attachment Locks", RlvHandler::dumpAttachmentLocks, NULL, NULL)); | ||
1445 | pDbgMenu->appendSeparator(); | 1444 | pDbgMenu->appendSeparator(); |
1446 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) | 1445 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) |
1447 | pDbgMenu->append(new LLMenuItemCheckGL("Enable Legacy Naming", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLELEGACYNAMING)); | 1446 | pDbgMenu->append(new LLMenuItemCheckGL("Enable Legacy Naming", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLELEGACYNAMING)); |
1447 | if (gSavedSettings.controlExists(RLV_SETTING_SHAREDINVAUTORENAME)) | ||
1448 | pDbgMenu->append(new LLMenuItemCheckGL("Rename Shared Items on Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_SHAREDINVAUTORENAME)); | ||
1448 | 1449 | ||
1449 | menu->appendMenu(pDbgMenu); | 1450 | menu->appendMenu(pDbgMenu); |
1450 | menu->appendSeparator(); | 1451 | menu->appendSeparator(); |
1451 | } | 1452 | } |
1452 | 1453 | ||
1453 | #ifdef RLV_EXTENSION_ENABLE_WEAR | 1454 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) |
1454 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) | 1455 | menu->append(new LLMenuItemCheckGL("Enable Default Wear", menu_toggle_control, rlvEnableWearEnabler, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); |
1455 | menu->append(new LLMenuItemCheckGL("Enable Wear", menu_toggle_control, rlvEnableWearEnabler, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); | 1456 | #ifndef RLV_WORKAROUND_REZMULTIPLEATTACH |
1456 | menu->appendSeparator(); | 1457 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLESHAREDWEAR)) |
1457 | #endif // RLV_EXTENSION_ENABLE_WEAR | 1458 | menu->append(new LLMenuItemCheckGL("Enable Shared Wear", menu_toggle_control, rlvEnableSharedWearEnabler, menu_check_control, (void*)RLV_SETTING_ENABLESHAREDWEAR)); |
1459 | #endif // RLV_WORKAROUND_REZMULTIPLEATTACH | ||
1460 | menu->appendSeparator(); | ||
1458 | 1461 | ||
1459 | #ifdef RLV_EXTENSION_HIDELOCKED | 1462 | #ifdef RLV_EXTENSION_HIDELOCKED |
1460 | if ( (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDLAYER)) && | 1463 | if ( (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDLAYER)) && |
1461 | (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDATTACH)) ) | 1464 | (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDATTACH)) ) |
1462 | { | 1465 | { |
1463 | menu->append(new LLMenuItemCheckGL("Hide locked layers", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDLAYER)); | 1466 | menu->append(new LLMenuItemCheckGL("Hide Locked Layers", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDLAYER)); |
1464 | menu->append(new LLMenuItemCheckGL("Hide locked attachments", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDATTACH)); | 1467 | menu->append(new LLMenuItemCheckGL("Hide Locked Attachments", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDATTACH)); |
1465 | //sub_menu->append(new LLMenuItemToggleGL("Hide locked inventory", &rlv_handler_t::fHideLockedInventory)); | 1468 | //sub_menu->append(new LLMenuItemToggleGL("Hide locked inventory", &rlv_handler_t::fHideLockedInventory)); |
1466 | menu->appendSeparator(); | 1469 | menu->appendSeparator(); |
1467 | } | 1470 | } |
@@ -1662,13 +1665,10 @@ class LLObjectTouch : public view_listener_t | |||
1662 | 1665 | ||
1663 | LLPickInfo pick = LLToolPie::getInstance()->getPick(); | 1666 | LLPickInfo pick = LLToolPie::getInstance()->getPick(); |
1664 | 1667 | ||
1665 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f | 1668 | // [RLVa:KB] - Checked: 2010-01-01 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l |
1666 | // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for | 1669 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object, pick.mObjectOffset)) ) |
1667 | // [msg->addVector3("Position", pick.mIntersection) <- see llDetectedTouchPos()] | ||
1668 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) && | ||
1669 | (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f) ) | ||
1670 | { | 1670 | { |
1671 | return true; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n | 1671 | return true; |
1672 | } | 1672 | } |
1673 | // [/RLVa:KB] | 1673 | // [/RLVa:KB] |
1674 | 1674 | ||
@@ -1720,12 +1720,10 @@ class LLObjectEnableTouch : public view_listener_t | |||
1720 | { | 1720 | { |
1721 | LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | 1721 | LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); |
1722 | bool new_value = obj && obj->flagHandleTouch(); | 1722 | bool new_value = obj && obj->flagHandleTouch(); |
1723 | // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f | 1723 | // [RLVa:KB] - Version: 1.23.4 | Checked: 2010-01-01 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l |
1724 | // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for | 1724 | if ( (new_value) && (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(obj, LLToolPie::getInstance()->getPick().mObjectOffset)) ) |
1725 | if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!obj->isAttachment()) || (!obj->permYouOwner())) && | ||
1726 | (dist_vec_squared(gAgent.getPositionAgent(), LLToolPie::getInstance()->getPick().mIntersection) > 1.5f * 1.5f) ) | ||
1727 | { | 1725 | { |
1728 | new_value = false; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n | 1726 | new_value = false; |
1729 | } | 1727 | } |
1730 | // [/RLVa:KB] | 1728 | // [/RLVa:KB] |
1731 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 1729 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
@@ -2681,7 +2679,7 @@ class LLAvatarFreeze : public view_listener_t | |||
2681 | LLSD args; | 2679 | LLSD args; |
2682 | // args["AVATAR_NAME"] = fullname; | 2680 | // args["AVATAR_NAME"] = fullname; |
2683 | // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | 2681 | // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) |
2684 | args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : gRlvHandler.getAnonym(fullname); | 2682 | args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); |
2685 | // [/RLVa:KB] | 2683 | // [/RLVa:KB] |
2686 | LLNotifications::instance().add("FreezeAvatarFullname", | 2684 | LLNotifications::instance().add("FreezeAvatarFullname", |
2687 | args, | 2685 | args, |
@@ -2810,7 +2808,7 @@ class LLAvatarEject : public view_listener_t | |||
2810 | // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | 2808 | // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) |
2811 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) | 2809 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) |
2812 | { | 2810 | { |
2813 | fullname = gRlvHandler.getAnonym(fullname); | 2811 | fullname = RlvStrings::getAnonym(fullname); |
2814 | } | 2812 | } |
2815 | // [/RLVa:KB] | 2813 | // [/RLVa:KB] |
2816 | 2814 | ||
@@ -3418,10 +3416,9 @@ bool handle_sit_or_stand() | |||
3418 | return true; | 3416 | return true; |
3419 | } | 3417 | } |
3420 | 3418 | ||
3421 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0c) | 3419 | // [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Modified: RLVa-1.1.0j |
3422 | if ( (rlv_handler_t::isEnabled()) && | 3420 | // Block if we can't sit on the selected object (also handles sitting and prevented from standing up) |
3423 | ( ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting)) || | 3421 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canSit(object, pick.mObjectOffset)) ) |
3424 | (gRlvHandler.hasBehaviour(RLV_BHVR_SIT)) ) ) | ||
3425 | { | 3422 | { |
3426 | return true; | 3423 | return true; |
3427 | } | 3424 | } |
@@ -3437,15 +3434,6 @@ bool handle_sit_or_stand() | |||
3437 | 3434 | ||
3438 | if (object && object->getPCode() == LL_PCODE_VOLUME) | 3435 | if (object && object->getPCode() == LL_PCODE_VOLUME) |
3439 | { | 3436 | { |
3440 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g | ||
3441 | if ( (rlv_handler_t::isEnabled()) && | ||
3442 | ((gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) || (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && | ||
3443 | (dist_vec_squared(gAgent.getPositionGlobal(), object->getPositionGlobal() + LLVector3d(pick.mObjectOffset)) > 1.5f * 1.5f) ) | ||
3444 | { | ||
3445 | return true; // Don't allow sitting farther away than 1.5m under @sittp=n or @fartouch=n | ||
3446 | } | ||
3447 | // [/RLVa:KB] | ||
3448 | |||
3449 | gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); | 3437 | gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); |
3450 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); | 3438 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); |
3451 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | 3439 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); |
@@ -3483,8 +3471,8 @@ class LLLandSit : public view_listener_t | |||
3483 | { | 3471 | { |
3484 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3472 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3485 | { | 3473 | { |
3486 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | 3474 | // [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.1.1a) | Modified: RLVa-1.2.0c |
3487 | if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) | 3475 | if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SIT))) ) |
3488 | { | 3476 | { |
3489 | return true; | 3477 | return true; |
3490 | } | 3478 | } |
@@ -5800,7 +5788,9 @@ class LLObjectEnableSitOrStand : public view_listener_t | |||
5800 | new_value = true; | 5788 | new_value = true; |
5801 | } | 5789 | } |
5802 | } | 5790 | } |
5803 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 5791 | // [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j |
5792 | // gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
5793 | // [/RLVa:KB] | ||
5804 | 5794 | ||
5805 | // Update label | 5795 | // Update label |
5806 | std::string label; | 5796 | std::string label; |
@@ -5816,6 +5806,9 @@ class LLObjectEnableSitOrStand : public view_listener_t | |||
5816 | if (sitting_on_selection()) | 5806 | if (sitting_on_selection()) |
5817 | { | 5807 | { |
5818 | label = stand_text; | 5808 | label = stand_text; |
5809 | // [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j | ||
5810 | new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT); | ||
5811 | // [/RLVa:KB] | ||
5819 | } | 5812 | } |
5820 | else | 5813 | else |
5821 | { | 5814 | { |
@@ -5828,8 +5821,22 @@ class LLObjectEnableSitOrStand : public view_listener_t | |||
5828 | { | 5821 | { |
5829 | label = sit_text; | 5822 | label = sit_text; |
5830 | } | 5823 | } |
5824 | // [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j | ||
5825 | if ( (rlv_handler_t::isEnabled()) && (new_value) ) | ||
5826 | { | ||
5827 | // RELEASE-RLVa: [2009-12-22] make sure we examine the same object that handle_sit_or_stand() will request a sit for | ||
5828 | const LLPickInfo& pick = LLToolPie::getInstance()->getPick(); | ||
5829 | if (pick.mObjectID.notNull()) | ||
5830 | { | ||
5831 | new_value = gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset); | ||
5832 | } | ||
5833 | } | ||
5834 | // [/RLVa:KB] | ||
5831 | } | 5835 | } |
5832 | gMenuHolder->childSetText("Object Sit", label); | 5836 | gMenuHolder->childSetText("Object Sit", label); |
5837 | // [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j | ||
5838 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
5839 | // [/RLVa:KB] | ||
5833 | 5840 | ||
5834 | return true; | 5841 | return true; |
5835 | } | 5842 | } |
@@ -7569,6 +7576,9 @@ class LLWorldEnableTeleportHome : public view_listener_t | |||
7569 | LLViewerRegion* regionp = gAgent.getRegion(); | 7576 | LLViewerRegion* regionp = gAgent.getRegion(); |
7570 | bool agent_on_prelude = (regionp && regionp->isPrelude()); | 7577 | bool agent_on_prelude = (regionp && regionp->isPrelude()); |
7571 | bool enable_teleport_home = gAgent.isGodlike() || !agent_on_prelude; | 7578 | bool enable_teleport_home = gAgent.isGodlike() || !agent_on_prelude; |
7579 | // [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j | ||
7580 | enable_teleport_home &= !gRlvHandler.hasBehaviour(RLV_BHVR_TPLM); | ||
7581 | // [/RLVa:KB] | ||
7572 | gMenuHolder->findControl(userdata["control"].asString())->setValue(enable_teleport_home); | 7582 | gMenuHolder->findControl(userdata["control"].asString())->setValue(enable_teleport_home); |
7573 | return true; | 7583 | return true; |
7574 | } | 7584 | } |
@@ -11420,4 +11430,10 @@ void initialize_menus() | |||
11420 | addMenu(new RLVaBehaviorsShow(), "RLVa.Behaviors.Show"); | 11430 | addMenu(new RLVaBehaviorsShow(), "RLVa.Behaviors.Show"); |
11421 | // [/RLVa:KB] | 11431 | // [/RLVa:KB] |
11422 | 11432 | ||
11433 | // [RLVa:KB] - Checked: 2010-01-18 (RLVa-1.1.0m) | Added: RLVa-1.1.0m | ||
11434 | if (rlv_handler_t::isEnabled()) | ||
11435 | { | ||
11436 | addMenu(new RlvEnableIfNot(), "RLV.EnableIfNot"); | ||
11437 | } | ||
11438 | // [/RLVa:KB] | ||
11423 | } | 11439 | } |