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 ddebd97..8a92963 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 | { |
@@ -4212,6 +4625,21 @@ class LLToolsEnableUnlink : public view_listener_t | |||
4212 | new_value = true; | 4625 | new_value = true; |
4213 | } | 4626 | } |
4214 | } | 4627 | } |
4628 | |||
4629 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g | ||
4630 | // The user might not be allowed to unlink this object due to RLV settings, | ||
4631 | // because it would unsit them if they are sitting on the object. | ||
4632 | if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && | ||
4633 | (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) | ||
4634 | { | ||
4635 | // Allow if the avie isn't sitting on any of the selected objects | ||
4636 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); | ||
4637 | RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); | ||
4638 | if (handleSel->getFirstRootNode(&func, TRUE)) | ||
4639 | new_value = false; | ||
4640 | } | ||
4641 | // [/RLVa:KB] | ||
4642 | |||
4215 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4643 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4216 | return true; | 4644 | return true; |
4217 | } | 4645 | } |
@@ -4221,6 +4649,19 @@ class LLToolsUnlink : public view_listener_t | |||
4221 | { | 4649 | { |
4222 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4650 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4223 | { | 4651 | { |
4652 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g | ||
4653 | // The user might not be allowed to unlink this object due to RLV settings, | ||
4654 | // because it would unsit them if they are sitting on the object. | ||
4655 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) | ||
4656 | { | ||
4657 | // Allow if the avie isn't sitting on any of the selected objects | ||
4658 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); | ||
4659 | RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); | ||
4660 | if (handleSel->getFirstRootNode(&func, TRUE)) | ||
4661 | return true; | ||
4662 | } | ||
4663 | // [/RLVa:KB] | ||
4664 | |||
4224 | LLSelectMgr::getInstance()->sendDelink(); | 4665 | LLSelectMgr::getInstance()->sendDelink(); |
4225 | return true; | 4666 | return true; |
4226 | } | 4667 | } |
@@ -4240,6 +4681,13 @@ class LLToolsReleaseKeys : public view_listener_t | |||
4240 | { | 4681 | { |
4241 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4682 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4242 | { | 4683 | { |
4684 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
4685 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
4686 | { | ||
4687 | return true; | ||
4688 | } | ||
4689 | // [/RLVa:KB] | ||
4690 | |||
4243 | gAgent.forceReleaseControls(); | 4691 | gAgent.forceReleaseControls(); |
4244 | 4692 | ||
4245 | return true; | 4693 | return true; |
@@ -4250,7 +4698,11 @@ class LLToolsEnableReleaseKeys : public view_listener_t | |||
4250 | { | 4698 | { |
4251 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4699 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4252 | { | 4700 | { |
4253 | gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); | 4701 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) |
4702 | gMenuHolder->findControl(userdata["control"].asString())->setValue( | ||
4703 | gAgent.anyControlGrabbed() && ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment() ) ) ); | ||
4704 | // [/RLVa:KB] | ||
4705 | //gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); | ||
4254 | return true; | 4706 | return true; |
4255 | } | 4707 | } |
4256 | }; | 4708 | }; |
@@ -4358,6 +4810,15 @@ class LLEditEnableDelete : public view_listener_t | |||
4358 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4810 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4359 | { | 4811 | { |
4360 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); | 4812 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); |
4813 | |||
4814 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4815 | // NOTE: we want to disable delete on objects but not disable delete on text | ||
4816 | if ( (new_value) && (rlv_handler_t::isEnabled()) && (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) | ||
4817 | { | ||
4818 | new_value = rlvCanDeleteOrReturn(); | ||
4819 | } | ||
4820 | // [/RLVa:KB] | ||
4821 | |||
4361 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4822 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4362 | return true; | 4823 | return true; |
4363 | } | 4824 | } |
@@ -4367,6 +4828,15 @@ class LLEditDelete : public view_listener_t | |||
4367 | { | 4828 | { |
4368 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4829 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4369 | { | 4830 | { |
4831 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4832 | // NOTE: we want to disable delete on objects but not disable delete on text | ||
4833 | if ( (rlv_handler_t::isEnabled()) && (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) && | ||
4834 | (!rlvCanDeleteOrReturn()) ) | ||
4835 | { | ||
4836 | return true; | ||
4837 | } | ||
4838 | // [/RLVa:KB] | ||
4839 | |||
4370 | // If a text field can do a deletion, it gets precedence over deleting | 4840 | // If a text field can do a deletion, it gets precedence over deleting |
4371 | // an object in the world. | 4841 | // an object in the world. |
4372 | if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) | 4842 | if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) |
@@ -4398,6 +4868,12 @@ class LLObjectEnableDelete : public view_listener_t | |||
4398 | # endif | 4868 | # endif |
4399 | LLSelectMgr::getInstance()->canDoDelete(); | 4869 | LLSelectMgr::getInstance()->canDoDelete(); |
4400 | #endif | 4870 | #endif |
4871 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4872 | if ( (new_value) && (rlv_handler_t::isEnabled()) ) | ||
4873 | { | ||
4874 | new_value = rlvCanDeleteOrReturn(); | ||
4875 | } | ||
4876 | // [/RLVa:KB] | ||
4401 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4877 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4402 | return true; | 4878 | return true; |
4403 | } | 4879 | } |
@@ -4416,6 +4892,13 @@ class LLObjectDelete : public view_listener_t | |||
4416 | { | 4892 | { |
4417 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4893 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4418 | { | 4894 | { |
4895 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
4896 | if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) | ||
4897 | { | ||
4898 | return true; | ||
4899 | } | ||
4900 | // [/RLVa:KB] | ||
4901 | |||
4419 | if (LLSelectMgr::getInstance()) | 4902 | if (LLSelectMgr::getInstance()) |
4420 | { | 4903 | { |
4421 | LLSelectMgr::getInstance()->doDelete(); | 4904 | LLSelectMgr::getInstance()->doDelete(); |
@@ -4765,6 +5248,12 @@ class LLWorldCreateLandmark : public view_listener_t | |||
4765 | { | 5248 | { |
4766 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5249 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4767 | { | 5250 | { |
5251 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | ||
5252 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) | ||
5253 | { | ||
5254 | return true; | ||
5255 | } | ||
5256 | // [/RLVa:KB] | ||
4768 | LLViewerRegion* agent_region = gAgent.getRegion(); | 5257 | LLViewerRegion* agent_region = gAgent.getRegion(); |
4769 | if(!agent_region) | 5258 | if(!agent_region) |
4770 | { | 5259 | { |
@@ -4872,6 +5361,13 @@ class LLAvatarInviteToGroup : public view_listener_t | |||
4872 | { | 5361 | { |
4873 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5362 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4874 | { | 5363 | { |
5364 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5365 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
5366 | { | ||
5367 | return true; | ||
5368 | } | ||
5369 | // [/RLVa:KB] | ||
5370 | |||
4875 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); | 5371 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); |
4876 | if(avatar) | 5372 | if(avatar) |
4877 | { | 5373 | { |
@@ -4885,6 +5381,13 @@ class LLAvatarAddFriend : public view_listener_t | |||
4885 | { | 5381 | { |
4886 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5382 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4887 | { | 5383 | { |
5384 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5385 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
5386 | { | ||
5387 | return true; // Fallback code [see LLAvatarEnableAddFriend::handleEvent()] | ||
5388 | } | ||
5389 | // [/RLVa:KB] | ||
5390 | |||
4888 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); | 5391 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); |
4889 | if(avatar && !is_agent_friend(avatar->getID())) | 5392 | if(avatar && !is_agent_friend(avatar->getID())) |
4890 | { | 5393 | { |
@@ -4972,6 +5475,12 @@ class LLEnablePayObject : public view_listener_t | |||
4972 | } | 5475 | } |
4973 | } | 5476 | } |
4974 | } | 5477 | } |
5478 | |||
5479 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5480 | // Don't enable "Pay..." on the avatar pie menu under @shownames=n | ||
5481 | new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (avatar == NULL); | ||
5482 | // [/RLVa:KB] | ||
5483 | |||
4975 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 5484 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4976 | return true; | 5485 | return true; |
4977 | } | 5486 | } |
@@ -5160,6 +5669,12 @@ class LLShowFloater : public view_listener_t | |||
5160 | } | 5669 | } |
5161 | else if (floater_name == "buy land") | 5670 | else if (floater_name == "buy land") |
5162 | { | 5671 | { |
5672 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | ||
5673 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) | ||
5674 | { | ||
5675 | return true; | ||
5676 | } | ||
5677 | // [/RLVa:KB] | ||
5163 | if (LLViewerParcelMgr::getInstance()->selectionEmpty()) | 5678 | if (LLViewerParcelMgr::getInstance()->selectionEmpty()) |
5164 | { | 5679 | { |
5165 | LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); | 5680 | LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); |
@@ -5341,6 +5856,13 @@ class LLShowAgentProfile : public view_listener_t | |||
5341 | } | 5856 | } |
5342 | else if (userdata.asString() == "hit object") | 5857 | else if (userdata.asString() == "hit object") |
5343 | { | 5858 | { |
5859 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
5860 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
5861 | { | ||
5862 | return true; | ||
5863 | } | ||
5864 | // [/RLVa:KB] | ||
5865 | |||
5344 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | 5866 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); |
5345 | if (objectp) | 5867 | if (objectp) |
5346 | { | 5868 | { |
@@ -5400,6 +5922,13 @@ class LLLandEdit : public view_listener_t | |||
5400 | { | 5922 | { |
5401 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5923 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5402 | { | 5924 | { |
5925 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | ||
5926 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) ) | ||
5927 | { | ||
5928 | return true; | ||
5929 | } | ||
5930 | // [/RLVa:KB] | ||
5931 | |||
5403 | if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) | 5932 | if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) |
5404 | { | 5933 | { |
5405 | // zoom in if we're looking at the avatar | 5934 | // zoom in if we're looking at the avatar |
@@ -5484,6 +6013,18 @@ private: | |||
5484 | LLViewerJointAttachment* attachment_point = NULL; | 6013 | LLViewerJointAttachment* attachment_point = NULL; |
5485 | if (index > 0) | 6014 | if (index > 0) |
5486 | attachment_point = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); | 6015 | attachment_point = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); |
6016 | |||
6017 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6018 | if ( (rlv_handler_t::isEnabled()) && | ||
6019 | ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point | ||
6020 | ((index > 0) && (!gRlvHandler.isDetachable(attachment_point->getObject()))) || // Can't replace locked attachment | ||
6021 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" | ||
6022 | { | ||
6023 | setObjectSelection(NULL); // Clear the selection or it'll get stuck | ||
6024 | return true; | ||
6025 | } | ||
6026 | // [/RLVa:KB] | ||
6027 | |||
5487 | confirm_replace_attachment(0, attachment_point); | 6028 | confirm_replace_attachment(0, attachment_point); |
5488 | } | 6029 | } |
5489 | return true; | 6030 | return true; |
@@ -5591,6 +6132,24 @@ class LLAttachmentDrop : public view_listener_t | |||
5591 | return true; | 6132 | return true; |
5592 | } | 6133 | } |
5593 | 6134 | ||
6135 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6136 | if (rlv_handler_t::isEnabled()) | ||
6137 | { | ||
6138 | if (gRlvHandler.hasLockedAttachment()) | ||
6139 | { | ||
6140 | // NOTE: copy/paste of the code in enable_detach() | ||
6141 | LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); | ||
6142 | RlvSelectHasLockedAttach functor; | ||
6143 | if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) | ||
6144 | return true; | ||
6145 | } | ||
6146 | else if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
6147 | { | ||
6148 | return true; | ||
6149 | } | ||
6150 | } | ||
6151 | // [/RLVa:KB] | ||
6152 | |||
5594 | // The sendDropAttachment() method works on the list of selected | 6153 | // The sendDropAttachment() method works on the list of selected |
5595 | // objects. Thus we need to clear the list, make sure it only | 6154 | // objects. Thus we need to clear the list, make sure it only |
5596 | // contains the object the user clicked, send the message, | 6155 | // contains the object the user clicked, send the message, |
@@ -5609,6 +6168,13 @@ void handle_detach_from_avatar(void* user_data) | |||
5609 | 6168 | ||
5610 | if (attached_object) | 6169 | if (attached_object) |
5611 | { | 6170 | { |
6171 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0d | ||
6172 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(attached_object)) ) | ||
6173 | { | ||
6174 | return; | ||
6175 | } | ||
6176 | // [/RLVa:KB] | ||
6177 | |||
5612 | gMessageSystem->newMessage("ObjectDetach"); | 6178 | gMessageSystem->newMessage("ObjectDetach"); |
5613 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); | 6179 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); |
5614 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); | 6180 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); |
@@ -5691,6 +6257,17 @@ class LLAttachmentDetach : public view_listener_t | |||
5691 | return true; | 6257 | return true; |
5692 | } | 6258 | } |
5693 | 6259 | ||
6260 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6261 | // NOTE: copy/paste of the code in enable_detach() | ||
6262 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6263 | { | ||
6264 | LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); | ||
6265 | RlvSelectHasLockedAttach functor; | ||
6266 | if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) | ||
6267 | return FALSE; | ||
6268 | } | ||
6269 | // [/RLVa:KB] | ||
6270 | |||
5694 | // The sendDetach() method works on the list of selected | 6271 | // The sendDetach() method works on the list of selected |
5695 | // objects. Thus we need to clear the list, make sure it only | 6272 | // objects. Thus we need to clear the list, make sure it only |
5696 | // contains the object the user clicked, send the message, | 6273 | // contains the object the user clicked, send the message, |
@@ -5774,7 +6351,10 @@ class LLAttachmentEnableDrop : public view_listener_t | |||
5774 | } | 6351 | } |
5775 | 6352 | ||
5776 | //now check to make sure that the item is actually in the inventory before we enable dropping it | 6353 | //now check to make sure that the item is actually in the inventory before we enable dropping it |
5777 | bool new_value = enable_detach(NULL) && can_build && item; | 6354 | // bool new_value = enable_detach(NULL) && can_build && item; |
6355 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
6356 | bool new_value = enable_detach(NULL) && can_build && item && (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)); | ||
6357 | // [/RLVa:KB] | ||
5778 | 6358 | ||
5779 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 6359 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
5780 | return true; | 6360 | return true; |
@@ -5794,6 +6374,20 @@ BOOL enable_detach(void*) | |||
5794 | // ...if it's you, good to detach | 6374 | // ...if it's you, good to detach |
5795 | if (avatar->getID() == gAgent.getID()) | 6375 | if (avatar->getID() == gAgent.getID()) |
5796 | { | 6376 | { |
6377 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6378 | // NOTE: this code is reused as-is in LLAttachmentDetach::handleEvent() and LLAttachmentDrop::handleEvent() | ||
6379 | // so any changes here should be reflected there as well (I think it's in a number of other places as well by now) | ||
6380 | |||
6381 | // RELEASE-RLVa: LLSelectMgr::sendDetach() and LLSelectMgr::sendDropAttachment() call sendListToRegions with | ||
6382 | // SEND_ONLY_ROOTS so we only need to examine the roots which saves us time | ||
6383 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6384 | { | ||
6385 | LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); | ||
6386 | RlvSelectHasLockedAttach functor; | ||
6387 | if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) | ||
6388 | return FALSE; | ||
6389 | } | ||
6390 | // [/RLVa:KB] | ||
5797 | return TRUE; | 6391 | return TRUE; |
5798 | } | 6392 | } |
5799 | 6393 | ||
@@ -5816,6 +6410,25 @@ class LLAttachmentEnableDetach : public view_listener_t | |||
5816 | // Used to tell if the selected object can be attached to your avatar. | 6410 | // Used to tell if the selected object can be attached to your avatar. |
5817 | BOOL object_selected_and_point_valid(void *user_data) | 6411 | BOOL object_selected_and_point_valid(void *user_data) |
5818 | { | 6412 | { |
6413 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
6414 | if (rlv_handler_t::isEnabled()) | ||
6415 | { | ||
6416 | // RELEASE-RLVa: look at the caller graph for this function on every new release | ||
6417 | // -> 1.22.11 and 1.23.4 | ||
6418 | // - object_is_wearable() => dead code [user_data == NULL => default attach point => OK!] | ||
6419 | // - LLObjectEnableWear::handleEvent() => Rezzed prim / right-click / "Wear" [user_data == NULL => see above] | ||
6420 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] | ||
6421 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] | ||
6422 | LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; | ||
6423 | if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point | ||
6424 | ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt->getObject()))) || // Don't allow replacing of locked attachment | ||
6425 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" | ||
6426 | { | ||
6427 | return FALSE; | ||
6428 | } | ||
6429 | } | ||
6430 | // [/RLVa:KB] | ||
6431 | |||
5819 | //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; | 6432 | //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; |
5820 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); | 6433 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); |
5821 | for (LLObjectSelection::root_iterator iter = selection->root_begin(); | 6434 | for (LLObjectSelection::root_iterator iter = selection->root_begin(); |
@@ -5883,7 +6496,13 @@ BOOL object_attached(void *user_data) | |||
5883 | { | 6496 | { |
5884 | LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; | 6497 | LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; |
5885 | 6498 | ||
5886 | return attachment->getObject() != NULL; | 6499 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) |
6500 | return ( | ||
6501 | (attachment->getObject() != NULL) && | ||
6502 | ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(attachment->getObject())) ) | ||
6503 | ); | ||
6504 | // [/RLVa:KB] | ||
6505 | // return attachment->getObject() != NULL; | ||
5887 | } | 6506 | } |
5888 | 6507 | ||
5889 | class LLAvatarSendIM : public view_listener_t | 6508 | class LLAvatarSendIM : public view_listener_t |
@@ -5891,6 +6510,12 @@ class LLAvatarSendIM : public view_listener_t | |||
5891 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6510 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5892 | { | 6511 | { |
5893 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); | 6512 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); |
6513 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
6514 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
6515 | { | ||
6516 | return true; | ||
6517 | } | ||
6518 | // [/RLVa:KB] | ||
5894 | if(avatar) | 6519 | if(avatar) |
5895 | { | 6520 | { |
5896 | std::string name("IM"); | 6521 | std::string name("IM"); |
@@ -6026,6 +6651,16 @@ class LLToolsSelectedScriptAction : public view_listener_t | |||
6026 | { | 6651 | { |
6027 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6652 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
6028 | { | 6653 | { |
6654 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6655 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6656 | { | ||
6657 | LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); | ||
6658 | RlvSelectHasLockedAttach functor; | ||
6659 | if ( (selectHandle->isAttachment()) && (selectHandle->getFirstNode(&functor)) ) | ||
6660 | return true; | ||
6661 | } | ||
6662 | // [/RLVa:KB] | ||
6663 | |||
6029 | std::string action = userdata.asString(); | 6664 | std::string action = userdata.asString(); |
6030 | if (action == "compile mono") | 6665 | if (action == "compile mono") |
6031 | { | 6666 | { |
@@ -6110,12 +6745,30 @@ void handle_dump_image_list(void*) | |||
6110 | 6745 | ||
6111 | void handle_test_male(void*) | 6746 | void handle_test_male(void*) |
6112 | { | 6747 | { |
6748 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6749 | if ( (rlv_handler_t::isEnabled()) && | ||
6750 | ( (gRlvHandler.hasLockedAttachment()) || | ||
6751 | (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) | ||
6752 | { | ||
6753 | return; | ||
6754 | } | ||
6755 | // [/RLVa:KB] | ||
6756 | |||
6113 | wear_outfit_by_name("Male Shape & Outfit"); | 6757 | wear_outfit_by_name("Male Shape & Outfit"); |
6114 | //gGestureList.requestResetFromServer( TRUE ); | 6758 | //gGestureList.requestResetFromServer( TRUE ); |
6115 | } | 6759 | } |
6116 | 6760 | ||
6117 | void handle_test_female(void*) | 6761 | void handle_test_female(void*) |
6118 | { | 6762 | { |
6763 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
6764 | if ( (rlv_handler_t::isEnabled()) && | ||
6765 | ( (gRlvHandler.hasLockedAttachment()) || | ||
6766 | (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) | ||
6767 | { | ||
6768 | return; | ||
6769 | } | ||
6770 | // [/RLVa:KB] | ||
6771 | |||
6119 | wear_outfit_by_name("Female Shape & Outfit"); | 6772 | wear_outfit_by_name("Female Shape & Outfit"); |
6120 | //gGestureList.requestResetFromServer( FALSE ); | 6773 | //gGestureList.requestResetFromServer( FALSE ); |
6121 | } | 6774 | } |
@@ -6258,6 +6911,22 @@ BOOL enable_more_than_one_selected(void* ) | |||
6258 | 6911 | ||
6259 | static bool is_editable_selected() | 6912 | static bool is_editable_selected() |
6260 | { | 6913 | { |
6914 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c | ||
6915 | // RELEASE-RLVa: check that this still isn't called by anything but script actions in the Tools menu | ||
6916 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
6917 | { | ||
6918 | LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); | ||
6919 | |||
6920 | // NOTE: this is called for 5 different menu items so we'll trade accuracy for efficiency and only | ||
6921 | // examine root nodes (LLToolsSelectedScriptAction::handleEvent() will catch what we miss) | ||
6922 | RlvSelectHasLockedAttach functor; | ||
6923 | if ( (selectHandle->isAttachment()) && (selectHandle->getFirstRootNode(&functor)) ) | ||
6924 | { | ||
6925 | return false; | ||
6926 | } | ||
6927 | } | ||
6928 | // [/RLVa:KB] | ||
6929 | |||
6261 | return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); | 6930 | return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); |
6262 | } | 6931 | } |
6263 | 6932 | ||
@@ -6304,7 +6973,12 @@ class LLToolsEnableTakeCopy : public view_listener_t | |||
6304 | { | 6973 | { |
6305 | virtual bool apply(LLViewerObject* obj) | 6974 | virtual bool apply(LLViewerObject* obj) |
6306 | { | 6975 | { |
6307 | return (!obj->permCopy() || obj->isAttachment()); | 6976 | // return (!obj->permCopy() || obj->isAttachment()); |
6977 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
6978 | return (!obj->permCopy() || obj->isAttachment()) || | ||
6979 | ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && | ||
6980 | (gAgent.getAvatarObject()->getRoot() == obj) ); | ||
6981 | // [/RLVa:KB] | ||
6308 | } | 6982 | } |
6309 | } func; | 6983 | } func; |
6310 | const bool firstonly = true; | 6984 | const bool firstonly = true; |
@@ -6507,6 +7181,9 @@ class LLWorldEnableCreateLandmark : public view_listener_t | |||
6507 | { | 7181 | { |
6508 | bool new_value = gAgent.isGodlike() || | 7182 | bool new_value = gAgent.isGodlike() || |
6509 | (gAgent.getRegion() && gAgent.getRegion()->getAllowLandmark()); | 7183 | (gAgent.getRegion() && gAgent.getRegion()->getAllowLandmark()); |
7184 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | ||
7185 | new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC); | ||
7186 | // [/RLVa:KB] | ||
6510 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 7187 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
6511 | return true; | 7188 | return true; |
6512 | } | 7189 | } |
@@ -6559,7 +7236,11 @@ BOOL enable_god_customer_service(void*) | |||
6559 | 7236 | ||
6560 | BOOL enable_god_basic(void*) | 7237 | BOOL enable_god_basic(void*) |
6561 | { | 7238 | { |
6562 | return gAgent.getGodLevel() > GOD_NOT; | 7239 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) |
7240 | // RELEASE-RLVa: check that this function isn't used for anything other than to enable/disable showing the "God Tools..." floater | ||
7241 | return (gAgent.getGodLevel() > GOD_NOT) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); | ||
7242 | // [/RLVa:KB] | ||
7243 | //return gAgent.getGodLevel() > GOD_NOT; | ||
6563 | } | 7244 | } |
6564 | 7245 | ||
6565 | #if 0 // 1.9.2 | 7246 | #if 0 // 1.9.2 |
@@ -7070,6 +7751,13 @@ class LLViewHighlightTransparent : public view_listener_t | |||
7070 | { | 7751 | { |
7071 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7752 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7072 | { | 7753 | { |
7754 | // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | ||
7755 | if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) | ||
7756 | { | ||
7757 | return true; | ||
7758 | } | ||
7759 | // [/RLVa:KB] | ||
7760 | |||
7073 | LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; | 7761 | LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; |
7074 | return true; | 7762 | return true; |
7075 | } | 7763 | } |
@@ -7117,6 +7805,13 @@ class LLViewShowHUDAttachments : public view_listener_t | |||
7117 | { | 7805 | { |
7118 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7806 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7119 | { | 7807 | { |
7808 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
7809 | if ( (LLPipeline::sShowHUDAttachments) && (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedHUD()) ) | ||
7810 | { | ||
7811 | return true; | ||
7812 | } | ||
7813 | // [/RLVa:KB] | ||
7814 | |||
7120 | LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; | 7815 | LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; |
7121 | return true; | 7816 | return true; |
7122 | } | 7817 | } |
@@ -7175,6 +7870,15 @@ class LLEditEnableTakeOff : public view_listener_t | |||
7175 | { | 7870 | { |
7176 | new_value = LLAgent::selfHasWearable((void *)WT_SKIRT); | 7871 | new_value = LLAgent::selfHasWearable((void *)WT_SKIRT); |
7177 | } | 7872 | } |
7873 | |||
7874 | // [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | ||
7875 | // Why aren't they using LLWearable::typeNameToType()? *confuzzled* | ||
7876 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isRemovable(LLWearable::typeNameToType(clothing))) ) | ||
7877 | { | ||
7878 | new_value = false; | ||
7879 | } | ||
7880 | // [/RLVa:KB] | ||
7881 | |||
7178 | gMenuHolder->findControl(control_name)->setValue(new_value); | 7882 | gMenuHolder->findControl(control_name)->setValue(new_value); |
7179 | return true; | 7883 | return true; |
7180 | } | 7884 | } |
@@ -7272,6 +7976,13 @@ class LLWorldEnvSettings : public view_listener_t | |||
7272 | { | 7976 | { |
7273 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7977 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7274 | { | 7978 | { |
7979 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
7980 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) | ||
7981 | { | ||
7982 | return true; | ||
7983 | } | ||
7984 | // [/RLVa:KB] | ||
7985 | |||
7275 | std::string tod = userdata.asString(); | 7986 | std::string tod = userdata.asString(); |
7276 | LLVector3 sun_direction; | 7987 | LLVector3 sun_direction; |
7277 | 7988 | ||
@@ -7349,6 +8060,13 @@ class LLWorldWaterSettings : public view_listener_t | |||
7349 | { | 8060 | { |
7350 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8061 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7351 | { | 8062 | { |
8063 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
8064 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) | ||
8065 | { | ||
8066 | return true; | ||
8067 | } | ||
8068 | // [/RLVa:KB] | ||
8069 | |||
7352 | // if not there or is hidden, show it | 8070 | // if not there or is hidden, show it |
7353 | if( !LLFloaterWater::isOpen() || | 8071 | if( !LLFloaterWater::isOpen() || |
7354 | !LLFloaterWater::instance()->getVisible()) { | 8072 | !LLFloaterWater::instance()->getVisible()) { |
@@ -7379,6 +8097,13 @@ class LLWorldDayCycle : public view_listener_t | |||
7379 | { | 8097 | { |
7380 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8098 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7381 | { | 8099 | { |
8100 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
8101 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) | ||
8102 | { | ||
8103 | return true; | ||
8104 | } | ||
8105 | // [/RLVa:KB] | ||
8106 | |||
7382 | LLFloaterDayCycle::show(); | 8107 | LLFloaterDayCycle::show(); |
7383 | return true; | 8108 | return true; |
7384 | } | 8109 | } |
@@ -9613,6 +10338,49 @@ class LLAvatarReportAbuse : public view_listener_t | |||
9613 | 10338 | ||
9614 | 10339 | ||
9615 | 10340 | ||
10341 | /////////////// | ||
10342 | // RLVa Main // | ||
10343 | /////////////// | ||
10344 | |||
10345 | |||
10346 | class RLVaMainToggle : public view_listener_t | ||
10347 | { | ||
10348 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
10349 | { | ||
10350 | rlvDbgToggleEnabled(NULL); | ||
10351 | return true; | ||
10352 | } | ||
10353 | }; | ||
10354 | |||
10355 | class RLVaMainCheck : public view_listener_t | ||
10356 | { | ||
10357 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
10358 | { | ||
10359 | bool new_value = rlvDbgGetEnabled(NULL); | ||
10360 | std::string control_name = userdata["control"].asString(); | ||
10361 | gMenuHolder->findControl(control_name)->setValue(new_value); | ||
10362 | return true; | ||
10363 | } | ||
10364 | }; | ||
10365 | |||
10366 | |||
10367 | |||
10368 | //////////////////// | ||
10369 | // RLVa BEHAVIORS // | ||
10370 | //////////////////// | ||
10371 | |||
10372 | |||
10373 | class RLVaBehaviorsShow : public view_listener_t | ||
10374 | { | ||
10375 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
10376 | { | ||
10377 | RlvFloaterBehaviour::show(NULL); | ||
10378 | return true; | ||
10379 | } | ||
10380 | }; | ||
10381 | |||
10382 | |||
10383 | |||
9616 | static void addMenu(view_listener_t *menu, const char *name) | 10384 | static void addMenu(view_listener_t *menu, const char *name) |
9617 | { | 10385 | { |
9618 | sMenus.push_back(menu); | 10386 | sMenus.push_back(menu); |
@@ -9778,6 +10546,10 @@ void initialize_menus() | |||
9778 | addMenu(new LLObjectBuy(), "Object.Buy"); | 10546 | addMenu(new LLObjectBuy(), "Object.Buy"); |
9779 | addMenu(new LLObjectEdit(), "Object.Edit"); | 10547 | addMenu(new LLObjectEdit(), "Object.Edit"); |
9780 | addMenu(new LLObjectInspect(), "Object.Inspect"); | 10548 | addMenu(new LLObjectInspect(), "Object.Inspect"); |
10549 | addMenu(new LLObjectCopyUUID(), "Object.CopyUUID"); | ||
10550 | addMenu(new LLObjectExport(), "Object.Export"); | ||
10551 | addMenu(new LLObjectImport(), "Object.Import"); | ||
10552 | addMenu(new LLObjectImportUpload(), "Object.ImportUpload"); | ||
9781 | 10553 | ||
9782 | addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); | 10554 | addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); |
9783 | addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); | 10555 | addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); |
@@ -9788,6 +10560,9 @@ void initialize_menus() | |||
9788 | addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); | 10560 | addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); |
9789 | addMenu(new LLObjectEnableMute(), "Object.EnableMute"); | 10561 | addMenu(new LLObjectEnableMute(), "Object.EnableMute"); |
9790 | addMenu(new LLObjectEnableBuy(), "Object.EnableBuy"); | 10562 | addMenu(new LLObjectEnableBuy(), "Object.EnableBuy"); |
10563 | addMenu(new LLObjectEnableCopyUUID(), "Object.EnableCopyUUID"); | ||
10564 | addMenu(new LLObjectEnableExport(), "Object.EnableExport"); | ||
10565 | addMenu(new LLObjectEnableImport(), "Object.EnableImport"); | ||
9791 | 10566 | ||
9792 | /*addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch"); | 10567 | /*addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch"); |
9793 | addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); | 10568 | addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); |
@@ -9988,4 +10763,11 @@ void initialize_menus() | |||
9988 | addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions"); | 10763 | addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions"); |
9989 | addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); | 10764 | addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); |
9990 | addMenu(new LLAdvancedLeaveAdminStatus(), "Advanced.LeaveAdminStatus"); | 10765 | addMenu(new LLAdvancedLeaveAdminStatus(), "Advanced.LeaveAdminStatus"); |
10766 | |||
10767 | |||
10768 | // RLVa | ||
10769 | addMenu(new RLVaMainToggle(), "RLVa.Main.Toggle"); | ||
10770 | addMenu(new RLVaMainCheck(), "RLVa.Main.Enabled"); | ||
10771 | addMenu(new RLVaBehaviorsShow(), "RLVa.Behaviors.Show"); | ||
10772 | |||
9991 | } | 10773 | } |