diff options
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 800 |
1 files changed, 791 insertions, 9 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 36ffc21..e83bc2d 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -209,6 +209,7 @@ | |||
209 | #include "llwaterparammanager.h" | 209 | #include "llwaterparammanager.h" |
210 | 210 | ||
211 | #include "lltexlayer.h" | 211 | #include "lltexlayer.h" |
212 | #include "primbackup.h" | ||
212 | 213 | ||
213 | #include "jcfloater_animation_list.h" | 214 | #include "jcfloater_animation_list.h" |
214 | #include "llfloaterassetbrowser.h" | 215 | #include "llfloaterassetbrowser.h" |
@@ -222,6 +223,13 @@ void init_debug_ui_menu(LLMenuGL* menu); | |||
222 | void init_debug_xui_menu(LLMenuGL* menu); | 223 | void init_debug_xui_menu(LLMenuGL* menu); |
223 | void init_debug_avatar_menu(LLMenuGL* menu); | 224 | void init_debug_avatar_menu(LLMenuGL* menu); |
224 | void init_debug_baked_texture_menu(LLMenuGL* menu); | 225 | void init_debug_baked_texture_menu(LLMenuGL* menu); |
226 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
227 | #ifdef RLV_DEBUG_TESTS | ||
228 | #include "rlvtest.h" | ||
229 | #endif // RLV_DEBUG_TESTS | ||
230 | #include "rlvfloaterbehaviour.h" | ||
231 | void init_debug_rlva_menu(LLMenuGL* menu); | ||
232 | // [/RLVa:KB] | ||
225 | 233 | ||
226 | BOOL enable_land_build(void*); | 234 | BOOL enable_land_build(void*); |
227 | BOOL enable_object_build(void*); | 235 | BOOL enable_object_build(void*); |
@@ -828,6 +836,19 @@ void init_client_menu(LLMenuGL* menu) | |||
828 | init_debug_world_menu(sub_menu); | 836 | init_debug_world_menu(sub_menu); |
829 | menu->appendMenu(sub_menu); | 837 | menu->appendMenu(sub_menu); |
830 | 838 | ||
839 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1b | ||
840 | #ifdef RLV_ADVANCED_MENU | ||
841 | if (rlv_handler_t::isEnabled()) | ||
842 | { | ||
843 | sub_menu = new LLMenuGL("RLVa"); | ||
844 | init_debug_rlva_menu(sub_menu); | ||
845 | menu->appendMenu(sub_menu); | ||
846 | sub_menu->setVisible(rlv_handler_t::isEnabled()); | ||
847 | sub_menu->setEnabled(rlv_handler_t::isEnabled()); | ||
848 | } | ||
849 | #endif // RLV_ADVANCED_MENU | ||
850 | // [/RLVa:KB] | ||
851 | |||
831 | sub_menu = new LLMenuGL("UI"); | 852 | sub_menu = new LLMenuGL("UI"); |
832 | init_debug_ui_menu(sub_menu); | 853 | init_debug_ui_menu(sub_menu); |
833 | menu->appendMenu(sub_menu); | 854 | menu->appendMenu(sub_menu); |
@@ -922,6 +943,13 @@ void init_client_menu(LLMenuGL* menu) | |||
922 | &menu_check_control, | 943 | &menu_check_control, |
923 | (void*)"ShowConsoleWindow")); | 944 | (void*)"ShowConsoleWindow")); |
924 | 945 | ||
946 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e | ||
947 | #ifdef RLV_ADVANCED_TOGGLE_RLVA | ||
948 | if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) | ||
949 | menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvDbgToggleEnabled, NULL, &rlvDbgGetEnabled, NULL)); | ||
950 | #endif // RLV_ADVANCED_TOGGLE_RLVA | ||
951 | // [/RLVa:KB] | ||
952 | |||
925 | if(gSavedSettings.getBOOL("QAMode")) | 953 | if(gSavedSettings.getBOOL("QAMode")) |
926 | { | 954 | { |
927 | LLMenuGL* sub = NULL; | 955 | LLMenuGL* sub = NULL; |
@@ -1369,6 +1397,53 @@ void init_debug_baked_texture_menu(LLMenuGL* menu) | |||
1369 | menu->createJumpKeys(); | 1397 | menu->createJumpKeys(); |
1370 | } | 1398 | } |
1371 | 1399 | ||
1400 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g | ||
1401 | void init_debug_rlva_menu(LLMenuGL* menu) | ||
1402 | { | ||
1403 | // Experimental feature toggles | ||
1404 | { | ||
1405 | /* | ||
1406 | #ifdef RLV_EXPERIMENTAL | ||
1407 | LLMenuGL* sub_menu = new LLMenuGL("Experimental"); | ||
1408 | |||
1409 | menu->appendMenu(sub_menu); | ||
1410 | #endif // RLV_EXPERIMENTAL | ||
1411 | */ | ||
1412 | } | ||
1413 | |||
1414 | // Unit tests | ||
1415 | { | ||
1416 | #ifdef RLV_DEBUG_TESTS | ||
1417 | init_debug_rlva_tests_menu(menu); | ||
1418 | #endif // RLV_DEBUG_TESTS | ||
1419 | } | ||
1420 | |||
1421 | #ifdef RLV_EXTENSION_ENABLE_WEAR | ||
1422 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) | ||
1423 | { | ||
1424 | menu->append(new LLMenuItemCheckGL("Enable Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); | ||
1425 | menu->appendSeparator(); | ||
1426 | } | ||
1427 | #endif // RLV_EXTENSION_ENABLE_WEAR | ||
1428 | |||
1429 | #ifdef RLV_EXTENSION_HIDELOCKED | ||
1430 | if ( (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDLAYER)) && | ||
1431 | (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDATTACH)) ) | ||
1432 | { | ||
1433 | menu->append(new LLMenuItemCheckGL("Hide locked layers", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDLAYER)); | ||
1434 | menu->append(new LLMenuItemCheckGL("Hide locked attachments", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDATTACH)); | ||
1435 | //sub_menu->append(new LLMenuItemToggleGL("Hide locked inventory", &rlv_handler_t::fHideLockedInventory)); | ||
1436 | menu->appendSeparator(); | ||
1437 | } | ||
1438 | #endif // RLV_EXTENSION_HIDELOCKED | ||
1439 | |||
1440 | #ifdef RLV_EXTENSION_FLOATER_RESTRICTIONS | ||
1441 | // TODO-RLVa: figure out a way to tell if floater_rlv_behaviour.xml exists | ||
1442 | menu->append(new LLMenuItemCallGL("Restrictions...", RlvFloaterBehaviour::show, NULL, NULL)); | ||
1443 | #endif // RLV_EXTENSION_FLOATER_RESTRICTIONS | ||
1444 | } | ||
1445 | // [/RLVa:KB] | ||
1446 | |||
1372 | void init_server_menu(LLMenuGL* menu) | 1447 | void init_server_menu(LLMenuGL* menu) |
1373 | { | 1448 | { |
1374 | { | 1449 | { |
@@ -1521,6 +1596,16 @@ class LLObjectTouch : public view_listener_t | |||
1521 | 1596 | ||
1522 | LLPickInfo pick = LLToolPie::getInstance()->getPick(); | 1597 | LLPickInfo pick = LLToolPie::getInstance()->getPick(); |
1523 | 1598 | ||
1599 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f | ||
1600 | // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for | ||
1601 | // [msg->addVector3("Position", pick.mIntersection) <- see llDetectedTouchPos()] | ||
1602 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) && | ||
1603 | (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f) ) | ||
1604 | { | ||
1605 | return true; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n | ||
1606 | } | ||
1607 | // [/RLVa:KB] | ||
1608 | |||
1524 | LLMessageSystem *msg = gMessageSystem; | 1609 | LLMessageSystem *msg = gMessageSystem; |
1525 | 1610 | ||
1526 | msg->newMessageFast(_PREHASH_ObjectGrab); | 1611 | msg->newMessageFast(_PREHASH_ObjectGrab); |
@@ -1569,6 +1654,14 @@ class LLObjectEnableTouch : public view_listener_t | |||
1569 | { | 1654 | { |
1570 | LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | 1655 | LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); |
1571 | bool new_value = obj && obj->flagHandleTouch(); | 1656 | bool new_value = obj && obj->flagHandleTouch(); |
1657 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f | ||
1658 | // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for | ||
1659 | if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!obj->isAttachment()) || (!obj->permYouOwner())) && | ||
1660 | (dist_vec_squared(gAgent.getPositionAgent(), LLToolPie::getInstance()->getPick().mIntersection) > 1.5f * 1.5f) ) | ||
1661 | { | ||
1662 | new_value = false; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n | ||
1663 | } | ||
1664 | // [/RLVa:KB] | ||
1572 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 1665 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
1573 | 1666 | ||
1574 | // Update label based on the node touch name if available. | 1667 | // Update label based on the node touch name if available. |
@@ -1637,6 +1730,14 @@ class LLObjectOpen : public view_listener_t | |||
1637 | { | 1730 | { |
1638 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 1731 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
1639 | { | 1732 | { |
1733 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | ||
1734 | // TODO-RLVa: shouldn't we be checking for fartouch here as well? | ||
1735 | if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) | ||
1736 | { | ||
1737 | return true; | ||
1738 | } | ||
1739 | // [/RLVa:KB] | ||
1740 | |||
1640 | return handle_object_open(); | 1741 | return handle_object_open(); |
1641 | } | 1742 | } |
1642 | }; | 1743 | }; |
@@ -1655,6 +1756,12 @@ class LLObjectEnableOpen : public view_listener_t | |||
1655 | if (!root) new_value = false; | 1756 | if (!root) new_value = false; |
1656 | else new_value = root->allowOpen(); | 1757 | else new_value = root->allowOpen(); |
1657 | } | 1758 | } |
1759 | |||
1760 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | Modified: RLVa-1.0.0b | ||
1761 | // TODO-RLV: shouldn't we be checking for fartouch here as well? (and LLViewerObject::allowOpen() makes this redundant?) | ||
1762 | new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_EDIT); | ||
1763 | // [/RLVa:KB] | ||
1764 | |||
1658 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 1765 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
1659 | return true; | 1766 | return true; |
1660 | } | 1767 | } |
@@ -1716,7 +1823,13 @@ bool toggle_build_mode() | |||
1716 | } | 1823 | } |
1717 | } | 1824 | } |
1718 | 1825 | ||
1719 | 1826 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | |
1827 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (LLSelectMgr::getInstance()) ) | ||
1828 | { | ||
1829 | LLSelectMgr::getInstance()->deselectAll(); | ||
1830 | } | ||
1831 | // [/RLVa:KB] | ||
1832 | |||
1720 | LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); | 1833 | LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); |
1721 | LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); | 1834 | LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); |
1722 | 1835 | ||
@@ -1816,6 +1929,23 @@ class LLObjectEdit : public view_listener_t | |||
1816 | { | 1929 | { |
1817 | LLViewerParcelMgr::getInstance()->deselectLand(); | 1930 | LLViewerParcelMgr::getInstance()->deselectLand(); |
1818 | 1931 | ||
1932 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f | ||
1933 | if (rlv_handler_t::isEnabled()) | ||
1934 | { | ||
1935 | if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) | ||
1936 | { | ||
1937 | return true; // Can't edit any object under @edit=n | ||
1938 | } | ||
1939 | else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && | ||
1940 | (SELECT_TYPE_WORLD == LLSelectMgr::getInstance()->getSelection()->getSelectType()) && | ||
1941 | (dist_vec_squared(gAgent.getPositionAgent(), LLToolPie::getInstance()->getPick().mIntersection) > 1.5f * 1.5f) ) | ||
1942 | { | ||
1943 | // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for | ||
1944 | return true; // Can't edit in-world objects farther than 1.5m away under @fartouch=n | ||
1945 | } | ||
1946 | } | ||
1947 | // [/RLVa:KB] | ||
1948 | |||
1819 | if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) | 1949 | if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) |
1820 | { | 1950 | { |
1821 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); | 1951 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); |
@@ -1965,6 +2095,22 @@ class LLEnableEdit : public view_listener_t | |||
1965 | enable = LLViewerParcelMgr::getInstance()->agentCanBuild() | 2095 | enable = LLViewerParcelMgr::getInstance()->agentCanBuild() |
1966 | || LLSelectMgr::getInstance()->getSelection()->isAttachment(); | 2096 | || LLSelectMgr::getInstance()->getSelection()->isAttachment(); |
1967 | } | 2097 | } |
2098 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
2099 | // TODO-RLV: include fartouch here? | ||
2100 | if ( (rlv_handler_t::isEnabled()) && (enable) ) | ||
2101 | { | ||
2102 | // We have no way of knowing whether we're being called for "Create" or for "Edit", but we can | ||
2103 | // make an educated guess based on the currently active selection which puts us halfway there. | ||
2104 | BOOL fActiveSelection = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); | ||
2105 | |||
2106 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) | ||
2107 | enable = false; // Edit and rez restricted, disable them both | ||
2108 | else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (fActiveSelection) ) | ||
2109 | enable = false; // Edit restricted and there's an active selection => disable Edit and Create | ||
2110 | else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && (!fActiveSelection) ) | ||
2111 | enable = false; // Rez restricted and there's no active selection => disable Create | ||
2112 | } | ||
2113 | // [/RLVa:KB] | ||
1968 | gMenuHolder->findControl(userdata["control"].asString())->setValue(enable); | 2114 | gMenuHolder->findControl(userdata["control"].asString())->setValue(enable); |
1969 | return true; | 2115 | return true; |
1970 | } | 2116 | } |
@@ -1992,7 +2138,10 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t | |||
1992 | { | 2138 | { |
1993 | LLVOAvatar::attachment_map_t::iterator curiter = iter++; | 2139 | LLVOAvatar::attachment_map_t::iterator curiter = iter++; |
1994 | LLViewerJointAttachment* attachment = curiter->second; | 2140 | LLViewerJointAttachment* attachment = curiter->second; |
1995 | if (attachment->getObject()) | 2141 | // if (attachment->getObject()) |
2142 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0c | ||
2143 | if ( (attachment->getObject()) && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(curiter->first)) ) ) | ||
2144 | // [/RLVa:KB] | ||
1996 | { | 2145 | { |
1997 | new_value = true; | 2146 | new_value = true; |
1998 | break; | 2147 | break; |
@@ -2039,6 +2188,9 @@ class LLObjectEnableMute : public view_listener_t | |||
2039 | BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); | 2188 | BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); |
2040 | BOOL is_self = avatar->isSelf(); | 2189 | BOOL is_self = avatar->isSelf(); |
2041 | new_value = !is_linden && !is_self; | 2190 | new_value = !is_linden && !is_self; |
2191 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
2192 | new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); | ||
2193 | // [/RLVa:KB] | ||
2042 | } | 2194 | } |
2043 | } | 2195 | } |
2044 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 2196 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
@@ -2059,6 +2211,12 @@ class LLObjectMute : public view_listener_t | |||
2059 | LLVOAvatar* avatar = find_avatar_from_object(object); | 2211 | LLVOAvatar* avatar = find_avatar_from_object(object); |
2060 | if (avatar) | 2212 | if (avatar) |
2061 | { | 2213 | { |
2214 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-1.0.0e | ||
2215 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
2216 | { | ||
2217 | return true; // Fallback code [see LLObjectEnableMute::handleEvent()] | ||
2218 | } | ||
2219 | // [/RLVa:KB] | ||
2062 | id = avatar->getID(); | 2220 | id = avatar->getID(); |
2063 | 2221 | ||
2064 | LLNameValue *firstname = avatar->getNVPair("FirstName"); | 2222 | LLNameValue *firstname = avatar->getNVPair("FirstName"); |
@@ -2107,8 +2265,155 @@ class LLObjectMute : public view_listener_t | |||
2107 | } | 2265 | } |
2108 | }; | 2266 | }; |
2109 | 2267 | ||
2268 | class LLObjectEnableCopyUUID : public view_listener_t | ||
2269 | { | ||
2270 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2271 | { | ||
2272 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); | ||
2273 | bool new_value = (object != NULL); | ||
2274 | |||
2275 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
2276 | return true; | ||
2277 | } | ||
2278 | }; | ||
2279 | |||
2280 | class LLObjectCopyUUID : public view_listener_t | ||
2281 | { | ||
2282 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2283 | { | ||
2284 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); | ||
2285 | if (!object) return true; | ||
2286 | |||
2287 | LLUUID id = object->getID(); | ||
2288 | |||
2289 | char buffer[UUID_STR_LENGTH]; | ||
2290 | id.toString(buffer); | ||
2291 | |||
2292 | |||
2293 | gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer)); | ||
2294 | |||
2295 | LLSelectMgr::getInstance()->deselectAll(); | ||
2296 | return true; | ||
2297 | } | ||
2298 | }; | ||
2299 | |||
2300 | |||
2301 | class LLObjectEnableExport : public view_listener_t | ||
2302 | { | ||
2303 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2304 | { | ||
2305 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | ||
2306 | bool new_value = (object != NULL); | ||
2307 | if (new_value) | ||
2308 | { | ||
2309 | LLVOAvatar* avatar = find_avatar_from_object(object); | ||
2310 | new_value = (avatar == NULL); | ||
2311 | } | ||
2312 | if(new_value) | ||
2313 | { | ||
2314 | |||
2315 | struct ff : public LLSelectedNodeFunctor | ||
2316 | { | ||
2317 | ff(const LLSD& data) : LLSelectedNodeFunctor() | ||
2318 | ,userdata(data) | ||
2319 | { | ||
2320 | |||
2321 | } | ||
2322 | const LLSD& userdata; | ||
2323 | virtual bool apply(LLSelectNode* node) | ||
2324 | { | ||
2325 | if(gAgent.getID()!=node->mPermissions->getCreator()) | ||
2326 | { | ||
2327 | llwarns<<"Incorrect permission to export"<<llendl; | ||
2328 | return false; | ||
2329 | } | ||
2330 | return true; | ||
2331 | } | ||
2332 | }; | ||
2333 | |||
2334 | #ifdef LL_GRID_PERMISSIONS | ||
2335 | |||
2336 | ff * the_ff=new ff(userdata); | ||
2337 | if(LLSelectMgr::getInstance()->getSelection()->applyToNodes(the_ff,false)) | ||
2338 | { | ||
2339 | gMenuHolder->findControl(userdata["control"].asString())->setValue(true); | ||
2340 | } | ||
2341 | else | ||
2342 | { | ||
2343 | gMenuHolder->findControl(userdata["control"].asString())->setValue(false); | ||
2344 | } | ||
2345 | return true; | ||
2346 | } | ||
2347 | |||
2348 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
2349 | return true; | ||
2350 | #else | ||
2351 | } | ||
2352 | gMenuHolder->findControl(userdata["control"].asString())->setValue(true); | ||
2353 | return true; | ||
2354 | #endif | ||
2355 | |||
2356 | } | ||
2357 | }; | ||
2358 | |||
2359 | class LLObjectExport : public view_listener_t | ||
2360 | { | ||
2361 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2362 | { | ||
2363 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | ||
2364 | if (!object) return true; | ||
2365 | |||
2366 | LLVOAvatar* avatar = find_avatar_from_object(object); | ||
2367 | |||
2368 | if (!avatar) | ||
2369 | { | ||
2370 | primbackup::getInstance()->pre_export_object(); | ||
2371 | } | ||
2372 | |||
2373 | return true; | ||
2374 | } | ||
2375 | }; | ||
2376 | |||
2377 | |||
2378 | class LLObjectEnableImport : public view_listener_t | ||
2379 | { | ||
2380 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2381 | { | ||
2382 | gMenuHolder->findControl(userdata["control"].asString())->setValue(TRUE); | ||
2383 | return true; | ||
2384 | } | ||
2385 | }; | ||
2386 | |||
2387 | class LLObjectImport : public view_listener_t | ||
2388 | { | ||
2389 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2390 | { | ||
2391 | primbackup::getInstance()->import_object(FALSE); | ||
2392 | return true; | ||
2393 | } | ||
2394 | }; | ||
2395 | |||
2396 | class LLObjectImportUpload : public view_listener_t | ||
2397 | { | ||
2398 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2399 | { | ||
2400 | primbackup::getInstance()->import_object(TRUE); | ||
2401 | return true; | ||
2402 | } | ||
2403 | }; | ||
2404 | |||
2110 | bool handle_go_to() | 2405 | bool handle_go_to() |
2111 | { | 2406 | { |
2407 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
2408 | if ( (rlv_handler_t::isEnabled()) && gAgent.forwardGrabbed() && (gRlvHandler.hasLockedAttachment()) ) | ||
2409 | { | ||
2410 | return true; | ||
2411 | } | ||
2412 | // [/RLVa:KB] | ||
2413 | |||
2414 | // JAMESDEBUG try simulator autopilot | ||
2415 | std::vector<std::string> strings; | ||
2416 | std::string val; | ||
2112 | LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; | 2417 | LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; |
2113 | if (gSavedSettings.getBOOL("DoubleClickTeleport")) | 2418 | if (gSavedSettings.getBOOL("DoubleClickTeleport")) |
2114 | { | 2419 | { |
@@ -2200,6 +2505,12 @@ class LLAvatarFreeze : public view_listener_t | |||
2200 | { | 2505 | { |
2201 | LLUUID* avatar_id = new LLUUID( avatar->getID() ); | 2506 | LLUUID* avatar_id = new LLUUID( avatar->getID() ); |
2202 | std::string fullname = avatar->getFullname(); | 2507 | std::string fullname = avatar->getFullname(); |
2508 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | ||
2509 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) | ||
2510 | { | ||
2511 | fullname = gRlvHandler.getAnonym(fullname); | ||
2512 | } | ||
2513 | // [/RLVa:KB] | ||
2203 | 2514 | ||
2204 | if (!fullname.empty()) | 2515 | if (!fullname.empty()) |
2205 | { | 2516 | { |
@@ -2225,7 +2536,11 @@ class LLAvatarVisibleDebug : public view_listener_t | |||
2225 | { | 2536 | { |
2226 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2537 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2227 | { | 2538 | { |
2228 | bool new_value = gAgent.isGodlike(); | 2539 | //bool new_value = gAgent.isGodlike(); |
2540 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
2541 | // TODO-RLVa: can you actually use this to cheat anything? | ||
2542 | bool new_value = gAgent.isGodlike() && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); | ||
2543 | // [/RLVa:KB] | ||
2229 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 2544 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
2230 | return true; | 2545 | return true; |
2231 | } | 2546 | } |
@@ -2337,6 +2652,12 @@ class LLAvatarEject : public view_listener_t | |||
2337 | MenuCallbackData *data = new MenuCallbackData; | 2652 | MenuCallbackData *data = new MenuCallbackData; |
2338 | (*data).avatar_id = avatar->getID(); | 2653 | (*data).avatar_id = avatar->getID(); |
2339 | std::string fullname = avatar->getFullname(); | 2654 | std::string fullname = avatar->getFullname(); |
2655 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | ||
2656 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) | ||
2657 | { | ||
2658 | fullname = gRlvHandler.getAnonym(fullname); | ||
2659 | } | ||
2660 | // [/RLVa:KB] | ||
2340 | 2661 | ||
2341 | const LLVector3d& pos = avatar->getPositionGlobal(); | 2662 | const LLVector3d& pos = avatar->getPositionGlobal(); |
2342 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel(); | 2663 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel(); |
@@ -2418,6 +2739,13 @@ class LLAvatarGiveCard : public view_listener_t | |||
2418 | { | 2739 | { |
2419 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2740 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2420 | { | 2741 | { |
2742 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
2743 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
2744 | { | ||
2745 | return true; | ||
2746 | } | ||
2747 | // [/RLVa:KB] | ||
2748 | |||
2421 | llinfos << "handle_give_card()" << llendl; | 2749 | llinfos << "handle_give_card()" << llendl; |
2422 | LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | 2750 | LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); |
2423 | if(dest && dest->isAvatar()) | 2751 | if(dest && dest->isAvatar()) |
@@ -2667,6 +2995,13 @@ class LLSelfStandUp : public view_listener_t | |||
2667 | { | 2995 | { |
2668 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2996 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2669 | { | 2997 | { |
2998 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
2999 | if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) | ||
3000 | { | ||
3001 | return true; | ||
3002 | } | ||
3003 | // [/RLVa:KB] | ||
3004 | |||
2670 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); | 3005 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); |
2671 | return true; | 3006 | return true; |
2672 | } | 3007 | } |
@@ -2676,7 +3011,10 @@ class LLSelfEnableStandUp : public view_listener_t | |||
2676 | { | 3011 | { |
2677 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3012 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2678 | { | 3013 | { |
2679 | bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting; | 3014 | // bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting; |
3015 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
3016 | bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT); | ||
3017 | // [/RLVa:KB] | ||
2680 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 3018 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
2681 | return true; | 3019 | return true; |
2682 | } | 3020 | } |
@@ -2851,6 +3189,11 @@ class LLAvatarEnableAddFriend : public view_listener_t | |||
2851 | { | 3189 | { |
2852 | LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); | 3190 | LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); |
2853 | bool new_value = avatar && !is_agent_friend(avatar->getID()); | 3191 | bool new_value = avatar && !is_agent_friend(avatar->getID()); |
3192 | |||
3193 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
3194 | new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); | ||
3195 | // [/RLVa:KB] | ||
3196 | |||
2854 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 3197 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
2855 | return true; | 3198 | return true; |
2856 | } | 3199 | } |
@@ -2909,6 +3252,15 @@ bool handle_sit_or_stand() | |||
2909 | return true; | 3252 | return true; |
2910 | } | 3253 | } |
2911 | 3254 | ||
3255 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0c) | ||
3256 | if ( (rlv_handler_t::isEnabled()) && | ||
3257 | ( ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting)) || | ||
3258 | (gRlvHandler.hasBehaviour(RLV_BHVR_SIT)) ) ) | ||
3259 | { | ||
3260 | return true; | ||
3261 | } | ||
3262 | // [/RLVa:KB] | ||
3263 | |||
2912 | if (sitting_on_selection()) | 3264 | if (sitting_on_selection()) |
2913 | { | 3265 | { |
2914 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); | 3266 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); |
@@ -2919,6 +3271,15 @@ bool handle_sit_or_stand() | |||
2919 | 3271 | ||
2920 | if (object && object->getPCode() == LL_PCODE_VOLUME) | 3272 | if (object && object->getPCode() == LL_PCODE_VOLUME) |
2921 | { | 3273 | { |
3274 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g | ||
3275 | if ( (rlv_handler_t::isEnabled()) && | ||
3276 | ((gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) || (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && | ||
3277 | (dist_vec_squared(gAgent.getPositionGlobal(), object->getPositionGlobal() + LLVector3d(pick.mObjectOffset)) > 1.5f * 1.5f) ) | ||
3278 | { | ||
3279 | return true; // Don't allow sitting farther away than 1.5m under @sittp=n or @fartouch=n | ||
3280 | } | ||
3281 | // [/RLVa:KB] | ||
3282 | |||
2922 | gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); | 3283 | gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); |
2923 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); | 3284 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); |
2924 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | 3285 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); |
@@ -2956,6 +3317,13 @@ class LLLandSit : public view_listener_t | |||
2956 | { | 3317 | { |
2957 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3318 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2958 | { | 3319 | { |
3320 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
3321 | if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) | ||
3322 | { | ||
3323 | return true; | ||
3324 | } | ||
3325 | // [/RLVa:KB] | ||
3326 | |||
2959 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); | 3327 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); |
2960 | LLViewerParcelMgr::getInstance()->deselectLand(); | 3328 | LLViewerParcelMgr::getInstance()->deselectLand(); |
2961 | 3329 | ||
@@ -3266,6 +3634,14 @@ class LLEditDuplicate : public view_listener_t | |||
3266 | { | 3634 | { |
3267 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3635 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3268 | { | 3636 | { |
3637 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
3638 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && | ||
3639 | (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) | ||
3640 | { | ||
3641 | return true; | ||
3642 | } | ||
3643 | // [/RLVa:KB] | ||
3644 | |||
3269 | if(LLEditMenuHandler::gEditMenuHandler) | 3645 | if(LLEditMenuHandler::gEditMenuHandler) |
3270 | { | 3646 | { |
3271 | LLEditMenuHandler::gEditMenuHandler->duplicate(); | 3647 | LLEditMenuHandler::gEditMenuHandler->duplicate(); |
@@ -3279,6 +3655,13 @@ class LLEditEnableDuplicate : public view_listener_t | |||
3279 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3655 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3280 | { | 3656 | { |
3281 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDuplicate(); | 3657 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDuplicate(); |
3658 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
3659 | if ( (new_value) && (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && | ||
3660 | (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) | ||
3661 | { | ||
3662 | new_value = false; | ||
3663 | } | ||
3664 | // [/RLVa:KB] | ||
3282 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 3665 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
3283 | return true; | 3666 | return true; |
3284 | } | 3667 | } |
@@ -3664,6 +4047,11 @@ class LLToolsTakeCopy : public view_listener_t | |||
3664 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4047 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3665 | { | 4048 | { |
3666 | if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; | 4049 | if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; |
4050 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | Modified: RLVa-1.0.0b | ||
4051 | // NOTE: we need to handle "Take Copy" because it will force a sim-side unsit if we're sitting on the selection, | ||
4052 | // but we do want to allow "Take Copy" under @rez=n so that's why we explicitly check for @unsit=n here | ||
4053 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (!rlvCanDeleteOrReturn()) ) return true; | ||
4054 | // [/RLVa:KB] | ||
3667 | 4055 | ||
3668 | const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); | 4056 | const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); |
3669 | derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); | 4057 | derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); |
@@ -3679,6 +4067,9 @@ class LLObjectReturn : public view_listener_t | |||
3679 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4067 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3680 | { | 4068 | { |
3681 | if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; | 4069 | if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; |
4070 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4071 | if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) return true; | ||
4072 | // [/RLVa:KB] | ||
3682 | 4073 | ||
3683 | mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); | 4074 | mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); |
3684 | 4075 | ||
@@ -3748,6 +4139,14 @@ class LLObjectEnableReturn : public view_listener_t | |||
3748 | } | 4139 | } |
3749 | } | 4140 | } |
3750 | #endif | 4141 | #endif |
4142 | |||
4143 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4144 | if ( (new_value) && (rlv_handler_t::isEnabled()) ) | ||
4145 | { | ||
4146 | new_value = rlvCanDeleteOrReturn(); | ||
4147 | } | ||
4148 | // [/RLVa:KB] | ||
4149 | |||
3751 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4150 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
3752 | return true; | 4151 | return true; |
3753 | } | 4152 | } |
@@ -3769,6 +4168,13 @@ void handle_take() | |||
3769 | return; | 4168 | return; |
3770 | } | 4169 | } |
3771 | 4170 | ||
4171 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4172 | if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) | ||
4173 | { | ||
4174 | return; | ||
4175 | } | ||
4176 | // [/RLVa:KB] | ||
4177 | |||
3772 | BOOL you_own_everything = TRUE; | 4178 | BOOL you_own_everything = TRUE; |
3773 | BOOL locked_but_takeable_object = FALSE; | 4179 | BOOL locked_but_takeable_object = FALSE; |
3774 | LLUUID category_id; | 4180 | LLUUID category_id; |
@@ -3890,6 +4296,13 @@ BOOL enable_take() | |||
3890 | return FALSE; | 4296 | return FALSE; |
3891 | } | 4297 | } |
3892 | 4298 | ||
4299 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4300 | if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) | ||
4301 | { | ||
4302 | return FALSE; | ||
4303 | } | ||
4304 | // [/RLVa:KB] | ||
4305 | |||
3893 | for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); | 4306 | for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); |
3894 | iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) | 4307 | iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) |
3895 | { | 4308 | { |
@@ -4211,6 +4624,21 @@ class LLToolsEnableUnlink : public view_listener_t | |||
4211 | new_value = true; | 4624 | new_value = true; |
4212 | } | 4625 | } |
4213 | } | 4626 | } |
4627 | |||
4628 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g | ||
4629 | // The user might not be allowed to unlink this object due to RLV settings, | ||
4630 | // because it would unsit them if they are sitting on the object. | ||
4631 | if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && | ||
4632 | (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) | ||
4633 | { | ||
4634 | // Allow if the avie isn't sitting on any of the selected objects | ||
4635 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); | ||
4636 | RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); | ||
4637 | if (handleSel->getFirstRootNode(&func, TRUE)) | ||
4638 | new_value = false; | ||
4639 | } | ||
4640 | // [/RLVa:KB] | ||
4641 | |||
4214 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4642 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4215 | return true; | 4643 | return true; |
4216 | } | 4644 | } |
@@ -4220,6 +4648,19 @@ class LLToolsUnlink : public view_listener_t | |||
4220 | { | 4648 | { |
4221 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4649 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4222 | { | 4650 | { |
4651 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g | ||
4652 | // The user might not be allowed to unlink this object due to RLV settings, | ||
4653 | // because it would unsit them if they are sitting on the object. | ||
4654 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) | ||
4655 | { | ||
4656 | // Allow if the avie isn't sitting on any of the selected objects | ||
4657 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); | ||
4658 | RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); | ||
4659 | if (handleSel->getFirstRootNode(&func, TRUE)) | ||
4660 | return true; | ||
4661 | } | ||
4662 | // [/RLVa:KB] | ||
4663 | |||
4223 | LLSelectMgr::getInstance()->sendDelink(); | 4664 | LLSelectMgr::getInstance()->sendDelink(); |
4224 | return true; | 4665 | return true; |
4225 | } | 4666 | } |
@@ -4239,6 +4680,13 @@ class LLToolsReleaseKeys : public view_listener_t | |||
4239 | { | 4680 | { |
4240 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4681 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4241 | { | 4682 | { |
4683 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
4684 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
4685 | { | ||
4686 | return true; | ||
4687 | } | ||
4688 | // [/RLVa:KB] | ||
4689 | |||
4242 | gAgent.forceReleaseControls(); | 4690 | gAgent.forceReleaseControls(); |
4243 | 4691 | ||
4244 | return true; | 4692 | return true; |
@@ -4249,7 +4697,11 @@ class LLToolsEnableReleaseKeys : public view_listener_t | |||
4249 | { | 4697 | { |
4250 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4698 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4251 | { | 4699 | { |
4252 | gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); | 4700 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) |
4701 | gMenuHolder->findControl(userdata["control"].asString())->setValue( | ||
4702 | gAgent.anyControlGrabbed() && ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment() ) ) ); | ||
4703 | // [/RLVa:KB] | ||
4704 | //gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); | ||
4253 | return true; | 4705 | return true; |
4254 | } | 4706 | } |
4255 | }; | 4707 | }; |
@@ -4357,6 +4809,15 @@ class LLEditEnableDelete : public view_listener_t | |||
4357 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4809 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4358 | { | 4810 | { |
4359 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); | 4811 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); |
4812 | |||
4813 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4814 | // NOTE: we want to disable delete on objects but not disable delete on text | ||
4815 | if ( (new_value) && (rlv_handler_t::isEnabled()) && (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) | ||
4816 | { | ||
4817 | new_value = rlvCanDeleteOrReturn(); | ||
4818 | } | ||
4819 | // [/RLVa:KB] | ||
4820 | |||
4360 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4821 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4361 | return true; | 4822 | return true; |
4362 | } | 4823 | } |
@@ -4366,6 +4827,15 @@ class LLEditDelete : public view_listener_t | |||
4366 | { | 4827 | { |
4367 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4828 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4368 | { | 4829 | { |
4830 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4831 | // NOTE: we want to disable delete on objects but not disable delete on text | ||
4832 | if ( (rlv_handler_t::isEnabled()) && (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) && | ||
4833 | (!rlvCanDeleteOrReturn()) ) | ||
4834 | { | ||
4835 | return true; | ||
4836 | } | ||
4837 | // [/RLVa:KB] | ||
4838 | |||
4369 | // If a text field can do a deletion, it gets precedence over deleting | 4839 | // If a text field can do a deletion, it gets precedence over deleting |
4370 | // an object in the world. | 4840 | // an object in the world. |
4371 | if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) | 4841 | if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) |
@@ -4397,6 +4867,12 @@ class LLObjectEnableDelete : public view_listener_t | |||
4397 | # endif | 4867 | # endif |
4398 | LLSelectMgr::getInstance()->canDoDelete(); | 4868 | LLSelectMgr::getInstance()->canDoDelete(); |
4399 | #endif | 4869 | #endif |
4870 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4871 | if ( (new_value) && (rlv_handler_t::isEnabled()) ) | ||
4872 | { | ||
4873 | new_value = rlvCanDeleteOrReturn(); | ||
4874 | } | ||
4875 | // [/RLVa:KB] | ||
4400 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4876 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4401 | return true; | 4877 | return true; |
4402 | } | 4878 | } |
@@ -4415,6 +4891,13 @@ class LLObjectDelete : public view_listener_t | |||
4415 | { | 4891 | { |
4416 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4892 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4417 | { | 4893 | { |
4894 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4895 | if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) | ||
4896 | { | ||
4897 | return true; | ||
4898 | } | ||
4899 | // [/RLVa:KB] | ||
4900 | |||
4418 | if (LLSelectMgr::getInstance()) | 4901 | if (LLSelectMgr::getInstance()) |
4419 | { | 4902 | { |
4420 | LLSelectMgr::getInstance()->doDelete(); | 4903 | LLSelectMgr::getInstance()->doDelete(); |
@@ -4764,6 +5247,12 @@ class LLWorldCreateLandmark : public view_listener_t | |||
4764 | { | 5247 | { |
4765 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5248 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4766 | { | 5249 | { |
5250 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | ||
5251 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) | ||
5252 | { | ||
5253 | return true; | ||
5254 | } | ||
5255 | // [/RLVa:KB] | ||
4767 | LLViewerRegion* agent_region = gAgent.getRegion(); | 5256 | LLViewerRegion* agent_region = gAgent.getRegion(); |
4768 | if(!agent_region) | 5257 | if(!agent_region) |
4769 | { | 5258 | { |
@@ -4871,6 +5360,13 @@ class LLAvatarInviteToGroup : public view_listener_t | |||
4871 | { | 5360 | { |
4872 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5361 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4873 | { | 5362 | { |
5363 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5364 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
5365 | { | ||
5366 | return true; | ||
5367 | } | ||
5368 | // [/RLVa:KB] | ||
5369 | |||
4874 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); | 5370 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); |
4875 | if(avatar) | 5371 | if(avatar) |
4876 | { | 5372 | { |
@@ -4884,6 +5380,13 @@ class LLAvatarAddFriend : public view_listener_t | |||
4884 | { | 5380 | { |
4885 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5381 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4886 | { | 5382 | { |
5383 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5384 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
5385 | { | ||
5386 | return true; // Fallback code [see LLAvatarEnableAddFriend::handleEvent()] | ||
5387 | } | ||
5388 | // [/RLVa:KB] | ||
5389 | |||
4887 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); | 5390 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); |
4888 | if(avatar && !is_agent_friend(avatar->getID())) | 5391 | if(avatar && !is_agent_friend(avatar->getID())) |
4889 | { | 5392 | { |
@@ -4971,6 +5474,12 @@ class LLEnablePayObject : public view_listener_t | |||
4971 | } | 5474 | } |
4972 | } | 5475 | } |
4973 | } | 5476 | } |
5477 | |||
5478 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5479 | // Don't enable "Pay..." on the avatar pie menu under @shownames=n | ||
5480 | new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (avatar == NULL); | ||
5481 | // [/RLVa:KB] | ||
5482 | |||
4974 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 5483 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4975 | return true; | 5484 | return true; |
4976 | } | 5485 | } |
@@ -5159,6 +5668,12 @@ class LLShowFloater : public view_listener_t | |||
5159 | } | 5668 | } |
5160 | else if (floater_name == "buy land") | 5669 | else if (floater_name == "buy land") |
5161 | { | 5670 | { |
5671 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | ||
5672 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) | ||
5673 | { | ||
5674 | return true; | ||
5675 | } | ||
5676 | // [/RLVa:KB] | ||
5162 | if (LLViewerParcelMgr::getInstance()->selectionEmpty()) | 5677 | if (LLViewerParcelMgr::getInstance()->selectionEmpty()) |
5163 | { | 5678 | { |
5164 | LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); | 5679 | LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); |
@@ -5340,6 +5855,13 @@ class LLShowAgentProfile : public view_listener_t | |||
5340 | } | 5855 | } |
5341 | else if (userdata.asString() == "hit object") | 5856 | else if (userdata.asString() == "hit object") |
5342 | { | 5857 | { |
5858 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5859 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
5860 | { | ||
5861 | return true; | ||
5862 | } | ||
5863 | // [/RLVa:KB] | ||
5864 | |||
5343 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | 5865 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); |
5344 | if (objectp) | 5866 | if (objectp) |
5345 | { | 5867 | { |
@@ -5399,6 +5921,13 @@ class LLLandEdit : public view_listener_t | |||
5399 | { | 5921 | { |
5400 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5922 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5401 | { | 5923 | { |
5924 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | ||
5925 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) ) | ||
5926 | { | ||
5927 | return true; | ||
5928 | } | ||
5929 | // [/RLVa:KB] | ||
5930 | |||
5402 | if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) | 5931 | if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) |
5403 | { | 5932 | { |
5404 | // zoom in if we're looking at the avatar | 5933 | // zoom in if we're looking at the avatar |
@@ -5483,6 +6012,18 @@ private: | |||
5483 | LLViewerJointAttachment* attachment_point = NULL; | 6012 | LLViewerJointAttachment* attachment_point = NULL; |
5484 | if (index > 0) | 6013 | if (index > 0) |
5485 | attachment_point = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); | 6014 | attachment_point = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); |
6015 | |||
6016 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6017 | if ( (rlv_handler_t::isEnabled()) && | ||
6018 | ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point | ||
6019 | ((index > 0) && (!gRlvHandler.isDetachable(attachment_point->getObject()))) || // Can't replace locked attachment | ||
6020 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" | ||
6021 | { | ||
6022 | setObjectSelection(NULL); // Clear the selection or it'll get stuck | ||
6023 | return true; | ||
6024 | } | ||
6025 | // [/RLVa:KB] | ||
6026 | |||
5486 | confirm_replace_attachment(0, attachment_point); | 6027 | confirm_replace_attachment(0, attachment_point); |
5487 | } | 6028 | } |
5488 | return true; | 6029 | return true; |
@@ -5590,6 +6131,24 @@ class LLAttachmentDrop : public view_listener_t | |||
5590 | return true; | 6131 | return true; |
5591 | } | 6132 | } |
5592 | 6133 | ||
6134 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6135 | if (rlv_handler_t::isEnabled()) | ||
6136 | { | ||
6137 | if (gRlvHandler.hasLockedAttachment()) | ||
6138 | { | ||
6139 | // NOTE: copy/paste of the code in enable_detach() | ||
6140 | LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); | ||
6141 | RlvSelectHasLockedAttach functor; | ||
6142 | if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) | ||
6143 | return true; | ||
6144 | } | ||
6145 | else if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
6146 | { | ||
6147 | return true; | ||
6148 | } | ||
6149 | } | ||
6150 | // [/RLVa:KB] | ||
6151 | |||
5593 | // The sendDropAttachment() method works on the list of selected | 6152 | // The sendDropAttachment() method works on the list of selected |
5594 | // objects. Thus we need to clear the list, make sure it only | 6153 | // objects. Thus we need to clear the list, make sure it only |
5595 | // contains the object the user clicked, send the message, | 6154 | // contains the object the user clicked, send the message, |
@@ -5608,6 +6167,13 @@ void handle_detach_from_avatar(void* user_data) | |||
5608 | 6167 | ||
5609 | if (attached_object) | 6168 | if (attached_object) |
5610 | { | 6169 | { |
6170 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0d | ||
6171 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(attached_object)) ) | ||
6172 | { | ||
6173 | return; | ||
6174 | } | ||
6175 | // [/RLVa:KB] | ||
6176 | |||
5611 | gMessageSystem->newMessage("ObjectDetach"); | 6177 | gMessageSystem->newMessage("ObjectDetach"); |
5612 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); | 6178 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); |
5613 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); | 6179 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); |
@@ -5690,6 +6256,17 @@ class LLAttachmentDetach : public view_listener_t | |||
5690 | return true; | 6256 | return true; |
5691 | } | 6257 | } |
5692 | 6258 | ||
6259 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6260 | // NOTE: copy/paste of the code in enable_detach() | ||
6261 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6262 | { | ||
6263 | LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); | ||
6264 | RlvSelectHasLockedAttach functor; | ||
6265 | if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) | ||
6266 | return FALSE; | ||
6267 | } | ||
6268 | // [/RLVa:KB] | ||
6269 | |||
5693 | // The sendDetach() method works on the list of selected | 6270 | // The sendDetach() method works on the list of selected |
5694 | // objects. Thus we need to clear the list, make sure it only | 6271 | // objects. Thus we need to clear the list, make sure it only |
5695 | // contains the object the user clicked, send the message, | 6272 | // contains the object the user clicked, send the message, |
@@ -5773,7 +6350,10 @@ class LLAttachmentEnableDrop : public view_listener_t | |||
5773 | } | 6350 | } |
5774 | 6351 | ||
5775 | //now check to make sure that the item is actually in the inventory before we enable dropping it | 6352 | //now check to make sure that the item is actually in the inventory before we enable dropping it |
5776 | bool new_value = enable_detach(NULL) && can_build && item; | 6353 | // bool new_value = enable_detach(NULL) && can_build && item; |
6354 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
6355 | bool new_value = enable_detach(NULL) && can_build && item && (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)); | ||
6356 | // [/RLVa:KB] | ||
5777 | 6357 | ||
5778 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 6358 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
5779 | return true; | 6359 | return true; |
@@ -5793,6 +6373,20 @@ BOOL enable_detach(void*) | |||
5793 | // ...if it's you, good to detach | 6373 | // ...if it's you, good to detach |
5794 | if (avatar->getID() == gAgent.getID()) | 6374 | if (avatar->getID() == gAgent.getID()) |
5795 | { | 6375 | { |
6376 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6377 | // NOTE: this code is reused as-is in LLAttachmentDetach::handleEvent() and LLAttachmentDrop::handleEvent() | ||
6378 | // so any changes here should be reflected there as well (I think it's in a number of other places as well by now) | ||
6379 | |||
6380 | // RELEASE-RLVa: LLSelectMgr::sendDetach() and LLSelectMgr::sendDropAttachment() call sendListToRegions with | ||
6381 | // SEND_ONLY_ROOTS so we only need to examine the roots which saves us time | ||
6382 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6383 | { | ||
6384 | LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); | ||
6385 | RlvSelectHasLockedAttach functor; | ||
6386 | if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) | ||
6387 | return FALSE; | ||
6388 | } | ||
6389 | // [/RLVa:KB] | ||
5796 | return TRUE; | 6390 | return TRUE; |
5797 | } | 6391 | } |
5798 | 6392 | ||
@@ -5815,6 +6409,25 @@ class LLAttachmentEnableDetach : public view_listener_t | |||
5815 | // Used to tell if the selected object can be attached to your avatar. | 6409 | // Used to tell if the selected object can be attached to your avatar. |
5816 | BOOL object_selected_and_point_valid(void *user_data) | 6410 | BOOL object_selected_and_point_valid(void *user_data) |
5817 | { | 6411 | { |
6412 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
6413 | if (rlv_handler_t::isEnabled()) | ||
6414 | { | ||
6415 | // RELEASE-RLVa: look at the caller graph for this function on every new release | ||
6416 | // -> 1.22.11 and 1.23.4 | ||
6417 | // - object_is_wearable() => dead code [user_data == NULL => default attach point => OK!] | ||
6418 | // - LLObjectEnableWear::handleEvent() => Rezzed prim / right-click / "Wear" [user_data == NULL => see above] | ||
6419 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] | ||
6420 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] | ||
6421 | LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; | ||
6422 | if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point | ||
6423 | ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt->getObject()))) || // Don't allow replacing of locked attachment | ||
6424 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" | ||
6425 | { | ||
6426 | return FALSE; | ||
6427 | } | ||
6428 | } | ||
6429 | // [/RLVa:KB] | ||
6430 | |||
5818 | //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; | 6431 | //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; |
5819 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); | 6432 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); |
5820 | for (LLObjectSelection::root_iterator iter = selection->root_begin(); | 6433 | for (LLObjectSelection::root_iterator iter = selection->root_begin(); |
@@ -5882,7 +6495,13 @@ BOOL object_attached(void *user_data) | |||
5882 | { | 6495 | { |
5883 | LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; | 6496 | LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; |
5884 | 6497 | ||
5885 | return attachment->getObject() != NULL; | 6498 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) |
6499 | return ( | ||
6500 | (attachment->getObject() != NULL) && | ||
6501 | ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(attachment->getObject())) ) | ||
6502 | ); | ||
6503 | // [/RLVa:KB] | ||
6504 | // return attachment->getObject() != NULL; | ||
5886 | } | 6505 | } |
5887 | 6506 | ||
5888 | class LLAvatarSendIM : public view_listener_t | 6507 | class LLAvatarSendIM : public view_listener_t |
@@ -5890,6 +6509,12 @@ class LLAvatarSendIM : public view_listener_t | |||
5890 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6509 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5891 | { | 6510 | { |
5892 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); | 6511 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); |
6512 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
6513 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
6514 | { | ||
6515 | return true; | ||
6516 | } | ||
6517 | // [/RLVa:KB] | ||
5893 | if(avatar) | 6518 | if(avatar) |
5894 | { | 6519 | { |
5895 | std::string name("IM"); | 6520 | std::string name("IM"); |
@@ -6025,6 +6650,16 @@ class LLToolsSelectedScriptAction : public view_listener_t | |||
6025 | { | 6650 | { |
6026 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6651 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
6027 | { | 6652 | { |
6653 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6654 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6655 | { | ||
6656 | LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); | ||
6657 | RlvSelectHasLockedAttach functor; | ||
6658 | if ( (selectHandle->isAttachment()) && (selectHandle->getFirstNode(&functor)) ) | ||
6659 | return true; | ||
6660 | } | ||
6661 | // [/RLVa:KB] | ||
6662 | |||
6028 | std::string action = userdata.asString(); | 6663 | std::string action = userdata.asString(); |
6029 | if (action == "compile mono") | 6664 | if (action == "compile mono") |
6030 | { | 6665 | { |
@@ -6106,12 +6741,30 @@ void handle_dump_image_list(void*) | |||
6106 | 6741 | ||
6107 | void handle_test_male(void*) | 6742 | void handle_test_male(void*) |
6108 | { | 6743 | { |
6744 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6745 | if ( (rlv_handler_t::isEnabled()) && | ||
6746 | ( (gRlvHandler.hasLockedAttachment()) || | ||
6747 | (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) | ||
6748 | { | ||
6749 | return; | ||
6750 | } | ||
6751 | // [/RLVa:KB] | ||
6752 | |||
6109 | wear_outfit_by_name("Male Shape & Outfit"); | 6753 | wear_outfit_by_name("Male Shape & Outfit"); |
6110 | //gGestureList.requestResetFromServer( TRUE ); | 6754 | //gGestureList.requestResetFromServer( TRUE ); |
6111 | } | 6755 | } |
6112 | 6756 | ||
6113 | void handle_test_female(void*) | 6757 | void handle_test_female(void*) |
6114 | { | 6758 | { |
6759 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6760 | if ( (rlv_handler_t::isEnabled()) && | ||
6761 | ( (gRlvHandler.hasLockedAttachment()) || | ||
6762 | (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) | ||
6763 | { | ||
6764 | return; | ||
6765 | } | ||
6766 | // [/RLVa:KB] | ||
6767 | |||
6115 | wear_outfit_by_name("Female Shape & Outfit"); | 6768 | wear_outfit_by_name("Female Shape & Outfit"); |
6116 | //gGestureList.requestResetFromServer( FALSE ); | 6769 | //gGestureList.requestResetFromServer( FALSE ); |
6117 | } | 6770 | } |
@@ -6254,6 +6907,22 @@ BOOL enable_more_than_one_selected(void* ) | |||
6254 | 6907 | ||
6255 | static bool is_editable_selected() | 6908 | static bool is_editable_selected() |
6256 | { | 6909 | { |
6910 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c | ||
6911 | // RELEASE-RLVa: check that this still isn't called by anything but script actions in the Tools menu | ||
6912 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6913 | { | ||
6914 | LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); | ||
6915 | |||
6916 | // NOTE: this is called for 5 different menu items so we'll trade accuracy for efficiency and only | ||
6917 | // examine root nodes (LLToolsSelectedScriptAction::handleEvent() will catch what we miss) | ||
6918 | RlvSelectHasLockedAttach functor; | ||
6919 | if ( (selectHandle->isAttachment()) && (selectHandle->getFirstRootNode(&functor)) ) | ||
6920 | { | ||
6921 | return false; | ||
6922 | } | ||
6923 | } | ||
6924 | // [/RLVa:KB] | ||
6925 | |||
6257 | return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); | 6926 | return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); |
6258 | } | 6927 | } |
6259 | 6928 | ||
@@ -6300,7 +6969,12 @@ class LLToolsEnableTakeCopy : public view_listener_t | |||
6300 | { | 6969 | { |
6301 | virtual bool apply(LLViewerObject* obj) | 6970 | virtual bool apply(LLViewerObject* obj) |
6302 | { | 6971 | { |
6303 | return (!obj->permCopy() || obj->isAttachment()); | 6972 | // return (!obj->permCopy() || obj->isAttachment()); |
6973 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
6974 | return (!obj->permCopy() || obj->isAttachment()) || | ||
6975 | ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && | ||
6976 | (gAgent.getAvatarObject()->getRoot() == obj) ); | ||
6977 | // [/RLVa:KB] | ||
6304 | } | 6978 | } |
6305 | } func; | 6979 | } func; |
6306 | const bool firstonly = true; | 6980 | const bool firstonly = true; |
@@ -6503,6 +7177,9 @@ class LLWorldEnableCreateLandmark : public view_listener_t | |||
6503 | { | 7177 | { |
6504 | bool new_value = gAgent.isGodlike() || | 7178 | bool new_value = gAgent.isGodlike() || |
6505 | (gAgent.getRegion() && gAgent.getRegion()->getAllowLandmark()); | 7179 | (gAgent.getRegion() && gAgent.getRegion()->getAllowLandmark()); |
7180 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | ||
7181 | new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC); | ||
7182 | // [/RLVa:KB] | ||
6506 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 7183 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
6507 | return true; | 7184 | return true; |
6508 | } | 7185 | } |
@@ -6555,7 +7232,11 @@ BOOL enable_god_customer_service(void*) | |||
6555 | 7232 | ||
6556 | BOOL enable_god_basic(void*) | 7233 | BOOL enable_god_basic(void*) |
6557 | { | 7234 | { |
6558 | return gAgent.getGodLevel() > GOD_NOT; | 7235 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) |
7236 | // RELEASE-RLVa: check that this function isn't used for anything other than to enable/disable showing the "God Tools..." floater | ||
7237 | return (gAgent.getGodLevel() > GOD_NOT) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); | ||
7238 | // [/RLVa:KB] | ||
7239 | //return gAgent.getGodLevel() > GOD_NOT; | ||
6559 | } | 7240 | } |
6560 | 7241 | ||
6561 | #if 0 // 1.9.2 | 7242 | #if 0 // 1.9.2 |
@@ -7066,6 +7747,13 @@ class LLViewHighlightTransparent : public view_listener_t | |||
7066 | { | 7747 | { |
7067 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7748 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7068 | { | 7749 | { |
7750 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | ||
7751 | if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) | ||
7752 | { | ||
7753 | return true; | ||
7754 | } | ||
7755 | // [/RLVa:KB] | ||
7756 | |||
7069 | LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; | 7757 | LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; |
7070 | return true; | 7758 | return true; |
7071 | } | 7759 | } |
@@ -7113,6 +7801,13 @@ class LLViewShowHUDAttachments : public view_listener_t | |||
7113 | { | 7801 | { |
7114 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7802 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7115 | { | 7803 | { |
7804 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
7805 | if ( (LLPipeline::sShowHUDAttachments) && (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedHUD()) ) | ||
7806 | { | ||
7807 | return true; | ||
7808 | } | ||
7809 | // [/RLVa:KB] | ||
7810 | |||
7116 | LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; | 7811 | LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; |
7117 | return true; | 7812 | return true; |
7118 | } | 7813 | } |
@@ -7171,6 +7866,15 @@ class LLEditEnableTakeOff : public view_listener_t | |||
7171 | { | 7866 | { |
7172 | new_value = LLAgent::selfHasWearable((void *)WT_SKIRT); | 7867 | new_value = LLAgent::selfHasWearable((void *)WT_SKIRT); |
7173 | } | 7868 | } |
7869 | |||
7870 | // [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | ||
7871 | // Why aren't they using LLWearable::typeNameToType()? *confuzzled* | ||
7872 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isRemovable(LLWearable::typeNameToType(clothing))) ) | ||
7873 | { | ||
7874 | new_value = false; | ||
7875 | } | ||
7876 | // [/RLVa:KB] | ||
7877 | |||
7174 | gMenuHolder->findControl(control_name)->setValue(new_value); | 7878 | gMenuHolder->findControl(control_name)->setValue(new_value); |
7175 | return true; | 7879 | return true; |
7176 | } | 7880 | } |
@@ -7268,6 +7972,13 @@ class LLWorldEnvSettings : public view_listener_t | |||
7268 | { | 7972 | { |
7269 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7973 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7270 | { | 7974 | { |
7975 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
7976 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) | ||
7977 | { | ||
7978 | return true; | ||
7979 | } | ||
7980 | // [/RLVa:KB] | ||
7981 | |||
7271 | std::string tod = userdata.asString(); | 7982 | std::string tod = userdata.asString(); |
7272 | LLVector3 sun_direction; | 7983 | LLVector3 sun_direction; |
7273 | 7984 | ||
@@ -7345,6 +8056,13 @@ class LLWorldWaterSettings : public view_listener_t | |||
7345 | { | 8056 | { |
7346 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8057 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7347 | { | 8058 | { |
8059 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
8060 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) | ||
8061 | { | ||
8062 | return true; | ||
8063 | } | ||
8064 | // [/RLVa:KB] | ||
8065 | |||
7348 | // if not there or is hidden, show it | 8066 | // if not there or is hidden, show it |
7349 | if( !LLFloaterWater::isOpen() || | 8067 | if( !LLFloaterWater::isOpen() || |
7350 | !LLFloaterWater::instance()->getVisible()) { | 8068 | !LLFloaterWater::instance()->getVisible()) { |
@@ -7375,6 +8093,13 @@ class LLWorldDayCycle : public view_listener_t | |||
7375 | { | 8093 | { |
7376 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8094 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7377 | { | 8095 | { |
8096 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
8097 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) | ||
8098 | { | ||
8099 | return true; | ||
8100 | } | ||
8101 | // [/RLVa:KB] | ||
8102 | |||
7378 | LLFloaterDayCycle::show(); | 8103 | LLFloaterDayCycle::show(); |
7379 | return true; | 8104 | return true; |
7380 | } | 8105 | } |
@@ -9609,6 +10334,49 @@ class LLAvatarReportAbuse : public view_listener_t | |||
9609 | 10334 | ||
9610 | 10335 | ||
9611 | 10336 | ||
10337 | /////////////// | ||
10338 | // RLVa Main // | ||
10339 | /////////////// | ||
10340 | |||
10341 | |||
10342 | class RLVaMainToggle : public view_listener_t | ||
10343 | { | ||
10344 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
10345 | { | ||
10346 | rlvDbgToggleEnabled(NULL); | ||
10347 | return true; | ||
10348 | } | ||
10349 | }; | ||
10350 | |||
10351 | class RLVaMainCheck : public view_listener_t | ||
10352 | { | ||
10353 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
10354 | { | ||
10355 | bool new_value = rlvDbgGetEnabled(NULL); | ||
10356 | std::string control_name = userdata["control"].asString(); | ||
10357 | gMenuHolder->findControl(control_name)->setValue(new_value); | ||
10358 | return true; | ||
10359 | } | ||
10360 | }; | ||
10361 | |||
10362 | |||
10363 | |||
10364 | //////////////////// | ||
10365 | // RLVa BEHAVIORS // | ||
10366 | //////////////////// | ||
10367 | |||
10368 | |||
10369 | class RLVaBehaviorsShow : public view_listener_t | ||
10370 | { | ||
10371 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
10372 | { | ||
10373 | RlvFloaterBehaviour::show(NULL); | ||
10374 | return true; | ||
10375 | } | ||
10376 | }; | ||
10377 | |||
10378 | |||
10379 | |||
9612 | static void addMenu(view_listener_t *menu, const char *name) | 10380 | static void addMenu(view_listener_t *menu, const char *name) |
9613 | { | 10381 | { |
9614 | sMenus.push_back(menu); | 10382 | sMenus.push_back(menu); |
@@ -9774,6 +10542,10 @@ void initialize_menus() | |||
9774 | addMenu(new LLObjectBuy(), "Object.Buy"); | 10542 | addMenu(new LLObjectBuy(), "Object.Buy"); |
9775 | addMenu(new LLObjectEdit(), "Object.Edit"); | 10543 | addMenu(new LLObjectEdit(), "Object.Edit"); |
9776 | addMenu(new LLObjectInspect(), "Object.Inspect"); | 10544 | addMenu(new LLObjectInspect(), "Object.Inspect"); |
10545 | addMenu(new LLObjectCopyUUID(), "Object.CopyUUID"); | ||
10546 | addMenu(new LLObjectExport(), "Object.Export"); | ||
10547 | addMenu(new LLObjectImport(), "Object.Import"); | ||
10548 | addMenu(new LLObjectImportUpload(), "Object.ImportUpload"); | ||
9777 | 10549 | ||
9778 | addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); | 10550 | addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); |
9779 | addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); | 10551 | addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); |
@@ -9784,6 +10556,9 @@ void initialize_menus() | |||
9784 | addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); | 10556 | addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); |
9785 | addMenu(new LLObjectEnableMute(), "Object.EnableMute"); | 10557 | addMenu(new LLObjectEnableMute(), "Object.EnableMute"); |
9786 | addMenu(new LLObjectEnableBuy(), "Object.EnableBuy"); | 10558 | addMenu(new LLObjectEnableBuy(), "Object.EnableBuy"); |
10559 | addMenu(new LLObjectEnableCopyUUID(), "Object.EnableCopyUUID"); | ||
10560 | addMenu(new LLObjectEnableExport(), "Object.EnableExport"); | ||
10561 | addMenu(new LLObjectEnableImport(), "Object.EnableImport"); | ||
9787 | 10562 | ||
9788 | /*addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch"); | 10563 | /*addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch"); |
9789 | addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); | 10564 | addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); |
@@ -9984,4 +10759,11 @@ void initialize_menus() | |||
9984 | addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions"); | 10759 | addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions"); |
9985 | addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); | 10760 | addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); |
9986 | addMenu(new LLAdvancedLeaveAdminStatus(), "Advanced.LeaveAdminStatus"); | 10761 | addMenu(new LLAdvancedLeaveAdminStatus(), "Advanced.LeaveAdminStatus"); |
10762 | |||
10763 | |||
10764 | // RLVa | ||
10765 | addMenu(new RLVaMainToggle(), "RLVa.Main.Toggle"); | ||
10766 | addMenu(new RLVaMainCheck(), "RLVa.Main.Enabled"); | ||
10767 | addMenu(new RLVaBehaviorsShow(), "RLVa.Behaviors.Show"); | ||
10768 | |||
9987 | } | 10769 | } |