aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r--linden/indra/newview/llviewermenu.cpp974
1 files changed, 944 insertions, 30 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index 2940bdd..8a92963 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -209,6 +209,10 @@
209#include "llwaterparammanager.h" 209#include "llwaterparammanager.h"
210 210
211#include "lltexlayer.h" 211#include "lltexlayer.h"
212#include "primbackup.h"
213
214#include "jcfloater_animation_list.h"
215#include "llfloaterassetbrowser.h"
212 216
213void init_client_menu(LLMenuGL* menu); 217void init_client_menu(LLMenuGL* menu);
214void init_server_menu(LLMenuGL* menu); 218void init_server_menu(LLMenuGL* menu);
@@ -219,6 +223,13 @@ void init_debug_ui_menu(LLMenuGL* menu);
219void init_debug_xui_menu(LLMenuGL* menu); 223void init_debug_xui_menu(LLMenuGL* menu);
220void init_debug_avatar_menu(LLMenuGL* menu); 224void init_debug_avatar_menu(LLMenuGL* menu);
221void init_debug_baked_texture_menu(LLMenuGL* menu); 225void 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"
231void init_debug_rlva_menu(LLMenuGL* menu);
232// [/RLVa:KB]
222 233
223BOOL enable_land_build(void*); 234BOOL enable_land_build(void*);
224BOOL enable_object_build(void*); 235BOOL enable_object_build(void*);
@@ -825,6 +836,19 @@ void init_client_menu(LLMenuGL* menu)
825 init_debug_world_menu(sub_menu); 836 init_debug_world_menu(sub_menu);
826 menu->appendMenu(sub_menu); 837 menu->appendMenu(sub_menu);
827 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
828 sub_menu = new LLMenuGL("UI"); 852 sub_menu = new LLMenuGL("UI");
829 init_debug_ui_menu(sub_menu); 853 init_debug_ui_menu(sub_menu);
830 menu->appendMenu(sub_menu); 854 menu->appendMenu(sub_menu);
@@ -919,6 +943,13 @@ void init_client_menu(LLMenuGL* menu)
919 &menu_check_control, 943 &menu_check_control,
920 (void*)"ShowConsoleWindow")); 944 (void*)"ShowConsoleWindow"));
921 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
922 if(gSavedSettings.getBOOL("QAMode")) 953 if(gSavedSettings.getBOOL("QAMode"))
923 { 954 {
924 LLMenuGL* sub = NULL; 955 LLMenuGL* sub = NULL;
@@ -1366,6 +1397,53 @@ void init_debug_baked_texture_menu(LLMenuGL* menu)
1366 menu->createJumpKeys(); 1397 menu->createJumpKeys();
1367} 1398}
1368 1399
1400// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g
1401void 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
1369void init_server_menu(LLMenuGL* menu) 1447void init_server_menu(LLMenuGL* menu)
1370{ 1448{
1371 { 1449 {
@@ -1518,6 +1596,16 @@ class LLObjectTouch : public view_listener_t
1518 1596
1519 LLPickInfo pick = LLToolPie::getInstance()->getPick(); 1597 LLPickInfo pick = LLToolPie::getInstance()->getPick();
1520 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
1521 LLMessageSystem *msg = gMessageSystem; 1609 LLMessageSystem *msg = gMessageSystem;
1522 1610
1523 msg->newMessageFast(_PREHASH_ObjectGrab); 1611 msg->newMessageFast(_PREHASH_ObjectGrab);
@@ -1566,6 +1654,14 @@ class LLObjectEnableTouch : public view_listener_t
1566 { 1654 {
1567 LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); 1655 LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
1568 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]
1569 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 1665 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
1570 1666
1571 // Update label based on the node touch name if available. 1667 // Update label based on the node touch name if available.
@@ -1634,6 +1730,14 @@ class LLObjectOpen : public view_listener_t
1634{ 1730{
1635 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 1731 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1636 { 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
1637 return handle_object_open(); 1741 return handle_object_open();
1638 } 1742 }
1639}; 1743};
@@ -1652,6 +1756,12 @@ class LLObjectEnableOpen : public view_listener_t
1652 if (!root) new_value = false; 1756 if (!root) new_value = false;
1653 else new_value = root->allowOpen(); 1757 else new_value = root->allowOpen();
1654 } 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
1655 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 1765 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
1656 return true; 1766 return true;
1657 } 1767 }
@@ -1713,7 +1823,13 @@ bool toggle_build_mode()
1713 } 1823 }
1714 } 1824 }
1715 1825
1716 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
1717 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); 1833 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
1718 LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); 1834 LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );
1719 1835
@@ -1813,6 +1929,23 @@ class LLObjectEdit : public view_listener_t
1813 { 1929 {
1814 LLViewerParcelMgr::getInstance()->deselectLand(); 1930 LLViewerParcelMgr::getInstance()->deselectLand();
1815 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
1816 if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) 1949 if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit())
1817 { 1950 {
1818 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); 1951 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
@@ -1962,6 +2095,22 @@ class LLEnableEdit : public view_listener_t
1962 enable = LLViewerParcelMgr::getInstance()->agentCanBuild() 2095 enable = LLViewerParcelMgr::getInstance()->agentCanBuild()
1963 || LLSelectMgr::getInstance()->getSelection()->isAttachment(); 2096 || LLSelectMgr::getInstance()->getSelection()->isAttachment();
1964 } 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]
1965 gMenuHolder->findControl(userdata["control"].asString())->setValue(enable); 2114 gMenuHolder->findControl(userdata["control"].asString())->setValue(enable);
1966 return true; 2115 return true;
1967 } 2116 }
@@ -1989,7 +2138,10 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t
1989 { 2138 {
1990 LLVOAvatar::attachment_map_t::iterator curiter = iter++; 2139 LLVOAvatar::attachment_map_t::iterator curiter = iter++;
1991 LLViewerJointAttachment* attachment = curiter->second; 2140 LLViewerJointAttachment* attachment = curiter->second;
1992 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]
1993 { 2145 {
1994 new_value = true; 2146 new_value = true;
1995 break; 2147 break;
@@ -2036,6 +2188,9 @@ class LLObjectEnableMute : public view_listener_t
2036 BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); 2188 BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden");
2037 BOOL is_self = avatar->isSelf(); 2189 BOOL is_self = avatar->isSelf();
2038 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]
2039 } 2194 }
2040 } 2195 }
2041 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 2196 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
@@ -2056,6 +2211,12 @@ class LLObjectMute : public view_listener_t
2056 LLVOAvatar* avatar = find_avatar_from_object(object); 2211 LLVOAvatar* avatar = find_avatar_from_object(object);
2057 if (avatar) 2212 if (avatar)
2058 { 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]
2059 id = avatar->getID(); 2220 id = avatar->getID();
2060 2221
2061 LLNameValue *firstname = avatar->getNVPair("FirstName"); 2222 LLNameValue *firstname = avatar->getNVPair("FirstName");
@@ -2104,34 +2265,190 @@ class LLObjectMute : public view_listener_t
2104 } 2265 }
2105}; 2266};
2106 2267
2268class 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
2280class 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
2301class 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
2359class 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
2378class 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
2387class 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
2396class 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
2107bool handle_go_to() 2405bool handle_go_to()
2108{ 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
2109 // JAMESDEBUG try simulator autopilot 2414 // JAMESDEBUG try simulator autopilot
2110 std::vector<std::string> strings; 2415 std::vector<std::string> strings;
2111 std::string val; 2416 std::string val;
2112 LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; 2417 LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal;
2113 val = llformat("%g", pos.mdV[VX]); 2418 if (gSavedSettings.getBOOL("DoubleClickTeleport"))
2114 strings.push_back(val);
2115 val = llformat("%g", pos.mdV[VY]);
2116 strings.push_back(val);
2117 val = llformat("%g", pos.mdV[VZ]);
2118 strings.push_back(val);
2119 send_generic_message("autopilot", strings);
2120
2121 LLViewerParcelMgr::getInstance()->deselectLand();
2122
2123 if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera"))
2124 { 2419 {
2125 gAgent.setFocusGlobal(gAgent.getFocusTargetGlobal(), gAgent.getAvatarObject()->getID()); 2420 LLVector3d hips_offset(0.0f, 0.0f, 1.2f);
2421 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
2422 gAgent.teleportViaLocation(pos + hips_offset);
2126 } 2423 }
2127 else 2424 else
2128 { 2425 {
2129 // Snap camera back to behind avatar 2426 // JAMESDEBUG try simulator autopilot
2130 gAgent.setFocusOnAvatar(TRUE, ANIMATE); 2427 std::vector<std::string> strings;
2131 } 2428 std::string val;
2429 val = llformat("%g", pos.mdV[VX]);
2430 strings.push_back(val);
2431 val = llformat("%g", pos.mdV[VY]);
2432 strings.push_back(val);
2433 val = llformat("%g", pos.mdV[VZ]);
2434 strings.push_back(val);
2435 send_generic_message("autopilot", strings);
2132 2436
2133 // Could be first use 2437 LLViewerParcelMgr::getInstance()->deselectLand();
2134 LLFirstUse::useGoTo(); 2438
2439 if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera"))
2440 {
2441 gAgent.setFocusGlobal(gAgent.getFocusTargetGlobal(), gAgent.getAvatarObject()->getID());
2442 }
2443 else
2444 {
2445 // Snap camera back to behind avatar
2446 gAgent.setFocusOnAvatar(TRUE, ANIMATE);
2447 }
2448
2449 // Could be first use
2450 LLFirstUse::useGoTo();
2451 }
2135 return true; 2452 return true;
2136} 2453}
2137 2454
@@ -2188,6 +2505,12 @@ class LLAvatarFreeze : public view_listener_t
2188 { 2505 {
2189 LLUUID* avatar_id = new LLUUID( avatar->getID() ); 2506 LLUUID* avatar_id = new LLUUID( avatar->getID() );
2190 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]
2191 2514
2192 if (!fullname.empty()) 2515 if (!fullname.empty())
2193 { 2516 {
@@ -2213,7 +2536,11 @@ class LLAvatarVisibleDebug : public view_listener_t
2213{ 2536{
2214 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 2537 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
2215 { 2538 {
2216 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]
2217 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 2544 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
2218 return true; 2545 return true;
2219 } 2546 }
@@ -2325,6 +2652,12 @@ class LLAvatarEject : public view_listener_t
2325 MenuCallbackData *data = new MenuCallbackData; 2652 MenuCallbackData *data = new MenuCallbackData;
2326 (*data).avatar_id = avatar->getID(); 2653 (*data).avatar_id = avatar->getID();
2327 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]
2328 2661
2329 const LLVector3d& pos = avatar->getPositionGlobal(); 2662 const LLVector3d& pos = avatar->getPositionGlobal();
2330 LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel(); 2663 LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel();
@@ -2406,6 +2739,13 @@ class LLAvatarGiveCard : public view_listener_t
2406{ 2739{
2407 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 2740 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
2408 { 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
2409 llinfos << "handle_give_card()" << llendl; 2749 llinfos << "handle_give_card()" << llendl;
2410 LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); 2750 LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
2411 if(dest && dest->isAvatar()) 2751 if(dest && dest->isAvatar())
@@ -2655,6 +2995,13 @@ class LLSelfStandUp : public view_listener_t
2655{ 2995{
2656 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 2996 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
2657 { 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
2658 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); 3005 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
2659 return true; 3006 return true;
2660 } 3007 }
@@ -2664,7 +3011,10 @@ class LLSelfEnableStandUp : public view_listener_t
2664{ 3011{
2665 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 3012 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
2666 { 3013 {
2667 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]
2668 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 3018 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
2669 return true; 3019 return true;
2670 } 3020 }
@@ -2839,6 +3189,11 @@ class LLAvatarEnableAddFriend : public view_listener_t
2839 { 3189 {
2840 LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); 3190 LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
2841 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
2842 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 3197 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
2843 return true; 3198 return true;
2844 } 3199 }
@@ -2897,6 +3252,15 @@ bool handle_sit_or_stand()
2897 return true; 3252 return true;
2898 } 3253 }
2899 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
2900 if (sitting_on_selection()) 3264 if (sitting_on_selection())
2901 { 3265 {
2902 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); 3266 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
@@ -2907,6 +3271,15 @@ bool handle_sit_or_stand()
2907 3271
2908 if (object && object->getPCode() == LL_PCODE_VOLUME) 3272 if (object && object->getPCode() == LL_PCODE_VOLUME)
2909 { 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
2910 gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); 3283 gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit);
2911 gMessageSystem->nextBlockFast(_PREHASH_AgentData); 3284 gMessageSystem->nextBlockFast(_PREHASH_AgentData);
2912 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 3285 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
@@ -2944,6 +3317,13 @@ class LLLandSit : public view_listener_t
2944{ 3317{
2945 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 3318 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
2946 { 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
2947 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); 3327 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
2948 LLViewerParcelMgr::getInstance()->deselectLand(); 3328 LLViewerParcelMgr::getInstance()->deselectLand();
2949 3329
@@ -3254,6 +3634,14 @@ class LLEditDuplicate : public view_listener_t
3254{ 3634{
3255 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 3635 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3256 { 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
3257 if(LLEditMenuHandler::gEditMenuHandler) 3645 if(LLEditMenuHandler::gEditMenuHandler)
3258 { 3646 {
3259 LLEditMenuHandler::gEditMenuHandler->duplicate(); 3647 LLEditMenuHandler::gEditMenuHandler->duplicate();
@@ -3267,6 +3655,13 @@ class LLEditEnableDuplicate : public view_listener_t
3267 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 3655 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3268 { 3656 {
3269 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]
3270 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 3665 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
3271 return true; 3666 return true;
3272 } 3667 }
@@ -3652,6 +4047,11 @@ class LLToolsTakeCopy : public view_listener_t
3652 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4047 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3653 { 4048 {
3654 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]
3655 4055
3656 const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); 4056 const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT);
3657 derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); 4057 derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id);
@@ -3667,6 +4067,9 @@ class LLObjectReturn : public view_listener_t
3667 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4067 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3668 { 4068 {
3669 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]
3670 4073
3671 mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); 4074 mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
3672 4075
@@ -3736,6 +4139,14 @@ class LLObjectEnableReturn : public view_listener_t
3736 } 4139 }
3737 } 4140 }
3738#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
3739 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 4150 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
3740 return true; 4151 return true;
3741 } 4152 }
@@ -3757,6 +4168,13 @@ void handle_take()
3757 return; 4168 return;
3758 } 4169 }
3759 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
3760 BOOL you_own_everything = TRUE; 4178 BOOL you_own_everything = TRUE;
3761 BOOL locked_but_takeable_object = FALSE; 4179 BOOL locked_but_takeable_object = FALSE;
3762 LLUUID category_id; 4180 LLUUID category_id;
@@ -3878,6 +4296,13 @@ BOOL enable_take()
3878 return FALSE; 4296 return FALSE;
3879 } 4297 }
3880 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
3881 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();
3882 iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) 4307 iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++)
3883 { 4308 {
@@ -4193,12 +4618,28 @@ class LLToolsEnableUnlink : public view_listener_t
4193 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() && 4618 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
4194 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment()) 4619 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment())
4195 { 4620 {
4196 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 4621 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 0 &&
4622 LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() !=
4197 LLSelectMgr::getInstance()->getSelection()->getObjectCount()) 4623 LLSelectMgr::getInstance()->getSelection()->getObjectCount())
4198 { 4624 {
4199 new_value = true; 4625 new_value = true;
4200 } 4626 }
4201 } 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
4202 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 4643 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
4203 return true; 4644 return true;
4204 } 4645 }
@@ -4208,6 +4649,19 @@ class LLToolsUnlink : public view_listener_t
4208{ 4649{
4209 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4650 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4210 { 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
4211 LLSelectMgr::getInstance()->sendDelink(); 4665 LLSelectMgr::getInstance()->sendDelink();
4212 return true; 4666 return true;
4213 } 4667 }
@@ -4227,6 +4681,13 @@ class LLToolsReleaseKeys : public view_listener_t
4227{ 4681{
4228 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4682 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4229 { 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
4230 gAgent.forceReleaseControls(); 4691 gAgent.forceReleaseControls();
4231 4692
4232 return true; 4693 return true;
@@ -4237,7 +4698,11 @@ class LLToolsEnableReleaseKeys : public view_listener_t
4237{ 4698{
4238 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4699 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4239 { 4700 {
4240 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() );
4241 return true; 4706 return true;
4242 } 4707 }
4243}; 4708};
@@ -4345,6 +4810,15 @@ class LLEditEnableDelete : public view_listener_t
4345 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4810 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4346 { 4811 {
4347 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
4348 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 4822 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
4349 return true; 4823 return true;
4350 } 4824 }
@@ -4354,6 +4828,15 @@ class LLEditDelete : public view_listener_t
4354{ 4828{
4355 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4829 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4356 { 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
4357 // 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
4358 // an object in the world. 4841 // an object in the world.
4359 if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) 4842 if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete())
@@ -4385,6 +4868,12 @@ class LLObjectEnableDelete : public view_listener_t
4385# endif 4868# endif
4386 LLSelectMgr::getInstance()->canDoDelete(); 4869 LLSelectMgr::getInstance()->canDoDelete();
4387#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]
4388 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 4877 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
4389 return true; 4878 return true;
4390 } 4879 }
@@ -4403,6 +4892,13 @@ class LLObjectDelete : public view_listener_t
4403{ 4892{
4404 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4893 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4405 { 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
4406 if (LLSelectMgr::getInstance()) 4902 if (LLSelectMgr::getInstance())
4407 { 4903 {
4408 LLSelectMgr::getInstance()->doDelete(); 4904 LLSelectMgr::getInstance()->doDelete();
@@ -4752,6 +5248,12 @@ class LLWorldCreateLandmark : public view_listener_t
4752{ 5248{
4753 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5249 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4754 { 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]
4755 LLViewerRegion* agent_region = gAgent.getRegion(); 5257 LLViewerRegion* agent_region = gAgent.getRegion();
4756 if(!agent_region) 5258 if(!agent_region)
4757 { 5259 {
@@ -4859,6 +5361,13 @@ class LLAvatarInviteToGroup : public view_listener_t
4859{ 5361{
4860 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5362 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4861 { 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
4862 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); 5371 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
4863 if(avatar) 5372 if(avatar)
4864 { 5373 {
@@ -4872,6 +5381,13 @@ class LLAvatarAddFriend : public view_listener_t
4872{ 5381{
4873 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5382 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4874 { 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
4875 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); 5391 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
4876 if(avatar && !is_agent_friend(avatar->getID())) 5392 if(avatar && !is_agent_friend(avatar->getID()))
4877 { 5393 {
@@ -4959,6 +5475,12 @@ class LLEnablePayObject : public view_listener_t
4959 } 5475 }
4960 } 5476 }
4961 } 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
4962 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 5484 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
4963 return true; 5485 return true;
4964 } 5486 }
@@ -5147,6 +5669,12 @@ class LLShowFloater : public view_listener_t
5147 } 5669 }
5148 else if (floater_name == "buy land") 5670 else if (floater_name == "buy land")
5149 { 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]
5150 if (LLViewerParcelMgr::getInstance()->selectionEmpty()) 5678 if (LLViewerParcelMgr::getInstance()->selectionEmpty())
5151 { 5679 {
5152 LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); 5680 LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
@@ -5209,6 +5737,10 @@ class LLShowFloater : public view_listener_t
5209 { 5737 {
5210 LLFloaterActiveSpeakers::toggleInstance(LLSD()); 5738 LLFloaterActiveSpeakers::toggleInstance(LLSD());
5211 } 5739 }
5740 else if (floater_name == "animation list")
5741 {
5742 JCFloaterAnimList::toggleInstance(LLSD());
5743 }
5212 else if (floater_name == "inworld browser") 5744 else if (floater_name == "inworld browser")
5213 { 5745 {
5214 LLFloaterMediaBrowser::toggle(); 5746 LLFloaterMediaBrowser::toggle();
@@ -5324,6 +5856,13 @@ class LLShowAgentProfile : public view_listener_t
5324 } 5856 }
5325 else if (userdata.asString() == "hit object") 5857 else if (userdata.asString() == "hit object")
5326 { 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
5327 LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); 5866 LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
5328 if (objectp) 5867 if (objectp)
5329 { 5868 {
@@ -5383,6 +5922,13 @@ class LLLandEdit : public view_listener_t
5383{ 5922{
5384 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5923 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5385 { 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
5386 if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) 5932 if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") )
5387 { 5933 {
5388 // zoom in if we're looking at the avatar 5934 // zoom in if we're looking at the avatar
@@ -5401,7 +5947,6 @@ class LLLandEdit : public view_listener_t
5401 5947
5402 LLViewerParcelMgr::getInstance()->selectParcelAt( LLToolPie::getInstance()->getPick().mPosGlobal ); 5948 LLViewerParcelMgr::getInstance()->selectParcelAt( LLToolPie::getInstance()->getPick().mPosGlobal );
5403 5949
5404 gFloaterTools->showMore(TRUE);
5405 gFloaterView->bringToFront( gFloaterTools ); 5950 gFloaterView->bringToFront( gFloaterTools );
5406 5951
5407 // Switch to land edit toolset 5952 // Switch to land edit toolset
@@ -5468,6 +6013,18 @@ private:
5468 LLViewerJointAttachment* attachment_point = NULL; 6013 LLViewerJointAttachment* attachment_point = NULL;
5469 if (index > 0) 6014 if (index > 0)
5470 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
5471 confirm_replace_attachment(0, attachment_point); 6028 confirm_replace_attachment(0, attachment_point);
5472 } 6029 }
5473 return true; 6030 return true;
@@ -5575,6 +6132,24 @@ class LLAttachmentDrop : public view_listener_t
5575 return true; 6132 return true;
5576 } 6133 }
5577 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
5578 // The sendDropAttachment() method works on the list of selected 6153 // The sendDropAttachment() method works on the list of selected
5579 // 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
5580 // contains the object the user clicked, send the message, 6155 // contains the object the user clicked, send the message,
@@ -5593,6 +6168,13 @@ void handle_detach_from_avatar(void* user_data)
5593 6168
5594 if (attached_object) 6169 if (attached_object)
5595 { 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
5596 gMessageSystem->newMessage("ObjectDetach"); 6178 gMessageSystem->newMessage("ObjectDetach");
5597 gMessageSystem->nextBlockFast(_PREHASH_AgentData); 6179 gMessageSystem->nextBlockFast(_PREHASH_AgentData);
5598 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); 6180 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
@@ -5675,6 +6257,17 @@ class LLAttachmentDetach : public view_listener_t
5675 return true; 6257 return true;
5676 } 6258 }
5677 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
5678 // The sendDetach() method works on the list of selected 6271 // The sendDetach() method works on the list of selected
5679 // 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
5680 // contains the object the user clicked, send the message, 6273 // contains the object the user clicked, send the message,
@@ -5758,7 +6351,10 @@ class LLAttachmentEnableDrop : public view_listener_t
5758 } 6351 }
5759 6352
5760 //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
5761 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]
5762 6358
5763 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 6359 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
5764 return true; 6360 return true;
@@ -5778,6 +6374,20 @@ BOOL enable_detach(void*)
5778 // ...if it's you, good to detach 6374 // ...if it's you, good to detach
5779 if (avatar->getID() == gAgent.getID()) 6375 if (avatar->getID() == gAgent.getID())
5780 { 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]
5781 return TRUE; 6391 return TRUE;
5782 } 6392 }
5783 6393
@@ -5800,6 +6410,25 @@ class LLAttachmentEnableDetach : public view_listener_t
5800// 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.
5801BOOL object_selected_and_point_valid(void *user_data) 6411BOOL object_selected_and_point_valid(void *user_data)
5802{ 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
5803 //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; 6432 //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data;
5804 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); 6433 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
5805 for (LLObjectSelection::root_iterator iter = selection->root_begin(); 6434 for (LLObjectSelection::root_iterator iter = selection->root_begin();
@@ -5867,7 +6496,13 @@ BOOL object_attached(void *user_data)
5867{ 6496{
5868 LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; 6497 LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data;
5869 6498
5870 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;
5871} 6506}
5872 6507
5873class LLAvatarSendIM : public view_listener_t 6508class LLAvatarSendIM : public view_listener_t
@@ -5875,6 +6510,12 @@ class LLAvatarSendIM : public view_listener_t
5875 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6510 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5876 { 6511 {
5877 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]
5878 if(avatar) 6519 if(avatar)
5879 { 6520 {
5880 std::string name("IM"); 6521 std::string name("IM");
@@ -6010,6 +6651,16 @@ class LLToolsSelectedScriptAction : public view_listener_t
6010{ 6651{
6011 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6652 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
6012 { 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
6013 std::string action = userdata.asString(); 6664 std::string action = userdata.asString();
6014 if (action == "compile mono") 6665 if (action == "compile mono")
6015 { 6666 {
@@ -6070,7 +6721,10 @@ void handle_selected_texture_info(void*)
6070 S32 height = img->getHeight(); 6721 S32 height = img->getHeight();
6071 S32 width = img->getWidth(); 6722 S32 width = img->getWidth();
6072 S32 components = img->getComponents(); 6723 S32 components = img->getComponents();
6073 msg = llformat("%dx%d %s on face ", 6724 std::string image_id_string = image_id.asString();
6725 image_id_string = image_id_string.replace(24, 35, 12, '*') + " "; // hide last segment to discourage theft
6726 msg = llformat("%s%dx%d %s on face ",
6727 image_id_string.c_str(),
6074 width, 6728 width,
6075 height, 6729 height,
6076 (components == 4 ? "alpha" : "opaque")); 6730 (components == 4 ? "alpha" : "opaque"));
@@ -6091,12 +6745,30 @@ void handle_dump_image_list(void*)
6091 6745
6092void handle_test_male(void*) 6746void handle_test_male(void*)
6093{ 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
6094 wear_outfit_by_name("Male Shape & Outfit"); 6757 wear_outfit_by_name("Male Shape & Outfit");
6095 //gGestureList.requestResetFromServer( TRUE ); 6758 //gGestureList.requestResetFromServer( TRUE );
6096} 6759}
6097 6760
6098void handle_test_female(void*) 6761void handle_test_female(void*)
6099{ 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
6100 wear_outfit_by_name("Female Shape & Outfit"); 6772 wear_outfit_by_name("Female Shape & Outfit");
6101 //gGestureList.requestResetFromServer( FALSE ); 6773 //gGestureList.requestResetFromServer( FALSE );
6102} 6774}
@@ -6239,6 +6911,22 @@ BOOL enable_more_than_one_selected(void* )
6239 6911
6240static bool is_editable_selected() 6912static bool is_editable_selected()
6241{ 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
6242 return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); 6930 return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL);
6243} 6931}
6244 6932
@@ -6285,7 +6973,12 @@ class LLToolsEnableTakeCopy : public view_listener_t
6285 { 6973 {
6286 virtual bool apply(LLViewerObject* obj) 6974 virtual bool apply(LLViewerObject* obj)
6287 { 6975 {
6288 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]
6289 } 6982 }
6290 } func; 6983 } func;
6291 const bool firstonly = true; 6984 const bool firstonly = true;
@@ -6488,6 +7181,9 @@ class LLWorldEnableCreateLandmark : public view_listener_t
6488 { 7181 {
6489 bool new_value = gAgent.isGodlike() || 7182 bool new_value = gAgent.isGodlike() ||
6490 (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]
6491 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 7187 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
6492 return true; 7188 return true;
6493 } 7189 }
@@ -6540,7 +7236,11 @@ BOOL enable_god_customer_service(void*)
6540 7236
6541BOOL enable_god_basic(void*) 7237BOOL enable_god_basic(void*)
6542{ 7238{
6543 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;
6544} 7244}
6545 7245
6546#if 0 // 1.9.2 7246#if 0 // 1.9.2
@@ -7051,6 +7751,13 @@ class LLViewHighlightTransparent : public view_listener_t
7051{ 7751{
7052 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7752 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7053 { 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
7054 LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; 7761 LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha;
7055 return true; 7762 return true;
7056 } 7763 }
@@ -7098,6 +7805,13 @@ class LLViewShowHUDAttachments : public view_listener_t
7098{ 7805{
7099 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7806 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7100 { 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
7101 LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; 7815 LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments;
7102 return true; 7816 return true;
7103 } 7817 }
@@ -7156,6 +7870,15 @@ class LLEditEnableTakeOff : public view_listener_t
7156 { 7870 {
7157 new_value = LLAgent::selfHasWearable((void *)WT_SKIRT); 7871 new_value = LLAgent::selfHasWearable((void *)WT_SKIRT);
7158 } 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
7159 gMenuHolder->findControl(control_name)->setValue(new_value); 7882 gMenuHolder->findControl(control_name)->setValue(new_value);
7160 return true; 7883 return true;
7161 } 7884 }
@@ -7253,6 +7976,13 @@ class LLWorldEnvSettings : public view_listener_t
7253{ 7976{
7254 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7977 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7255 { 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
7256 std::string tod = userdata.asString(); 7986 std::string tod = userdata.asString();
7257 LLVector3 sun_direction; 7987 LLVector3 sun_direction;
7258 7988
@@ -7330,6 +8060,13 @@ class LLWorldWaterSettings : public view_listener_t
7330{ 8060{
7331 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 8061 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7332 { 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
7333 // if not there or is hidden, show it 8070 // if not there or is hidden, show it
7334 if( !LLFloaterWater::isOpen() || 8071 if( !LLFloaterWater::isOpen() ||
7335 !LLFloaterWater::instance()->getVisible()) { 8072 !LLFloaterWater::instance()->getVisible()) {
@@ -7360,6 +8097,13 @@ class LLWorldDayCycle : public view_listener_t
7360{ 8097{
7361 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 8098 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7362 { 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
7363 LLFloaterDayCycle::show(); 8107 LLFloaterDayCycle::show();
7364 return true; 8108 return true;
7365 } 8109 }
@@ -7547,6 +8291,113 @@ class LLAdvancedCheckHUDInfo : public view_listener_t
7547}; 8291};
7548 8292
7549 8293
8294//////////////////////
8295// FORCE GROUND SIT //
8296//////////////////////
8297
8298class LLAdvancedToggleSit: public view_listener_t
8299{
8300 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8301 {
8302 LLChat chat;
8303 chat.mSourceType = CHAT_SOURCE_SYSTEM;
8304 if(!gAgent.getAvatarObject()->mIsSitting)
8305 {
8306 gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
8307 chat.mText = "Forcing Ground Sit";
8308 }
8309 else
8310 {
8311 gAgent.setControlFlags(!AGENT_CONTROL_SIT_ON_GROUND);
8312 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
8313 chat.mText = "Standing up";
8314 }
8315 LLFloaterChat::addChat(chat);
8316 return true;
8317 }
8318};
8319
8320class LLAdvancedCheckSit : public view_listener_t
8321{
8322 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8323 {
8324 if(gAgent.getAvatarObject()->mIsSitting)
8325 {
8326 gMenuHolder->findControl(userdata["control"].asString())->setValue(true);
8327 }
8328 else
8329 {
8330 gMenuHolder->findControl(userdata["control"].asString())->setValue(false);
8331 }
8332 return true;
8333 }
8334};
8335
8336
8337/////////////
8338// PHANTOM //
8339/////////////
8340
8341class LLAdvancedTogglePhantom: public view_listener_t
8342{
8343 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8344 {
8345 LLAgent::togglePhantom();
8346 BOOL ph = LLAgent::getPhantom();
8347 LLChat chat;
8348 chat.mSourceType = CHAT_SOURCE_SYSTEM;
8349 chat.mText = llformat("%s%s","Phantom ",(ph ? "On" : "Off"));
8350 LLFloaterChat::addChat(chat);
8351 //gMenuHolder->findControl(userdata["control"].asString())->setValue(ph);
8352 return true;
8353 }
8354
8355};
8356
8357class LLAdvancedCheckPhantom: public view_listener_t
8358{
8359 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8360 {
8361 gMenuHolder->findControl(userdata["control"].asString())->setValue(LLAgent::getPhantom());
8362 return true;
8363 }
8364};
8365
8366
8367///////////////////
8368// ASSET BROWSER //
8369///////////////////
8370
8371class LLAdvancedToggleAssetBrowser: public view_listener_t
8372{
8373 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8374 {
8375 //open the floater
8376 LLFloaterAssetBrowser::show(0);
8377
8378 bool vis = false;
8379 if(LLFloaterAssetBrowser::getInstance())
8380 {
8381 vis = (bool)LLFloaterAssetBrowser::getInstance()->getVisible();
8382 }
8383 return true;
8384 }
8385};
8386
8387class LLAdvancedCheckAssetBrowser: public view_listener_t
8388{
8389 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8390 {
8391 bool vis = false;
8392 if(LLFloaterAssetBrowser::getInstance())
8393 {
8394 vis = (bool)LLFloaterAssetBrowser::getInstance()->getVisible();
8395 }
8396 gMenuHolder->findControl(userdata["control"].asString())->setValue(vis);
8397 return true;
8398 }
8399};
8400
7550 8401
7551/////////////////////// 8402///////////////////////
7552// CLEAR GROUP CACHE // 8403// CLEAR GROUP CACHE //
@@ -9487,6 +10338,49 @@ class LLAvatarReportAbuse : public view_listener_t
9487 10338
9488 10339
9489 10340
10341///////////////
10342// RLVa Main //
10343///////////////
10344
10345
10346class 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
10355class 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
10373class 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
9490static void addMenu(view_listener_t *menu, const char *name) 10384static void addMenu(view_listener_t *menu, const char *name)
9491{ 10385{
9492 sMenus.push_back(menu); 10386 sMenus.push_back(menu);
@@ -9652,6 +10546,10 @@ void initialize_menus()
9652 addMenu(new LLObjectBuy(), "Object.Buy"); 10546 addMenu(new LLObjectBuy(), "Object.Buy");
9653 addMenu(new LLObjectEdit(), "Object.Edit"); 10547 addMenu(new LLObjectEdit(), "Object.Edit");
9654 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");
9655 10553
9656 addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); 10554 addMenu(new LLObjectEnableOpen(), "Object.EnableOpen");
9657 addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); 10555 addMenu(new LLObjectEnableTouch(), "Object.EnableTouch");
@@ -9662,6 +10560,9 @@ void initialize_menus()
9662 addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); 10560 addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse");
9663 addMenu(new LLObjectEnableMute(), "Object.EnableMute"); 10561 addMenu(new LLObjectEnableMute(), "Object.EnableMute");
9664 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");
9665 10566
9666 /*addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch"); 10567 /*addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch");
9667 addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); 10568 addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch");
@@ -9711,6 +10612,12 @@ void initialize_menus()
9711 addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole"); 10612 addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole");
9712 addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole"); 10613 addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole");
9713 addMenu(new LLAdvancedReloadSettingsOverrides(), "Advanced.ReloadSettingsOverrides"); 10614 addMenu(new LLAdvancedReloadSettingsOverrides(), "Advanced.ReloadSettingsOverrides");
10615 addMenu(new LLAdvancedToggleSit(), "Advanced.ToggleSit");
10616 addMenu(new LLAdvancedCheckSit(), "Emerald.CheckSit");
10617 addMenu(new LLAdvancedTogglePhantom(), "Advanced.TogglePhantom");
10618 addMenu(new LLAdvancedCheckPhantom(), "Advanced.CheckPhantom");
10619 addMenu(new LLAdvancedToggleAssetBrowser(),"Advanced.ToggleAssetBrowser");
10620 addMenu(new LLAdvancedCheckAssetBrowser(),"Advanced.CheckAssetBrowser");
9714 10621
9715 // Advanced > HUD Info 10622 // Advanced > HUD Info
9716 addMenu(new LLAdvancedToggleHUDInfo(), "Advanced.ToggleHUDInfo"); 10623 addMenu(new LLAdvancedToggleHUDInfo(), "Advanced.ToggleHUDInfo");
@@ -9856,4 +10763,11 @@ void initialize_menus()
9856 addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions"); 10763 addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions");
9857 addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); 10764 addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus");
9858 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
9859} 10773}