diff options
author | Jacek Antonelli | 2009-09-04 01:56:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-09-04 03:39:51 -0500 |
commit | 89a510de10c48ebcf82b98a962e4bf66477dcc93 (patch) | |
tree | d30f79f433badffe36a67fc155e70a0e29dd2dc4 /linden/indra/newview/llviewermenu.cpp | |
parent | Backported 1.23 fix for animation joint assertion crash. (diff) | |
download | meta-impy-89a510de10c48ebcf82b98a962e4bf66477dcc93.zip meta-impy-89a510de10c48ebcf82b98a962e4bf66477dcc93.tar.gz meta-impy-89a510de10c48ebcf82b98a962e4bf66477dcc93.tar.bz2 meta-impy-89a510de10c48ebcf82b98a962e4bf66477dcc93.tar.xz |
Applied Kitty Barnett's RLVa 1.0.1h (Restrained Life) patch.
Made a few non-functional changes to help it apply.
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 602 |
1 files changed, 593 insertions, 9 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 2940bdd..6bd38e6 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -219,6 +219,13 @@ void init_debug_ui_menu(LLMenuGL* menu); | |||
219 | void init_debug_xui_menu(LLMenuGL* menu); | 219 | void init_debug_xui_menu(LLMenuGL* menu); |
220 | void init_debug_avatar_menu(LLMenuGL* menu); | 220 | void init_debug_avatar_menu(LLMenuGL* menu); |
221 | void init_debug_baked_texture_menu(LLMenuGL* menu); | 221 | void init_debug_baked_texture_menu(LLMenuGL* menu); |
222 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
223 | #ifdef RLV_DEBUG_TESTS | ||
224 | #include "rlvtest.h" | ||
225 | #endif // RLV_DEBUG_TESTS | ||
226 | #include "rlvfloaterbehaviour.h" | ||
227 | void init_debug_rlva_menu(LLMenuGL* menu); | ||
228 | // [/RLVa:KB] | ||
222 | 229 | ||
223 | BOOL enable_land_build(void*); | 230 | BOOL enable_land_build(void*); |
224 | BOOL enable_object_build(void*); | 231 | BOOL enable_object_build(void*); |
@@ -825,6 +832,19 @@ void init_client_menu(LLMenuGL* menu) | |||
825 | init_debug_world_menu(sub_menu); | 832 | init_debug_world_menu(sub_menu); |
826 | menu->appendMenu(sub_menu); | 833 | menu->appendMenu(sub_menu); |
827 | 834 | ||
835 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1b | ||
836 | #ifdef RLV_ADVANCED_MENU | ||
837 | if (rlv_handler_t::isEnabled()) | ||
838 | { | ||
839 | sub_menu = new LLMenuGL("RLVa"); | ||
840 | init_debug_rlva_menu(sub_menu); | ||
841 | menu->appendMenu(sub_menu); | ||
842 | sub_menu->setVisible(rlv_handler_t::isEnabled()); | ||
843 | sub_menu->setEnabled(rlv_handler_t::isEnabled()); | ||
844 | } | ||
845 | #endif // RLV_ADVANCED_MENU | ||
846 | // [/RLVa:KB] | ||
847 | |||
828 | sub_menu = new LLMenuGL("UI"); | 848 | sub_menu = new LLMenuGL("UI"); |
829 | init_debug_ui_menu(sub_menu); | 849 | init_debug_ui_menu(sub_menu); |
830 | menu->appendMenu(sub_menu); | 850 | menu->appendMenu(sub_menu); |
@@ -919,6 +939,13 @@ void init_client_menu(LLMenuGL* menu) | |||
919 | &menu_check_control, | 939 | &menu_check_control, |
920 | (void*)"ShowConsoleWindow")); | 940 | (void*)"ShowConsoleWindow")); |
921 | 941 | ||
942 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e | ||
943 | #ifdef RLV_ADVANCED_TOGGLE_RLVA | ||
944 | if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) | ||
945 | menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvDbgToggleEnabled, NULL, &rlvDbgGetEnabled, NULL)); | ||
946 | #endif // RLV_ADVANCED_TOGGLE_RLVA | ||
947 | // [/RLVa:KB] | ||
948 | |||
922 | if(gSavedSettings.getBOOL("QAMode")) | 949 | if(gSavedSettings.getBOOL("QAMode")) |
923 | { | 950 | { |
924 | LLMenuGL* sub = NULL; | 951 | LLMenuGL* sub = NULL; |
@@ -1366,6 +1393,53 @@ void init_debug_baked_texture_menu(LLMenuGL* menu) | |||
1366 | menu->createJumpKeys(); | 1393 | menu->createJumpKeys(); |
1367 | } | 1394 | } |
1368 | 1395 | ||
1396 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g | ||
1397 | void init_debug_rlva_menu(LLMenuGL* menu) | ||
1398 | { | ||
1399 | // Experimental feature toggles | ||
1400 | { | ||
1401 | /* | ||
1402 | #ifdef RLV_EXPERIMENTAL | ||
1403 | LLMenuGL* sub_menu = new LLMenuGL("Experimental"); | ||
1404 | |||
1405 | menu->appendMenu(sub_menu); | ||
1406 | #endif // RLV_EXPERIMENTAL | ||
1407 | */ | ||
1408 | } | ||
1409 | |||
1410 | // Unit tests | ||
1411 | { | ||
1412 | #ifdef RLV_DEBUG_TESTS | ||
1413 | init_debug_rlva_tests_menu(menu); | ||
1414 | #endif // RLV_DEBUG_TESTS | ||
1415 | } | ||
1416 | |||
1417 | #ifdef RLV_EXTENSION_ENABLE_WEAR | ||
1418 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) | ||
1419 | { | ||
1420 | menu->append(new LLMenuItemCheckGL("Enable Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); | ||
1421 | menu->appendSeparator(); | ||
1422 | } | ||
1423 | #endif // RLV_EXTENSION_ENABLE_WEAR | ||
1424 | |||
1425 | #ifdef RLV_EXTENSION_HIDELOCKED | ||
1426 | if ( (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDLAYER)) && | ||
1427 | (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDATTACH)) ) | ||
1428 | { | ||
1429 | menu->append(new LLMenuItemCheckGL("Hide locked layers", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDLAYER)); | ||
1430 | menu->append(new LLMenuItemCheckGL("Hide locked attachments", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDATTACH)); | ||
1431 | //sub_menu->append(new LLMenuItemToggleGL("Hide locked inventory", &rlv_handler_t::fHideLockedInventory)); | ||
1432 | menu->appendSeparator(); | ||
1433 | } | ||
1434 | #endif // RLV_EXTENSION_HIDELOCKED | ||
1435 | |||
1436 | #ifdef RLV_EXTENSION_FLOATER_RESTRICTIONS | ||
1437 | // TODO-RLVa: figure out a way to tell if floater_rlv_behaviour.xml exists | ||
1438 | menu->append(new LLMenuItemCallGL("Restrictions...", RlvFloaterBehaviour::show, NULL, NULL)); | ||
1439 | #endif // RLV_EXTENSION_FLOATER_RESTRICTIONS | ||
1440 | } | ||
1441 | // [/RLVa:KB] | ||
1442 | |||
1369 | void init_server_menu(LLMenuGL* menu) | 1443 | void init_server_menu(LLMenuGL* menu) |
1370 | { | 1444 | { |
1371 | { | 1445 | { |
@@ -1518,6 +1592,16 @@ class LLObjectTouch : public view_listener_t | |||
1518 | 1592 | ||
1519 | LLPickInfo pick = LLToolPie::getInstance()->getPick(); | 1593 | LLPickInfo pick = LLToolPie::getInstance()->getPick(); |
1520 | 1594 | ||
1595 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f | ||
1596 | // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for | ||
1597 | // [msg->addVector3("Position", pick.mIntersection) <- see llDetectedTouchPos()] | ||
1598 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) && | ||
1599 | (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f) ) | ||
1600 | { | ||
1601 | return true; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n | ||
1602 | } | ||
1603 | // [/RLVa:KB] | ||
1604 | |||
1521 | LLMessageSystem *msg = gMessageSystem; | 1605 | LLMessageSystem *msg = gMessageSystem; |
1522 | 1606 | ||
1523 | msg->newMessageFast(_PREHASH_ObjectGrab); | 1607 | msg->newMessageFast(_PREHASH_ObjectGrab); |
@@ -1566,6 +1650,14 @@ class LLObjectEnableTouch : public view_listener_t | |||
1566 | { | 1650 | { |
1567 | LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | 1651 | LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); |
1568 | bool new_value = obj && obj->flagHandleTouch(); | 1652 | bool new_value = obj && obj->flagHandleTouch(); |
1653 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f | ||
1654 | // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for | ||
1655 | if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!obj->isAttachment()) || (!obj->permYouOwner())) && | ||
1656 | (dist_vec_squared(gAgent.getPositionAgent(), LLToolPie::getInstance()->getPick().mIntersection) > 1.5f * 1.5f) ) | ||
1657 | { | ||
1658 | new_value = false; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n | ||
1659 | } | ||
1660 | // [/RLVa:KB] | ||
1569 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 1661 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
1570 | 1662 | ||
1571 | // Update label based on the node touch name if available. | 1663 | // Update label based on the node touch name if available. |
@@ -1634,6 +1726,14 @@ class LLObjectOpen : public view_listener_t | |||
1634 | { | 1726 | { |
1635 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 1727 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
1636 | { | 1728 | { |
1729 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | ||
1730 | // TODO-RLVa: shouldn't we be checking for fartouch here as well? | ||
1731 | if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) | ||
1732 | { | ||
1733 | return true; | ||
1734 | } | ||
1735 | // [/RLVa:KB] | ||
1736 | |||
1637 | return handle_object_open(); | 1737 | return handle_object_open(); |
1638 | } | 1738 | } |
1639 | }; | 1739 | }; |
@@ -1652,6 +1752,12 @@ class LLObjectEnableOpen : public view_listener_t | |||
1652 | if (!root) new_value = false; | 1752 | if (!root) new_value = false; |
1653 | else new_value = root->allowOpen(); | 1753 | else new_value = root->allowOpen(); |
1654 | } | 1754 | } |
1755 | |||
1756 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | Modified: RLVa-1.0.0b | ||
1757 | // TODO-RLV: shouldn't we be checking for fartouch here as well? (and LLViewerObject::allowOpen() makes this redundant?) | ||
1758 | new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_EDIT); | ||
1759 | // [/RLVa:KB] | ||
1760 | |||
1655 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 1761 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
1656 | return true; | 1762 | return true; |
1657 | } | 1763 | } |
@@ -1713,7 +1819,13 @@ bool toggle_build_mode() | |||
1713 | } | 1819 | } |
1714 | } | 1820 | } |
1715 | 1821 | ||
1716 | 1822 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | |
1823 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (LLSelectMgr::getInstance()) ) | ||
1824 | { | ||
1825 | LLSelectMgr::getInstance()->deselectAll(); | ||
1826 | } | ||
1827 | // [/RLVa:KB] | ||
1828 | |||
1717 | LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); | 1829 | LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); |
1718 | LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); | 1830 | LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); |
1719 | 1831 | ||
@@ -1813,6 +1925,23 @@ class LLObjectEdit : public view_listener_t | |||
1813 | { | 1925 | { |
1814 | LLViewerParcelMgr::getInstance()->deselectLand(); | 1926 | LLViewerParcelMgr::getInstance()->deselectLand(); |
1815 | 1927 | ||
1928 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f | ||
1929 | if (rlv_handler_t::isEnabled()) | ||
1930 | { | ||
1931 | if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) | ||
1932 | { | ||
1933 | return true; // Can't edit any object under @edit=n | ||
1934 | } | ||
1935 | else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && | ||
1936 | (SELECT_TYPE_WORLD == LLSelectMgr::getInstance()->getSelection()->getSelectType()) && | ||
1937 | (dist_vec_squared(gAgent.getPositionAgent(), LLToolPie::getInstance()->getPick().mIntersection) > 1.5f * 1.5f) ) | ||
1938 | { | ||
1939 | // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for | ||
1940 | return true; // Can't edit in-world objects farther than 1.5m away under @fartouch=n | ||
1941 | } | ||
1942 | } | ||
1943 | // [/RLVa:KB] | ||
1944 | |||
1816 | if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) | 1945 | if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) |
1817 | { | 1946 | { |
1818 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); | 1947 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); |
@@ -1962,6 +2091,22 @@ class LLEnableEdit : public view_listener_t | |||
1962 | enable = LLViewerParcelMgr::getInstance()->agentCanBuild() | 2091 | enable = LLViewerParcelMgr::getInstance()->agentCanBuild() |
1963 | || LLSelectMgr::getInstance()->getSelection()->isAttachment(); | 2092 | || LLSelectMgr::getInstance()->getSelection()->isAttachment(); |
1964 | } | 2093 | } |
2094 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
2095 | // TODO-RLV: include fartouch here? | ||
2096 | if ( (rlv_handler_t::isEnabled()) && (enable) ) | ||
2097 | { | ||
2098 | // We have no way of knowing whether we're being called for "Create" or for "Edit", but we can | ||
2099 | // make an educated guess based on the currently active selection which puts us halfway there. | ||
2100 | BOOL fActiveSelection = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); | ||
2101 | |||
2102 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) | ||
2103 | enable = false; // Edit and rez restricted, disable them both | ||
2104 | else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (fActiveSelection) ) | ||
2105 | enable = false; // Edit restricted and there's an active selection => disable Edit and Create | ||
2106 | else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && (!fActiveSelection) ) | ||
2107 | enable = false; // Rez restricted and there's no active selection => disable Create | ||
2108 | } | ||
2109 | // [/RLVa:KB] | ||
1965 | gMenuHolder->findControl(userdata["control"].asString())->setValue(enable); | 2110 | gMenuHolder->findControl(userdata["control"].asString())->setValue(enable); |
1966 | return true; | 2111 | return true; |
1967 | } | 2112 | } |
@@ -1989,7 +2134,10 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t | |||
1989 | { | 2134 | { |
1990 | LLVOAvatar::attachment_map_t::iterator curiter = iter++; | 2135 | LLVOAvatar::attachment_map_t::iterator curiter = iter++; |
1991 | LLViewerJointAttachment* attachment = curiter->second; | 2136 | LLViewerJointAttachment* attachment = curiter->second; |
1992 | if (attachment->getObject()) | 2137 | // if (attachment->getObject()) |
2138 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0c | ||
2139 | if ( (attachment->getObject()) && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(curiter->first)) ) ) | ||
2140 | // [/RLVa:KB] | ||
1993 | { | 2141 | { |
1994 | new_value = true; | 2142 | new_value = true; |
1995 | break; | 2143 | break; |
@@ -2036,6 +2184,9 @@ class LLObjectEnableMute : public view_listener_t | |||
2036 | BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); | 2184 | BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); |
2037 | BOOL is_self = avatar->isSelf(); | 2185 | BOOL is_self = avatar->isSelf(); |
2038 | new_value = !is_linden && !is_self; | 2186 | new_value = !is_linden && !is_self; |
2187 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
2188 | new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); | ||
2189 | // [/RLVa:KB] | ||
2039 | } | 2190 | } |
2040 | } | 2191 | } |
2041 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 2192 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
@@ -2056,6 +2207,12 @@ class LLObjectMute : public view_listener_t | |||
2056 | LLVOAvatar* avatar = find_avatar_from_object(object); | 2207 | LLVOAvatar* avatar = find_avatar_from_object(object); |
2057 | if (avatar) | 2208 | if (avatar) |
2058 | { | 2209 | { |
2210 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-1.0.0e | ||
2211 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
2212 | { | ||
2213 | return true; // Fallback code [see LLObjectEnableMute::handleEvent()] | ||
2214 | } | ||
2215 | // [/RLVa:KB] | ||
2059 | id = avatar->getID(); | 2216 | id = avatar->getID(); |
2060 | 2217 | ||
2061 | LLNameValue *firstname = avatar->getNVPair("FirstName"); | 2218 | LLNameValue *firstname = avatar->getNVPair("FirstName"); |
@@ -2106,6 +2263,13 @@ class LLObjectMute : public view_listener_t | |||
2106 | 2263 | ||
2107 | bool handle_go_to() | 2264 | bool handle_go_to() |
2108 | { | 2265 | { |
2266 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
2267 | if ( (rlv_handler_t::isEnabled()) && gAgent.forwardGrabbed() && (gRlvHandler.hasLockedAttachment()) ) | ||
2268 | { | ||
2269 | return true; | ||
2270 | } | ||
2271 | // [/RLVa:KB] | ||
2272 | |||
2109 | // JAMESDEBUG try simulator autopilot | 2273 | // JAMESDEBUG try simulator autopilot |
2110 | std::vector<std::string> strings; | 2274 | std::vector<std::string> strings; |
2111 | std::string val; | 2275 | std::string val; |
@@ -2188,6 +2352,12 @@ class LLAvatarFreeze : public view_listener_t | |||
2188 | { | 2352 | { |
2189 | LLUUID* avatar_id = new LLUUID( avatar->getID() ); | 2353 | LLUUID* avatar_id = new LLUUID( avatar->getID() ); |
2190 | std::string fullname = avatar->getFullname(); | 2354 | std::string fullname = avatar->getFullname(); |
2355 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | ||
2356 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) | ||
2357 | { | ||
2358 | fullname = gRlvHandler.getAnonym(fullname); | ||
2359 | } | ||
2360 | // [/RLVa:KB] | ||
2191 | 2361 | ||
2192 | if (!fullname.empty()) | 2362 | if (!fullname.empty()) |
2193 | { | 2363 | { |
@@ -2213,7 +2383,11 @@ class LLAvatarVisibleDebug : public view_listener_t | |||
2213 | { | 2383 | { |
2214 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2384 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2215 | { | 2385 | { |
2216 | bool new_value = gAgent.isGodlike(); | 2386 | //bool new_value = gAgent.isGodlike(); |
2387 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
2388 | // TODO-RLVa: can you actually use this to cheat anything? | ||
2389 | bool new_value = gAgent.isGodlike() && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); | ||
2390 | // [/RLVa:KB] | ||
2217 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 2391 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
2218 | return true; | 2392 | return true; |
2219 | } | 2393 | } |
@@ -2325,6 +2499,12 @@ class LLAvatarEject : public view_listener_t | |||
2325 | MenuCallbackData *data = new MenuCallbackData; | 2499 | MenuCallbackData *data = new MenuCallbackData; |
2326 | (*data).avatar_id = avatar->getID(); | 2500 | (*data).avatar_id = avatar->getID(); |
2327 | std::string fullname = avatar->getFullname(); | 2501 | std::string fullname = avatar->getFullname(); |
2502 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | ||
2503 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) | ||
2504 | { | ||
2505 | fullname = gRlvHandler.getAnonym(fullname); | ||
2506 | } | ||
2507 | // [/RLVa:KB] | ||
2328 | 2508 | ||
2329 | const LLVector3d& pos = avatar->getPositionGlobal(); | 2509 | const LLVector3d& pos = avatar->getPositionGlobal(); |
2330 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel(); | 2510 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel(); |
@@ -2406,6 +2586,13 @@ class LLAvatarGiveCard : public view_listener_t | |||
2406 | { | 2586 | { |
2407 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2587 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2408 | { | 2588 | { |
2589 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
2590 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
2591 | { | ||
2592 | return true; | ||
2593 | } | ||
2594 | // [/RLVa:KB] | ||
2595 | |||
2409 | llinfos << "handle_give_card()" << llendl; | 2596 | llinfos << "handle_give_card()" << llendl; |
2410 | LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | 2597 | LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); |
2411 | if(dest && dest->isAvatar()) | 2598 | if(dest && dest->isAvatar()) |
@@ -2655,6 +2842,13 @@ class LLSelfStandUp : public view_listener_t | |||
2655 | { | 2842 | { |
2656 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2843 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2657 | { | 2844 | { |
2845 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
2846 | if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) | ||
2847 | { | ||
2848 | return true; | ||
2849 | } | ||
2850 | // [/RLVa:KB] | ||
2851 | |||
2658 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); | 2852 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); |
2659 | return true; | 2853 | return true; |
2660 | } | 2854 | } |
@@ -2664,7 +2858,10 @@ class LLSelfEnableStandUp : public view_listener_t | |||
2664 | { | 2858 | { |
2665 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2859 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2666 | { | 2860 | { |
2667 | bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting; | 2861 | // bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting; |
2862 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
2863 | bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT); | ||
2864 | // [/RLVa:KB] | ||
2668 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 2865 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
2669 | return true; | 2866 | return true; |
2670 | } | 2867 | } |
@@ -2839,6 +3036,11 @@ class LLAvatarEnableAddFriend : public view_listener_t | |||
2839 | { | 3036 | { |
2840 | LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); | 3037 | LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); |
2841 | bool new_value = avatar && !is_agent_friend(avatar->getID()); | 3038 | bool new_value = avatar && !is_agent_friend(avatar->getID()); |
3039 | |||
3040 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
3041 | new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); | ||
3042 | // [/RLVa:KB] | ||
3043 | |||
2842 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 3044 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
2843 | return true; | 3045 | return true; |
2844 | } | 3046 | } |
@@ -2897,6 +3099,15 @@ bool handle_sit_or_stand() | |||
2897 | return true; | 3099 | return true; |
2898 | } | 3100 | } |
2899 | 3101 | ||
3102 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0c) | ||
3103 | if ( (rlv_handler_t::isEnabled()) && | ||
3104 | ( ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting)) || | ||
3105 | (gRlvHandler.hasBehaviour(RLV_BHVR_SIT)) ) ) | ||
3106 | { | ||
3107 | return true; | ||
3108 | } | ||
3109 | // [/RLVa:KB] | ||
3110 | |||
2900 | if (sitting_on_selection()) | 3111 | if (sitting_on_selection()) |
2901 | { | 3112 | { |
2902 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); | 3113 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); |
@@ -2907,6 +3118,15 @@ bool handle_sit_or_stand() | |||
2907 | 3118 | ||
2908 | if (object && object->getPCode() == LL_PCODE_VOLUME) | 3119 | if (object && object->getPCode() == LL_PCODE_VOLUME) |
2909 | { | 3120 | { |
3121 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g | ||
3122 | if ( (rlv_handler_t::isEnabled()) && | ||
3123 | ((gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) || (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && | ||
3124 | (dist_vec_squared(gAgent.getPositionGlobal(), object->getPositionGlobal() + LLVector3d(pick.mObjectOffset)) > 1.5f * 1.5f) ) | ||
3125 | { | ||
3126 | return true; // Don't allow sitting farther away than 1.5m under @sittp=n or @fartouch=n | ||
3127 | } | ||
3128 | // [/RLVa:KB] | ||
3129 | |||
2910 | gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); | 3130 | gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); |
2911 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); | 3131 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); |
2912 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | 3132 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); |
@@ -2944,6 +3164,13 @@ class LLLandSit : public view_listener_t | |||
2944 | { | 3164 | { |
2945 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3165 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2946 | { | 3166 | { |
3167 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
3168 | if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) | ||
3169 | { | ||
3170 | return true; | ||
3171 | } | ||
3172 | // [/RLVa:KB] | ||
3173 | |||
2947 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); | 3174 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); |
2948 | LLViewerParcelMgr::getInstance()->deselectLand(); | 3175 | LLViewerParcelMgr::getInstance()->deselectLand(); |
2949 | 3176 | ||
@@ -3254,6 +3481,14 @@ class LLEditDuplicate : public view_listener_t | |||
3254 | { | 3481 | { |
3255 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3482 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3256 | { | 3483 | { |
3484 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
3485 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && | ||
3486 | (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) | ||
3487 | { | ||
3488 | return true; | ||
3489 | } | ||
3490 | // [/RLVa:KB] | ||
3491 | |||
3257 | if(LLEditMenuHandler::gEditMenuHandler) | 3492 | if(LLEditMenuHandler::gEditMenuHandler) |
3258 | { | 3493 | { |
3259 | LLEditMenuHandler::gEditMenuHandler->duplicate(); | 3494 | LLEditMenuHandler::gEditMenuHandler->duplicate(); |
@@ -3267,6 +3502,13 @@ class LLEditEnableDuplicate : public view_listener_t | |||
3267 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3502 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3268 | { | 3503 | { |
3269 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDuplicate(); | 3504 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDuplicate(); |
3505 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
3506 | if ( (new_value) && (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && | ||
3507 | (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) | ||
3508 | { | ||
3509 | new_value = false; | ||
3510 | } | ||
3511 | // [/RLVa:KB] | ||
3270 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 3512 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
3271 | return true; | 3513 | return true; |
3272 | } | 3514 | } |
@@ -3652,6 +3894,11 @@ class LLToolsTakeCopy : public view_listener_t | |||
3652 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3894 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3653 | { | 3895 | { |
3654 | if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; | 3896 | if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; |
3897 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | Modified: RLVa-1.0.0b | ||
3898 | // NOTE: we need to handle "Take Copy" because it will force a sim-side unsit if we're sitting on the selection, | ||
3899 | // but we do want to allow "Take Copy" under @rez=n so that's why we explicitly check for @unsit=n here | ||
3900 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (!rlvCanDeleteOrReturn()) ) return true; | ||
3901 | // [/RLVa:KB] | ||
3655 | 3902 | ||
3656 | const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); | 3903 | const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); |
3657 | derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); | 3904 | derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); |
@@ -3667,6 +3914,9 @@ class LLObjectReturn : public view_listener_t | |||
3667 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3914 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3668 | { | 3915 | { |
3669 | if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; | 3916 | if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; |
3917 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-05 (RLVa-1.0.0b) | ||
3918 | if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) return true; | ||
3919 | // [/RLVa:KB] | ||
3670 | 3920 | ||
3671 | mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); | 3921 | mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); |
3672 | 3922 | ||
@@ -3736,6 +3986,14 @@ class LLObjectEnableReturn : public view_listener_t | |||
3736 | } | 3986 | } |
3737 | } | 3987 | } |
3738 | #endif | 3988 | #endif |
3989 | |||
3990 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
3991 | if ( (new_value) && (rlv_handler_t::isEnabled()) ) | ||
3992 | { | ||
3993 | new_value = rlvCanDeleteOrReturn(); | ||
3994 | } | ||
3995 | // [/RLVa:KB] | ||
3996 | |||
3739 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 3997 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
3740 | return true; | 3998 | return true; |
3741 | } | 3999 | } |
@@ -3757,6 +4015,13 @@ void handle_take() | |||
3757 | return; | 4015 | return; |
3758 | } | 4016 | } |
3759 | 4017 | ||
4018 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4019 | if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) | ||
4020 | { | ||
4021 | return; | ||
4022 | } | ||
4023 | // [/RLVa:KB] | ||
4024 | |||
3760 | BOOL you_own_everything = TRUE; | 4025 | BOOL you_own_everything = TRUE; |
3761 | BOOL locked_but_takeable_object = FALSE; | 4026 | BOOL locked_but_takeable_object = FALSE; |
3762 | LLUUID category_id; | 4027 | LLUUID category_id; |
@@ -3878,6 +4143,13 @@ BOOL enable_take() | |||
3878 | return FALSE; | 4143 | return FALSE; |
3879 | } | 4144 | } |
3880 | 4145 | ||
4146 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4147 | if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) | ||
4148 | { | ||
4149 | return FALSE; | ||
4150 | } | ||
4151 | // [/RLVa:KB] | ||
4152 | |||
3881 | for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); | 4153 | for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); |
3882 | iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) | 4154 | iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) |
3883 | { | 4155 | { |
@@ -4199,6 +4471,21 @@ class LLToolsEnableUnlink : public view_listener_t | |||
4199 | new_value = true; | 4471 | new_value = true; |
4200 | } | 4472 | } |
4201 | } | 4473 | } |
4474 | |||
4475 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g | ||
4476 | // The user might not be allowed to unlink this object due to RLV settings, | ||
4477 | // because it would unsit them if they are sitting on the object. | ||
4478 | if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && | ||
4479 | (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) | ||
4480 | { | ||
4481 | // Allow if the avie isn't sitting on any of the selected objects | ||
4482 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); | ||
4483 | RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); | ||
4484 | if (handleSel->getFirstRootNode(&func, TRUE)) | ||
4485 | new_value = false; | ||
4486 | } | ||
4487 | // [/RLVa:KB] | ||
4488 | |||
4202 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4489 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4203 | return true; | 4490 | return true; |
4204 | } | 4491 | } |
@@ -4208,6 +4495,19 @@ class LLToolsUnlink : public view_listener_t | |||
4208 | { | 4495 | { |
4209 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4496 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4210 | { | 4497 | { |
4498 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g | ||
4499 | // The user might not be allowed to unlink this object due to RLV settings, | ||
4500 | // because it would unsit them if they are sitting on the object. | ||
4501 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) | ||
4502 | { | ||
4503 | // Allow if the avie isn't sitting on any of the selected objects | ||
4504 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); | ||
4505 | RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); | ||
4506 | if (handleSel->getFirstRootNode(&func, TRUE)) | ||
4507 | return true; | ||
4508 | } | ||
4509 | // [/RLVa:KB] | ||
4510 | |||
4211 | LLSelectMgr::getInstance()->sendDelink(); | 4511 | LLSelectMgr::getInstance()->sendDelink(); |
4212 | return true; | 4512 | return true; |
4213 | } | 4513 | } |
@@ -4227,6 +4527,13 @@ class LLToolsReleaseKeys : public view_listener_t | |||
4227 | { | 4527 | { |
4228 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4528 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4229 | { | 4529 | { |
4530 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
4531 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
4532 | { | ||
4533 | return true; | ||
4534 | } | ||
4535 | // [/RLVa:KB] | ||
4536 | |||
4230 | gAgent.forceReleaseControls(); | 4537 | gAgent.forceReleaseControls(); |
4231 | 4538 | ||
4232 | return true; | 4539 | return true; |
@@ -4237,7 +4544,11 @@ class LLToolsEnableReleaseKeys : public view_listener_t | |||
4237 | { | 4544 | { |
4238 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4545 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4239 | { | 4546 | { |
4240 | gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); | 4547 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) |
4548 | gMenuHolder->findControl(userdata["control"].asString())->setValue( | ||
4549 | gAgent.anyControlGrabbed() && ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment() ) ) ); | ||
4550 | // [/RLVa:KB] | ||
4551 | //gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); | ||
4241 | return true; | 4552 | return true; |
4242 | } | 4553 | } |
4243 | }; | 4554 | }; |
@@ -4345,6 +4656,15 @@ class LLEditEnableDelete : public view_listener_t | |||
4345 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4656 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4346 | { | 4657 | { |
4347 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); | 4658 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); |
4659 | |||
4660 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4661 | // NOTE: we want to disable delete on objects but not disable delete on text | ||
4662 | if ( (new_value) && (rlv_handler_t::isEnabled()) && (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) | ||
4663 | { | ||
4664 | new_value = rlvCanDeleteOrReturn(); | ||
4665 | } | ||
4666 | // [/RLVa:KB] | ||
4667 | |||
4348 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4668 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4349 | return true; | 4669 | return true; |
4350 | } | 4670 | } |
@@ -4354,6 +4674,15 @@ class LLEditDelete : public view_listener_t | |||
4354 | { | 4674 | { |
4355 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4675 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4356 | { | 4676 | { |
4677 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4678 | // NOTE: we want to disable delete on objects but not disable delete on text | ||
4679 | if ( (rlv_handler_t::isEnabled()) && (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) && | ||
4680 | (!rlvCanDeleteOrReturn()) ) | ||
4681 | { | ||
4682 | return true; | ||
4683 | } | ||
4684 | // [/RLVa:KB] | ||
4685 | |||
4357 | // If a text field can do a deletion, it gets precedence over deleting | 4686 | // If a text field can do a deletion, it gets precedence over deleting |
4358 | // an object in the world. | 4687 | // an object in the world. |
4359 | if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) | 4688 | if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) |
@@ -4385,6 +4714,12 @@ class LLObjectEnableDelete : public view_listener_t | |||
4385 | # endif | 4714 | # endif |
4386 | LLSelectMgr::getInstance()->canDoDelete(); | 4715 | LLSelectMgr::getInstance()->canDoDelete(); |
4387 | #endif | 4716 | #endif |
4717 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4718 | if ( (new_value) && (rlv_handler_t::isEnabled()) ) | ||
4719 | { | ||
4720 | new_value = rlvCanDeleteOrReturn(); | ||
4721 | } | ||
4722 | // [/RLVa:KB] | ||
4388 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4723 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4389 | return true; | 4724 | return true; |
4390 | } | 4725 | } |
@@ -4403,6 +4738,13 @@ class LLObjectDelete : public view_listener_t | |||
4403 | { | 4738 | { |
4404 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4739 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4405 | { | 4740 | { |
4741 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4742 | if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) | ||
4743 | { | ||
4744 | return true; | ||
4745 | } | ||
4746 | // [/RLVa:KB] | ||
4747 | |||
4406 | if (LLSelectMgr::getInstance()) | 4748 | if (LLSelectMgr::getInstance()) |
4407 | { | 4749 | { |
4408 | LLSelectMgr::getInstance()->doDelete(); | 4750 | LLSelectMgr::getInstance()->doDelete(); |
@@ -4752,6 +5094,12 @@ class LLWorldCreateLandmark : public view_listener_t | |||
4752 | { | 5094 | { |
4753 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5095 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4754 | { | 5096 | { |
5097 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | ||
5098 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) | ||
5099 | { | ||
5100 | return true; | ||
5101 | } | ||
5102 | // [/RLVa:KB] | ||
4755 | LLViewerRegion* agent_region = gAgent.getRegion(); | 5103 | LLViewerRegion* agent_region = gAgent.getRegion(); |
4756 | if(!agent_region) | 5104 | if(!agent_region) |
4757 | { | 5105 | { |
@@ -4859,6 +5207,13 @@ class LLAvatarInviteToGroup : public view_listener_t | |||
4859 | { | 5207 | { |
4860 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5208 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4861 | { | 5209 | { |
5210 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5211 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
5212 | { | ||
5213 | return true; | ||
5214 | } | ||
5215 | // [/RLVa:KB] | ||
5216 | |||
4862 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); | 5217 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); |
4863 | if(avatar) | 5218 | if(avatar) |
4864 | { | 5219 | { |
@@ -4872,6 +5227,13 @@ class LLAvatarAddFriend : public view_listener_t | |||
4872 | { | 5227 | { |
4873 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5228 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4874 | { | 5229 | { |
5230 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5231 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
5232 | { | ||
5233 | return true; // Fallback code [see LLAvatarEnableAddFriend::handleEvent()] | ||
5234 | } | ||
5235 | // [/RLVa:KB] | ||
5236 | |||
4875 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); | 5237 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); |
4876 | if(avatar && !is_agent_friend(avatar->getID())) | 5238 | if(avatar && !is_agent_friend(avatar->getID())) |
4877 | { | 5239 | { |
@@ -4959,6 +5321,12 @@ class LLEnablePayObject : public view_listener_t | |||
4959 | } | 5321 | } |
4960 | } | 5322 | } |
4961 | } | 5323 | } |
5324 | |||
5325 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5326 | // Don't enable "Pay..." on the avatar pie menu under @shownames=n | ||
5327 | new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (avatar == NULL); | ||
5328 | // [/RLVa:KB] | ||
5329 | |||
4962 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 5330 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4963 | return true; | 5331 | return true; |
4964 | } | 5332 | } |
@@ -5147,6 +5515,12 @@ class LLShowFloater : public view_listener_t | |||
5147 | } | 5515 | } |
5148 | else if (floater_name == "buy land") | 5516 | else if (floater_name == "buy land") |
5149 | { | 5517 | { |
5518 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | ||
5519 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) | ||
5520 | { | ||
5521 | return true; | ||
5522 | } | ||
5523 | // [/RLVa:KB] | ||
5150 | if (LLViewerParcelMgr::getInstance()->selectionEmpty()) | 5524 | if (LLViewerParcelMgr::getInstance()->selectionEmpty()) |
5151 | { | 5525 | { |
5152 | LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); | 5526 | LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); |
@@ -5324,6 +5698,13 @@ class LLShowAgentProfile : public view_listener_t | |||
5324 | } | 5698 | } |
5325 | else if (userdata.asString() == "hit object") | 5699 | else if (userdata.asString() == "hit object") |
5326 | { | 5700 | { |
5701 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5702 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
5703 | { | ||
5704 | return true; | ||
5705 | } | ||
5706 | // [/RLVa:KB] | ||
5707 | |||
5327 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | 5708 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); |
5328 | if (objectp) | 5709 | if (objectp) |
5329 | { | 5710 | { |
@@ -5383,6 +5764,13 @@ class LLLandEdit : public view_listener_t | |||
5383 | { | 5764 | { |
5384 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5765 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5385 | { | 5766 | { |
5767 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | ||
5768 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) ) | ||
5769 | { | ||
5770 | return true; | ||
5771 | } | ||
5772 | // [/RLVa:KB] | ||
5773 | |||
5386 | if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) | 5774 | if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) |
5387 | { | 5775 | { |
5388 | // zoom in if we're looking at the avatar | 5776 | // zoom in if we're looking at the avatar |
@@ -5468,6 +5856,18 @@ private: | |||
5468 | LLViewerJointAttachment* attachment_point = NULL; | 5856 | LLViewerJointAttachment* attachment_point = NULL; |
5469 | if (index > 0) | 5857 | if (index > 0) |
5470 | attachment_point = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); | 5858 | attachment_point = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); |
5859 | |||
5860 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
5861 | if ( (rlv_handler_t::isEnabled()) && | ||
5862 | ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point | ||
5863 | ((index > 0) && (!gRlvHandler.isDetachable(attachment_point->getObject()))) || // Can't replace locked attachment | ||
5864 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" | ||
5865 | { | ||
5866 | setObjectSelection(NULL); // Clear the selection or it'll get stuck | ||
5867 | return true; | ||
5868 | } | ||
5869 | // [/RLVa:KB] | ||
5870 | |||
5471 | confirm_replace_attachment(0, attachment_point); | 5871 | confirm_replace_attachment(0, attachment_point); |
5472 | } | 5872 | } |
5473 | return true; | 5873 | return true; |
@@ -5575,6 +5975,24 @@ class LLAttachmentDrop : public view_listener_t | |||
5575 | return true; | 5975 | return true; |
5576 | } | 5976 | } |
5577 | 5977 | ||
5978 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
5979 | if (rlv_handler_t::isEnabled()) | ||
5980 | { | ||
5981 | if (gRlvHandler.hasLockedAttachment()) | ||
5982 | { | ||
5983 | // NOTE: copy/paste of the code in enable_detach() | ||
5984 | LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); | ||
5985 | RlvSelectHasLockedAttach functor; | ||
5986 | if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) | ||
5987 | return true; | ||
5988 | } | ||
5989 | else if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
5990 | { | ||
5991 | return true; | ||
5992 | } | ||
5993 | } | ||
5994 | // [/RLVa:KB] | ||
5995 | |||
5578 | // The sendDropAttachment() method works on the list of selected | 5996 | // The sendDropAttachment() method works on the list of selected |
5579 | // objects. Thus we need to clear the list, make sure it only | 5997 | // objects. Thus we need to clear the list, make sure it only |
5580 | // contains the object the user clicked, send the message, | 5998 | // contains the object the user clicked, send the message, |
@@ -5593,6 +6011,13 @@ void handle_detach_from_avatar(void* user_data) | |||
5593 | 6011 | ||
5594 | if (attached_object) | 6012 | if (attached_object) |
5595 | { | 6013 | { |
6014 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0d | ||
6015 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(attached_object)) ) | ||
6016 | { | ||
6017 | return; | ||
6018 | } | ||
6019 | // [/RLVa:KB] | ||
6020 | |||
5596 | gMessageSystem->newMessage("ObjectDetach"); | 6021 | gMessageSystem->newMessage("ObjectDetach"); |
5597 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); | 6022 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); |
5598 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); | 6023 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); |
@@ -5675,6 +6100,17 @@ class LLAttachmentDetach : public view_listener_t | |||
5675 | return true; | 6100 | return true; |
5676 | } | 6101 | } |
5677 | 6102 | ||
6103 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6104 | // NOTE: copy/paste of the code in enable_detach() | ||
6105 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6106 | { | ||
6107 | LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); | ||
6108 | RlvSelectHasLockedAttach functor; | ||
6109 | if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) | ||
6110 | return FALSE; | ||
6111 | } | ||
6112 | // [/RLVa:KB] | ||
6113 | |||
5678 | // The sendDetach() method works on the list of selected | 6114 | // The sendDetach() method works on the list of selected |
5679 | // objects. Thus we need to clear the list, make sure it only | 6115 | // objects. Thus we need to clear the list, make sure it only |
5680 | // contains the object the user clicked, send the message, | 6116 | // contains the object the user clicked, send the message, |
@@ -5758,7 +6194,10 @@ class LLAttachmentEnableDrop : public view_listener_t | |||
5758 | } | 6194 | } |
5759 | 6195 | ||
5760 | //now check to make sure that the item is actually in the inventory before we enable dropping it | 6196 | //now check to make sure that the item is actually in the inventory before we enable dropping it |
5761 | bool new_value = enable_detach(NULL) && can_build && item; | 6197 | // bool new_value = enable_detach(NULL) && can_build && item; |
6198 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
6199 | bool new_value = enable_detach(NULL) && can_build && item && (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)); | ||
6200 | // [/RLVa:KB] | ||
5762 | 6201 | ||
5763 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 6202 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
5764 | return true; | 6203 | return true; |
@@ -5778,6 +6217,20 @@ BOOL enable_detach(void*) | |||
5778 | // ...if it's you, good to detach | 6217 | // ...if it's you, good to detach |
5779 | if (avatar->getID() == gAgent.getID()) | 6218 | if (avatar->getID() == gAgent.getID()) |
5780 | { | 6219 | { |
6220 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6221 | // NOTE: this code is reused as-is in LLAttachmentDetach::handleEvent() and LLAttachmentDrop::handleEvent() | ||
6222 | // so any changes here should be reflected there as well (I think it's in a number of other places as well by now) | ||
6223 | |||
6224 | // RELEASE-RLVa: LLSelectMgr::sendDetach() and LLSelectMgr::sendDropAttachment() call sendListToRegions with | ||
6225 | // SEND_ONLY_ROOTS so we only need to examine the roots which saves us time | ||
6226 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6227 | { | ||
6228 | LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); | ||
6229 | RlvSelectHasLockedAttach functor; | ||
6230 | if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) | ||
6231 | return FALSE; | ||
6232 | } | ||
6233 | // [/RLVa:KB] | ||
5781 | return TRUE; | 6234 | return TRUE; |
5782 | } | 6235 | } |
5783 | 6236 | ||
@@ -5800,6 +6253,25 @@ class LLAttachmentEnableDetach : public view_listener_t | |||
5800 | // Used to tell if the selected object can be attached to your avatar. | 6253 | // Used to tell if the selected object can be attached to your avatar. |
5801 | BOOL object_selected_and_point_valid(void *user_data) | 6254 | BOOL object_selected_and_point_valid(void *user_data) |
5802 | { | 6255 | { |
6256 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
6257 | if (rlv_handler_t::isEnabled()) | ||
6258 | { | ||
6259 | // RELEASE-RLVa: look at the caller graph for this function on every new release | ||
6260 | // -> 1.22.11 and 1.23.4 | ||
6261 | // - object_is_wearable() => dead code [user_data == NULL => default attach point => OK!] | ||
6262 | // - LLObjectEnableWear::handleEvent() => Rezzed prim / right-click / "Wear" [user_data == NULL => see above] | ||
6263 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] | ||
6264 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] | ||
6265 | LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; | ||
6266 | if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point | ||
6267 | ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt->getObject()))) || // Don't allow replacing of locked attachment | ||
6268 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" | ||
6269 | { | ||
6270 | return FALSE; | ||
6271 | } | ||
6272 | } | ||
6273 | // [/RLVa:KB] | ||
6274 | |||
5803 | //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; | 6275 | //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; |
5804 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); | 6276 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); |
5805 | for (LLObjectSelection::root_iterator iter = selection->root_begin(); | 6277 | for (LLObjectSelection::root_iterator iter = selection->root_begin(); |
@@ -5867,7 +6339,13 @@ BOOL object_attached(void *user_data) | |||
5867 | { | 6339 | { |
5868 | LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; | 6340 | LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; |
5869 | 6341 | ||
5870 | return attachment->getObject() != NULL; | 6342 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) |
6343 | return ( | ||
6344 | (attachment->getObject() != NULL) && | ||
6345 | ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(attachment->getObject())) ) | ||
6346 | ); | ||
6347 | // [/RLVa:KB] | ||
6348 | // return attachment->getObject() != NULL; | ||
5871 | } | 6349 | } |
5872 | 6350 | ||
5873 | class LLAvatarSendIM : public view_listener_t | 6351 | class LLAvatarSendIM : public view_listener_t |
@@ -5875,6 +6353,12 @@ class LLAvatarSendIM : public view_listener_t | |||
5875 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6353 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5876 | { | 6354 | { |
5877 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); | 6355 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); |
6356 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
6357 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
6358 | { | ||
6359 | return true; | ||
6360 | } | ||
6361 | // [/RLVa:KB] | ||
5878 | if(avatar) | 6362 | if(avatar) |
5879 | { | 6363 | { |
5880 | std::string name("IM"); | 6364 | std::string name("IM"); |
@@ -6010,6 +6494,16 @@ class LLToolsSelectedScriptAction : public view_listener_t | |||
6010 | { | 6494 | { |
6011 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6495 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
6012 | { | 6496 | { |
6497 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6498 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6499 | { | ||
6500 | LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); | ||
6501 | RlvSelectHasLockedAttach functor; | ||
6502 | if ( (selectHandle->isAttachment()) && (selectHandle->getFirstNode(&functor)) ) | ||
6503 | return true; | ||
6504 | } | ||
6505 | // [/RLVa:KB] | ||
6506 | |||
6013 | std::string action = userdata.asString(); | 6507 | std::string action = userdata.asString(); |
6014 | if (action == "compile mono") | 6508 | if (action == "compile mono") |
6015 | { | 6509 | { |
@@ -6091,12 +6585,30 @@ void handle_dump_image_list(void*) | |||
6091 | 6585 | ||
6092 | void handle_test_male(void*) | 6586 | void handle_test_male(void*) |
6093 | { | 6587 | { |
6588 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6589 | if ( (rlv_handler_t::isEnabled()) && | ||
6590 | ( (gRlvHandler.hasLockedAttachment()) || | ||
6591 | (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) | ||
6592 | { | ||
6593 | return; | ||
6594 | } | ||
6595 | // [/RLVa:KB] | ||
6596 | |||
6094 | wear_outfit_by_name("Male Shape & Outfit"); | 6597 | wear_outfit_by_name("Male Shape & Outfit"); |
6095 | //gGestureList.requestResetFromServer( TRUE ); | 6598 | //gGestureList.requestResetFromServer( TRUE ); |
6096 | } | 6599 | } |
6097 | 6600 | ||
6098 | void handle_test_female(void*) | 6601 | void handle_test_female(void*) |
6099 | { | 6602 | { |
6603 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6604 | if ( (rlv_handler_t::isEnabled()) && | ||
6605 | ( (gRlvHandler.hasLockedAttachment()) || | ||
6606 | (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) | ||
6607 | { | ||
6608 | return; | ||
6609 | } | ||
6610 | // [/RLVa:KB] | ||
6611 | |||
6100 | wear_outfit_by_name("Female Shape & Outfit"); | 6612 | wear_outfit_by_name("Female Shape & Outfit"); |
6101 | //gGestureList.requestResetFromServer( FALSE ); | 6613 | //gGestureList.requestResetFromServer( FALSE ); |
6102 | } | 6614 | } |
@@ -6239,6 +6751,22 @@ BOOL enable_more_than_one_selected(void* ) | |||
6239 | 6751 | ||
6240 | static bool is_editable_selected() | 6752 | static bool is_editable_selected() |
6241 | { | 6753 | { |
6754 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c | ||
6755 | // RELEASE-RLVa: check that this still isn't called by anything but script actions in the Tools menu | ||
6756 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6757 | { | ||
6758 | LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); | ||
6759 | |||
6760 | // NOTE: this is called for 5 different menu items so we'll trade accuracy for efficiency and only | ||
6761 | // examine root nodes (LLToolsSelectedScriptAction::handleEvent() will catch what we miss) | ||
6762 | RlvSelectHasLockedAttach functor; | ||
6763 | if ( (selectHandle->isAttachment()) && (selectHandle->getFirstRootNode(&functor)) ) | ||
6764 | { | ||
6765 | return false; | ||
6766 | } | ||
6767 | } | ||
6768 | // [/RLVa:KB] | ||
6769 | |||
6242 | return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); | 6770 | return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); |
6243 | } | 6771 | } |
6244 | 6772 | ||
@@ -6285,7 +6813,12 @@ class LLToolsEnableTakeCopy : public view_listener_t | |||
6285 | { | 6813 | { |
6286 | virtual bool apply(LLViewerObject* obj) | 6814 | virtual bool apply(LLViewerObject* obj) |
6287 | { | 6815 | { |
6288 | return (!obj->permCopy() || obj->isAttachment()); | 6816 | // return (!obj->permCopy() || obj->isAttachment()); |
6817 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
6818 | return (!obj->permCopy() || obj->isAttachment()) || | ||
6819 | ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && | ||
6820 | (gAgent.getAvatarObject()->getRoot() == obj) ); | ||
6821 | // [/RLVa:KB] | ||
6289 | } | 6822 | } |
6290 | } func; | 6823 | } func; |
6291 | const bool firstonly = true; | 6824 | const bool firstonly = true; |
@@ -6488,6 +7021,9 @@ class LLWorldEnableCreateLandmark : public view_listener_t | |||
6488 | { | 7021 | { |
6489 | bool new_value = gAgent.isGodlike() || | 7022 | bool new_value = gAgent.isGodlike() || |
6490 | (gAgent.getRegion() && gAgent.getRegion()->getAllowLandmark()); | 7023 | (gAgent.getRegion() && gAgent.getRegion()->getAllowLandmark()); |
7024 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | ||
7025 | new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC); | ||
7026 | // [/RLVa:KB] | ||
6491 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 7027 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
6492 | return true; | 7028 | return true; |
6493 | } | 7029 | } |
@@ -6540,7 +7076,11 @@ BOOL enable_god_customer_service(void*) | |||
6540 | 7076 | ||
6541 | BOOL enable_god_basic(void*) | 7077 | BOOL enable_god_basic(void*) |
6542 | { | 7078 | { |
6543 | return gAgent.getGodLevel() > GOD_NOT; | 7079 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) |
7080 | // RELEASE-RLVa: check that this function isn't used for anything other than to enable/disable showing the "God Tools..." floater | ||
7081 | return (gAgent.getGodLevel() > GOD_NOT) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); | ||
7082 | // [/RLVa:KB] | ||
7083 | //return gAgent.getGodLevel() > GOD_NOT; | ||
6544 | } | 7084 | } |
6545 | 7085 | ||
6546 | #if 0 // 1.9.2 | 7086 | #if 0 // 1.9.2 |
@@ -7051,6 +7591,13 @@ class LLViewHighlightTransparent : public view_listener_t | |||
7051 | { | 7591 | { |
7052 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7592 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7053 | { | 7593 | { |
7594 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | ||
7595 | if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) | ||
7596 | { | ||
7597 | return true; | ||
7598 | } | ||
7599 | // [/RLVa:KB] | ||
7600 | |||
7054 | LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; | 7601 | LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; |
7055 | return true; | 7602 | return true; |
7056 | } | 7603 | } |
@@ -7098,6 +7645,13 @@ class LLViewShowHUDAttachments : public view_listener_t | |||
7098 | { | 7645 | { |
7099 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7646 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7100 | { | 7647 | { |
7648 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
7649 | if ( (LLPipeline::sShowHUDAttachments) && (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedHUD()) ) | ||
7650 | { | ||
7651 | return true; | ||
7652 | } | ||
7653 | // [/RLVa:KB] | ||
7654 | |||
7101 | LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; | 7655 | LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; |
7102 | return true; | 7656 | return true; |
7103 | } | 7657 | } |
@@ -7156,6 +7710,15 @@ class LLEditEnableTakeOff : public view_listener_t | |||
7156 | { | 7710 | { |
7157 | new_value = LLAgent::selfHasWearable((void *)WT_SKIRT); | 7711 | new_value = LLAgent::selfHasWearable((void *)WT_SKIRT); |
7158 | } | 7712 | } |
7713 | |||
7714 | // [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | ||
7715 | // Why aren't they using LLWearable::typeNameToType()? *confuzzled* | ||
7716 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isRemovable(LLWearable::typeNameToType(clothing))) ) | ||
7717 | { | ||
7718 | new_value = false; | ||
7719 | } | ||
7720 | // [/RLVa:KB] | ||
7721 | |||
7159 | gMenuHolder->findControl(control_name)->setValue(new_value); | 7722 | gMenuHolder->findControl(control_name)->setValue(new_value); |
7160 | return true; | 7723 | return true; |
7161 | } | 7724 | } |
@@ -7253,6 +7816,13 @@ class LLWorldEnvSettings : public view_listener_t | |||
7253 | { | 7816 | { |
7254 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7817 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7255 | { | 7818 | { |
7819 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
7820 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) | ||
7821 | { | ||
7822 | return true; | ||
7823 | } | ||
7824 | // [/RLVa:KB] | ||
7825 | |||
7256 | std::string tod = userdata.asString(); | 7826 | std::string tod = userdata.asString(); |
7257 | LLVector3 sun_direction; | 7827 | LLVector3 sun_direction; |
7258 | 7828 | ||
@@ -7330,6 +7900,13 @@ class LLWorldWaterSettings : public view_listener_t | |||
7330 | { | 7900 | { |
7331 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7901 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7332 | { | 7902 | { |
7903 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
7904 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) | ||
7905 | { | ||
7906 | return true; | ||
7907 | } | ||
7908 | // [/RLVa:KB] | ||
7909 | |||
7333 | // if not there or is hidden, show it | 7910 | // if not there or is hidden, show it |
7334 | if( !LLFloaterWater::isOpen() || | 7911 | if( !LLFloaterWater::isOpen() || |
7335 | !LLFloaterWater::instance()->getVisible()) { | 7912 | !LLFloaterWater::instance()->getVisible()) { |
@@ -7360,6 +7937,13 @@ class LLWorldDayCycle : public view_listener_t | |||
7360 | { | 7937 | { |
7361 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7938 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7362 | { | 7939 | { |
7940 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
7941 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) | ||
7942 | { | ||
7943 | return true; | ||
7944 | } | ||
7945 | // [/RLVa:KB] | ||
7946 | |||
7363 | LLFloaterDayCycle::show(); | 7947 | LLFloaterDayCycle::show(); |
7364 | return true; | 7948 | return true; |
7365 | } | 7949 | } |