From 287284331af10af8a55914d00b2c61d5fd40642f Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 9 Sep 2009 16:57:26 -0700 Subject: Applied ReinstateShowTextureUUID Cool Viewer patch (reverts the fix for VWR-1919) --- linden/indra/newview/llviewermenu.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'linden/indra/newview/llviewermenu.cpp') diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 36ffc21..efadf67 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -6085,7 +6085,10 @@ void handle_selected_texture_info(void*) S32 height = img->getHeight(); S32 width = img->getWidth(); S32 components = img->getComponents(); - msg = llformat("%dx%d %s on face ", + std::string image_id_string = image_id.asString(); + image_id_string = image_id_string.replace(24, 35, 12, '*') + " "; // hide last segment to discourage theft + msg = llformat("%s%dx%d %s on face ", + image_id_string.c_str(), width, height, (components == 4 ? "alpha" : "opaque")); -- cgit v1.1 From 967cec4e5ddf168ecb58da3d244a49fa6a28d808 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 9 Sep 2009 17:18:15 -0700 Subject: Fixed unlink option enabling when selecting textures --- linden/indra/newview/llviewermenu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linden/indra/newview/llviewermenu.cpp') diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index efadf67..ddebd97 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -4205,7 +4205,8 @@ class LLToolsEnableUnlink : public view_listener_t LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() && !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment()) { - if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != + if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 0 && + LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != LLSelectMgr::getInstance()->getSelection()->getObjectCount()) { new_value = true; -- cgit v1.1 From 7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Mon, 14 Sep 2009 17:52:41 -0700 Subject: Merged in jacek/next --- linden/indra/newview/llviewermenu.cpp | 800 +++++++++++++++++++++++++++++++++- 1 file changed, 791 insertions(+), 9 deletions(-) (limited to 'linden/indra/newview/llviewermenu.cpp') 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 @@ #include "llwaterparammanager.h" #include "lltexlayer.h" +#include "primbackup.h" #include "jcfloater_animation_list.h" #include "llfloaterassetbrowser.h" @@ -222,6 +223,13 @@ void init_debug_ui_menu(LLMenuGL* menu); void init_debug_xui_menu(LLMenuGL* menu); void init_debug_avatar_menu(LLMenuGL* menu); void init_debug_baked_texture_menu(LLMenuGL* menu); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) +#ifdef RLV_DEBUG_TESTS + #include "rlvtest.h" +#endif // RLV_DEBUG_TESTS +#include "rlvfloaterbehaviour.h" +void init_debug_rlva_menu(LLMenuGL* menu); +// [/RLVa:KB] BOOL enable_land_build(void*); BOOL enable_object_build(void*); @@ -828,6 +836,19 @@ void init_client_menu(LLMenuGL* menu) init_debug_world_menu(sub_menu); menu->appendMenu(sub_menu); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1b + #ifdef RLV_ADVANCED_MENU + if (rlv_handler_t::isEnabled()) + { + sub_menu = new LLMenuGL("RLVa"); + init_debug_rlva_menu(sub_menu); + menu->appendMenu(sub_menu); + sub_menu->setVisible(rlv_handler_t::isEnabled()); + sub_menu->setEnabled(rlv_handler_t::isEnabled()); + } + #endif // RLV_ADVANCED_MENU +// [/RLVa:KB] + sub_menu = new LLMenuGL("UI"); init_debug_ui_menu(sub_menu); menu->appendMenu(sub_menu); @@ -922,6 +943,13 @@ void init_client_menu(LLMenuGL* menu) &menu_check_control, (void*)"ShowConsoleWindow")); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e + #ifdef RLV_ADVANCED_TOGGLE_RLVA + if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) + menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvDbgToggleEnabled, NULL, &rlvDbgGetEnabled, NULL)); + #endif // RLV_ADVANCED_TOGGLE_RLVA +// [/RLVa:KB] + if(gSavedSettings.getBOOL("QAMode")) { LLMenuGL* sub = NULL; @@ -1369,6 +1397,53 @@ void init_debug_baked_texture_menu(LLMenuGL* menu) menu->createJumpKeys(); } +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g +void init_debug_rlva_menu(LLMenuGL* menu) +{ + // Experimental feature toggles + { + /* + #ifdef RLV_EXPERIMENTAL + LLMenuGL* sub_menu = new LLMenuGL("Experimental"); + + menu->appendMenu(sub_menu); + #endif // RLV_EXPERIMENTAL + */ + } + + // Unit tests + { + #ifdef RLV_DEBUG_TESTS + init_debug_rlva_tests_menu(menu); + #endif // RLV_DEBUG_TESTS + } + + #ifdef RLV_EXTENSION_ENABLE_WEAR + if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) + { + menu->append(new LLMenuItemCheckGL("Enable Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); + menu->appendSeparator(); + } + #endif // RLV_EXTENSION_ENABLE_WEAR + + #ifdef RLV_EXTENSION_HIDELOCKED + if ( (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDLAYER)) && + (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDATTACH)) ) + { + menu->append(new LLMenuItemCheckGL("Hide locked layers", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDLAYER)); + menu->append(new LLMenuItemCheckGL("Hide locked attachments", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDATTACH)); + //sub_menu->append(new LLMenuItemToggleGL("Hide locked inventory", &rlv_handler_t::fHideLockedInventory)); + menu->appendSeparator(); + } + #endif // RLV_EXTENSION_HIDELOCKED + + #ifdef RLV_EXTENSION_FLOATER_RESTRICTIONS + // TODO-RLVa: figure out a way to tell if floater_rlv_behaviour.xml exists + menu->append(new LLMenuItemCallGL("Restrictions...", RlvFloaterBehaviour::show, NULL, NULL)); + #endif // RLV_EXTENSION_FLOATER_RESTRICTIONS +} +// [/RLVa:KB] + void init_server_menu(LLMenuGL* menu) { { @@ -1521,6 +1596,16 @@ class LLObjectTouch : public view_listener_t LLPickInfo pick = LLToolPie::getInstance()->getPick(); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f + // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for + // [msg->addVector3("Position", pick.mIntersection) <- see llDetectedTouchPos()] + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) && + (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f) ) + { + return true; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n + } +// [/RLVa:KB] + LLMessageSystem *msg = gMessageSystem; msg->newMessageFast(_PREHASH_ObjectGrab); @@ -1569,6 +1654,14 @@ class LLObjectEnableTouch : public view_listener_t { LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); bool new_value = obj && obj->flagHandleTouch(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f + // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for + if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!obj->isAttachment()) || (!obj->permYouOwner())) && + (dist_vec_squared(gAgent.getPositionAgent(), LLToolPie::getInstance()->getPick().mIntersection) > 1.5f * 1.5f) ) + { + new_value = false; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n + } +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); // Update label based on the node touch name if available. @@ -1637,6 +1730,14 @@ class LLObjectOpen : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) + // TODO-RLVa: shouldn't we be checking for fartouch here as well? + if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) + { + return true; + } +// [/RLVa:KB] + return handle_object_open(); } }; @@ -1655,6 +1756,12 @@ class LLObjectEnableOpen : public view_listener_t if (!root) new_value = false; else new_value = root->allowOpen(); } + +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | Modified: RLVa-1.0.0b + // TODO-RLV: shouldn't we be checking for fartouch here as well? (and LLViewerObject::allowOpen() makes this redundant?) + new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_EDIT); +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -1716,7 +1823,13 @@ bool toggle_build_mode() } } - +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (LLSelectMgr::getInstance()) ) + { + LLSelectMgr::getInstance()->deselectAll(); + } +// [/RLVa:KB] + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); @@ -1816,6 +1929,23 @@ class LLObjectEdit : public view_listener_t { LLViewerParcelMgr::getInstance()->deselectLand(); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f + if (rlv_handler_t::isEnabled()) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) + { + return true; // Can't edit any object under @edit=n + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && + (SELECT_TYPE_WORLD == LLSelectMgr::getInstance()->getSelection()->getSelectType()) && + (dist_vec_squared(gAgent.getPositionAgent(), LLToolPie::getInstance()->getPick().mIntersection) > 1.5f * 1.5f) ) + { + // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for + return true; // Can't edit in-world objects farther than 1.5m away under @fartouch=n + } + } +// [/RLVa:KB] + if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) { LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); @@ -1965,6 +2095,22 @@ class LLEnableEdit : public view_listener_t enable = LLViewerParcelMgr::getInstance()->agentCanBuild() || LLSelectMgr::getInstance()->getSelection()->isAttachment(); } +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + // TODO-RLV: include fartouch here? + if ( (rlv_handler_t::isEnabled()) && (enable) ) + { + // We have no way of knowing whether we're being called for "Create" or for "Edit", but we can + // make an educated guess based on the currently active selection which puts us halfway there. + BOOL fActiveSelection = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); + + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) + enable = false; // Edit and rez restricted, disable them both + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (fActiveSelection) ) + enable = false; // Edit restricted and there's an active selection => disable Edit and Create + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && (!fActiveSelection) ) + enable = false; // Rez restricted and there's no active selection => disable Create + } +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(enable); return true; } @@ -1992,7 +2138,10 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t { LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; - if (attachment->getObject()) +// if (attachment->getObject()) +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0c + if ( (attachment->getObject()) && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(curiter->first)) ) ) +// [/RLVa:KB] { new_value = true; break; @@ -2039,6 +2188,9 @@ class LLObjectEnableMute : public view_listener_t BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); BOOL is_self = avatar->isSelf(); new_value = !is_linden && !is_self; +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] } } gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); @@ -2059,6 +2211,12 @@ class LLObjectMute : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(object); if (avatar) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-1.0.0e + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; // Fallback code [see LLObjectEnableMute::handleEvent()] + } +// [/RLVa:KB] id = avatar->getID(); LLNameValue *firstname = avatar->getNVPair("FirstName"); @@ -2107,8 +2265,155 @@ class LLObjectMute : public view_listener_t } }; +class LLObjectEnableCopyUUID : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); + bool new_value = (object != NULL); + + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); + return true; + } +}; + +class LLObjectCopyUUID : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); + if (!object) return true; + + LLUUID id = object->getID(); + + char buffer[UUID_STR_LENGTH]; + id.toString(buffer); + + + gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer)); + + LLSelectMgr::getInstance()->deselectAll(); + return true; + } +}; + + +class LLObjectEnableExport : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + bool new_value = (object != NULL); + if (new_value) + { + LLVOAvatar* avatar = find_avatar_from_object(object); + new_value = (avatar == NULL); + } + if(new_value) + { + + struct ff : public LLSelectedNodeFunctor + { + ff(const LLSD& data) : LLSelectedNodeFunctor() + ,userdata(data) + { + + } + const LLSD& userdata; + virtual bool apply(LLSelectNode* node) + { + if(gAgent.getID()!=node->mPermissions->getCreator()) + { + llwarns<<"Incorrect permission to export"<getSelection()->applyToNodes(the_ff,false)) + { + gMenuHolder->findControl(userdata["control"].asString())->setValue(true); + } + else + { + gMenuHolder->findControl(userdata["control"].asString())->setValue(false); + } + return true; + } + + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); + return true; +#else + } + gMenuHolder->findControl(userdata["control"].asString())->setValue(true); + return true; +#endif + + } +}; + +class LLObjectExport : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (!object) return true; + + LLVOAvatar* avatar = find_avatar_from_object(object); + + if (!avatar) + { + primbackup::getInstance()->pre_export_object(); + } + + return true; + } +}; + + +class LLObjectEnableImport : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + gMenuHolder->findControl(userdata["control"].asString())->setValue(TRUE); + return true; + } +}; + +class LLObjectImport : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + primbackup::getInstance()->import_object(FALSE); + return true; + } +}; + +class LLObjectImportUpload : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + primbackup::getInstance()->import_object(TRUE); + return true; + } +}; + bool handle_go_to() { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && gAgent.forwardGrabbed() && (gRlvHandler.hasLockedAttachment()) ) + { + return true; + } +// [/RLVa:KB] + + // JAMESDEBUG try simulator autopilot + std::vector strings; + std::string val; LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; if (gSavedSettings.getBOOL("DoubleClickTeleport")) { @@ -2200,6 +2505,12 @@ class LLAvatarFreeze : public view_listener_t { LLUUID* avatar_id = new LLUUID( avatar->getID() ); std::string fullname = avatar->getFullname(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) + { + fullname = gRlvHandler.getAnonym(fullname); + } +// [/RLVa:KB] if (!fullname.empty()) { @@ -2225,7 +2536,11 @@ class LLAvatarVisibleDebug : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - bool new_value = gAgent.isGodlike(); + //bool new_value = gAgent.isGodlike(); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + // TODO-RLVa: can you actually use this to cheat anything? + bool new_value = gAgent.isGodlike() && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -2337,6 +2652,12 @@ class LLAvatarEject : public view_listener_t MenuCallbackData *data = new MenuCallbackData; (*data).avatar_id = avatar->getID(); std::string fullname = avatar->getFullname(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) + { + fullname = gRlvHandler.getAnonym(fullname); + } +// [/RLVa:KB] const LLVector3d& pos = avatar->getPositionGlobal(); LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel(); @@ -2418,6 +2739,13 @@ class LLAvatarGiveCard : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; + } +// [/RLVa:KB] + llinfos << "handle_give_card()" << llendl; LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if(dest && dest->isAvatar()) @@ -2667,6 +2995,13 @@ class LLSelfStandUp : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) + { + return true; + } +// [/RLVa:KB] + gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); return true; } @@ -2676,7 +3011,10 @@ class LLSelfEnableStandUp : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting; +// bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting; +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT); +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -2851,6 +3189,11 @@ class LLAvatarEnableAddFriend : public view_listener_t { LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); bool new_value = avatar && !is_agent_friend(avatar->getID()); + +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -2909,6 +3252,15 @@ bool handle_sit_or_stand() return true; } +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && + ( ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting)) || + (gRlvHandler.hasBehaviour(RLV_BHVR_SIT)) ) ) + { + return true; + } +// [/RLVa:KB] + if (sitting_on_selection()) { gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); @@ -2919,6 +3271,15 @@ bool handle_sit_or_stand() if (object && object->getPCode() == LL_PCODE_VOLUME) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g + if ( (rlv_handler_t::isEnabled()) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) || (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && + (dist_vec_squared(gAgent.getPositionGlobal(), object->getPositionGlobal() + LLVector3d(pick.mObjectOffset)) > 1.5f * 1.5f) ) + { + return true; // Don't allow sitting farther away than 1.5m under @sittp=n or @fartouch=n + } +// [/RLVa:KB] + gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); @@ -2956,6 +3317,13 @@ class LLLandSit : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) + { + return true; + } +// [/RLVa:KB] + gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); LLViewerParcelMgr::getInstance()->deselectLand(); @@ -3266,6 +3634,14 @@ class LLEditDuplicate : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && + (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) + { + return true; + } +// [/RLVa:KB] + if(LLEditMenuHandler::gEditMenuHandler) { LLEditMenuHandler::gEditMenuHandler->duplicate(); @@ -3279,6 +3655,13 @@ class LLEditEnableDuplicate : public view_listener_t bool handleEvent(LLPointer event, const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDuplicate(); +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (new_value) && (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && + (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) + { + new_value = false; + } +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -3664,6 +4047,11 @@ class LLToolsTakeCopy : public view_listener_t bool handleEvent(LLPointer event, const LLSD& userdata) { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | Modified: RLVa-1.0.0b + // NOTE: we need to handle "Take Copy" because it will force a sim-side unsit if we're sitting on the selection, + // but we do want to allow "Take Copy" under @rez=n so that's why we explicitly check for @unsit=n here + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (!rlvCanDeleteOrReturn()) ) return true; +// [/RLVa:KB] const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); @@ -3679,6 +4067,9 @@ class LLObjectReturn : public view_listener_t bool handleEvent(LLPointer event, const LLSD& userdata) { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) return true; +// [/RLVa:KB] mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); @@ -3748,6 +4139,14 @@ class LLObjectEnableReturn : public view_listener_t } } #endif + +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (new_value) && (rlv_handler_t::isEnabled()) ) + { + new_value = rlvCanDeleteOrReturn(); + } +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -3769,6 +4168,13 @@ void handle_take() return; } +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) + { + return; + } +// [/RLVa:KB] + BOOL you_own_everything = TRUE; BOOL locked_but_takeable_object = FALSE; LLUUID category_id; @@ -3890,6 +4296,13 @@ BOOL enable_take() return FALSE; } +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) + { + return FALSE; + } +// [/RLVa:KB] + for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) { @@ -4212,6 +4625,21 @@ class LLToolsEnableUnlink : public view_listener_t new_value = true; } } + +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g + // The user might not be allowed to unlink this object due to RLV settings, + // because it would unsit them if they are sitting on the object. + if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && + (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) + { + // Allow if the avie isn't sitting on any of the selected objects + LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); + RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); + if (handleSel->getFirstRootNode(&func, TRUE)) + new_value = false; + } +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -4221,6 +4649,19 @@ class LLToolsUnlink : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g + // The user might not be allowed to unlink this object due to RLV settings, + // because it would unsit them if they are sitting on the object. + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) + { + // Allow if the avie isn't sitting on any of the selected objects + LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); + RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); + if (handleSel->getFirstRootNode(&func, TRUE)) + return true; + } +// [/RLVa:KB] + LLSelectMgr::getInstance()->sendDelink(); return true; } @@ -4240,6 +4681,13 @@ class LLToolsReleaseKeys : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + return true; + } +// [/RLVa:KB] + gAgent.forceReleaseControls(); return true; @@ -4250,7 +4698,11 @@ class LLToolsEnableReleaseKeys : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + gMenuHolder->findControl(userdata["control"].asString())->setValue( + gAgent.anyControlGrabbed() && ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment() ) ) ); +// [/RLVa:KB] + //gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); return true; } }; @@ -4358,6 +4810,15 @@ class LLEditEnableDelete : public view_listener_t bool handleEvent(LLPointer event, const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); + +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + // NOTE: we want to disable delete on objects but not disable delete on text + if ( (new_value) && (rlv_handler_t::isEnabled()) && (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) + { + new_value = rlvCanDeleteOrReturn(); + } +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -4367,6 +4828,15 @@ class LLEditDelete : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + // NOTE: we want to disable delete on objects but not disable delete on text + if ( (rlv_handler_t::isEnabled()) && (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) && + (!rlvCanDeleteOrReturn()) ) + { + return true; + } +// [/RLVa:KB] + // If a text field can do a deletion, it gets precedence over deleting // an object in the world. if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) @@ -4398,6 +4868,12 @@ class LLObjectEnableDelete : public view_listener_t # endif LLSelectMgr::getInstance()->canDoDelete(); #endif +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (new_value) && (rlv_handler_t::isEnabled()) ) + { + new_value = rlvCanDeleteOrReturn(); + } +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -4416,6 +4892,13 @@ class LLObjectDelete : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) + { + return true; + } +// [/RLVa:KB] + if (LLSelectMgr::getInstance()) { LLSelectMgr::getInstance()->doDelete(); @@ -4765,6 +5248,12 @@ class LLWorldCreateLandmark : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return true; + } +// [/RLVa:KB] LLViewerRegion* agent_region = gAgent.getRegion(); if(!agent_region) { @@ -4872,6 +5361,13 @@ class LLAvatarInviteToGroup : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; + } +// [/RLVa:KB] + LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar) { @@ -4885,6 +5381,13 @@ class LLAvatarAddFriend : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; // Fallback code [see LLAvatarEnableAddFriend::handleEvent()] + } +// [/RLVa:KB] + LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar && !is_agent_friend(avatar->getID())) { @@ -4972,6 +5475,12 @@ class LLEnablePayObject : public view_listener_t } } } + +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + // Don't enable "Pay..." on the avatar pie menu under @shownames=n + new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (avatar == NULL); +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -5160,6 +5669,12 @@ class LLShowFloater : public view_listener_t } else if (floater_name == "buy land") { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return true; + } +// [/RLVa:KB] if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); @@ -5341,6 +5856,13 @@ class LLShowAgentProfile : public view_listener_t } else if (userdata.asString() == "hit object") { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; + } +// [/RLVa:KB] + LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (objectp) { @@ -5400,6 +5922,13 @@ class LLLandEdit : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) ) + { + return true; + } +// [/RLVa:KB] + if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) { // zoom in if we're looking at the avatar @@ -5484,6 +6013,18 @@ private: LLViewerJointAttachment* attachment_point = NULL; if (index > 0) attachment_point = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); + +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && + ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point + ((index > 0) && (!gRlvHandler.isDetachable(attachment_point->getObject()))) || // Can't replace locked attachment + (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" + { + setObjectSelection(NULL); // Clear the selection or it'll get stuck + return true; + } +// [/RLVa:KB] + confirm_replace_attachment(0, attachment_point); } return true; @@ -5591,6 +6132,24 @@ class LLAttachmentDrop : public view_listener_t return true; } +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if (rlv_handler_t::isEnabled()) + { + if (gRlvHandler.hasLockedAttachment()) + { + // NOTE: copy/paste of the code in enable_detach() + LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach functor; + if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) + return true; + } + else if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) + { + return true; + } + } +// [/RLVa:KB] + // The sendDropAttachment() method works on the list of selected // objects. Thus we need to clear the list, make sure it only // contains the object the user clicked, send the message, @@ -5609,6 +6168,13 @@ void handle_detach_from_avatar(void* user_data) if (attached_object) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0d + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(attached_object)) ) + { + return; + } +// [/RLVa:KB] + gMessageSystem->newMessage("ObjectDetach"); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); @@ -5691,6 +6257,17 @@ class LLAttachmentDetach : public view_listener_t return true; } +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // NOTE: copy/paste of the code in enable_detach() + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach functor; + if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) + return FALSE; + } +// [/RLVa:KB] + // The sendDetach() method works on the list of selected // objects. Thus we need to clear the list, make sure it only // contains the object the user clicked, send the message, @@ -5774,7 +6351,10 @@ class LLAttachmentEnableDrop : public view_listener_t } //now check to make sure that the item is actually in the inventory before we enable dropping it - bool new_value = enable_detach(NULL) && can_build && item; +// bool new_value = enable_detach(NULL) && can_build && item; +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + bool new_value = enable_detach(NULL) && can_build && item && (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)); +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; @@ -5794,6 +6374,20 @@ BOOL enable_detach(void*) // ...if it's you, good to detach if (avatar->getID() == gAgent.getID()) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // NOTE: this code is reused as-is in LLAttachmentDetach::handleEvent() and LLAttachmentDrop::handleEvent() + // so any changes here should be reflected there as well (I think it's in a number of other places as well by now) + + // RELEASE-RLVa: LLSelectMgr::sendDetach() and LLSelectMgr::sendDropAttachment() call sendListToRegions with + // SEND_ONLY_ROOTS so we only need to examine the roots which saves us time + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach functor; + if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) + return FALSE; + } +// [/RLVa:KB] return TRUE; } @@ -5816,6 +6410,25 @@ class LLAttachmentEnableDetach : public view_listener_t // Used to tell if the selected object can be attached to your avatar. BOOL object_selected_and_point_valid(void *user_data) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if (rlv_handler_t::isEnabled()) + { + // RELEASE-RLVa: look at the caller graph for this function on every new release + // -> 1.22.11 and 1.23.4 + // - object_is_wearable() => dead code [user_data == NULL => default attach point => OK!] + // - LLObjectEnableWear::handleEvent() => Rezzed prim / right-click / "Wear" [user_data == NULL => see above] + // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] + // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] + LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; + if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point + ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt->getObject()))) || // Don't allow replacing of locked attachment + (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" + { + return FALSE; + } + } +// [/RLVa:KB] + //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); for (LLObjectSelection::root_iterator iter = selection->root_begin(); @@ -5883,7 +6496,13 @@ BOOL object_attached(void *user_data) { LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; - return attachment->getObject() != NULL; +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + return ( + (attachment->getObject() != NULL) && + ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(attachment->getObject())) ) + ); +// [/RLVa:KB] +// return attachment->getObject() != NULL; } class LLAvatarSendIM : public view_listener_t @@ -5891,6 +6510,12 @@ class LLAvatarSendIM : public view_listener_t bool handleEvent(LLPointer event, const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; + } +// [/RLVa:KB] if(avatar) { std::string name("IM"); @@ -6026,6 +6651,16 @@ class LLToolsSelectedScriptAction : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach functor; + if ( (selectHandle->isAttachment()) && (selectHandle->getFirstNode(&functor)) ) + return true; + } +// [/RLVa:KB] + std::string action = userdata.asString(); if (action == "compile mono") { @@ -6110,12 +6745,30 @@ void handle_dump_image_list(void*) void handle_test_male(void*) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && + ( (gRlvHandler.hasLockedAttachment()) || + (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) + { + return; + } +// [/RLVa:KB] + wear_outfit_by_name("Male Shape & Outfit"); //gGestureList.requestResetFromServer( TRUE ); } void handle_test_female(void*) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && + ( (gRlvHandler.hasLockedAttachment()) || + (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) + { + return; + } +// [/RLVa:KB] + wear_outfit_by_name("Female Shape & Outfit"); //gGestureList.requestResetFromServer( FALSE ); } @@ -6258,6 +6911,22 @@ BOOL enable_more_than_one_selected(void* ) static bool is_editable_selected() { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c + // RELEASE-RLVa: check that this still isn't called by anything but script actions in the Tools menu + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); + + // NOTE: this is called for 5 different menu items so we'll trade accuracy for efficiency and only + // examine root nodes (LLToolsSelectedScriptAction::handleEvent() will catch what we miss) + RlvSelectHasLockedAttach functor; + if ( (selectHandle->isAttachment()) && (selectHandle->getFirstRootNode(&functor)) ) + { + return false; + } + } +// [/RLVa:KB] + return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); } @@ -6304,7 +6973,12 @@ class LLToolsEnableTakeCopy : public view_listener_t { virtual bool apply(LLViewerObject* obj) { - return (!obj->permCopy() || obj->isAttachment()); +// return (!obj->permCopy() || obj->isAttachment()); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + return (!obj->permCopy() || obj->isAttachment()) || + ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && + (gAgent.getAvatarObject()->getRoot() == obj) ); +// [/RLVa:KB] } } func; const bool firstonly = true; @@ -6507,6 +7181,9 @@ class LLWorldEnableCreateLandmark : public view_listener_t { bool new_value = gAgent.isGodlike() || (gAgent.getRegion() && gAgent.getRegion()->getAllowLandmark()); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC); +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -6559,7 +7236,11 @@ BOOL enable_god_customer_service(void*) BOOL enable_god_basic(void*) { - return gAgent.getGodLevel() > GOD_NOT; +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + // RELEASE-RLVa: check that this function isn't used for anything other than to enable/disable showing the "God Tools..." floater + return (gAgent.getGodLevel() > GOD_NOT) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); +// [/RLVa:KB] + //return gAgent.getGodLevel() > GOD_NOT; } #if 0 // 1.9.2 @@ -7070,6 +7751,13 @@ class LLViewHighlightTransparent : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) + if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) + { + return true; + } +// [/RLVa:KB] + LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; return true; } @@ -7117,6 +7805,13 @@ class LLViewShowHUDAttachments : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (LLPipeline::sShowHUDAttachments) && (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedHUD()) ) + { + return true; + } +// [/RLVa:KB] + LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; return true; } @@ -7175,6 +7870,15 @@ class LLEditEnableTakeOff : public view_listener_t { new_value = LLAgent::selfHasWearable((void *)WT_SKIRT); } + +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) + // Why aren't they using LLWearable::typeNameToType()? *confuzzled* + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isRemovable(LLWearable::typeNameToType(clothing))) ) + { + new_value = false; + } +// [/RLVa:KB] + gMenuHolder->findControl(control_name)->setValue(new_value); return true; } @@ -7272,6 +7976,13 @@ class LLWorldEnvSettings : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) + { + return true; + } +// [/RLVa:KB] + std::string tod = userdata.asString(); LLVector3 sun_direction; @@ -7349,6 +8060,13 @@ class LLWorldWaterSettings : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) + { + return true; + } +// [/RLVa:KB] + // if not there or is hidden, show it if( !LLFloaterWater::isOpen() || !LLFloaterWater::instance()->getVisible()) { @@ -7379,6 +8097,13 @@ class LLWorldDayCycle : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) + { + return true; + } +// [/RLVa:KB] + LLFloaterDayCycle::show(); return true; } @@ -9613,6 +10338,49 @@ class LLAvatarReportAbuse : public view_listener_t +/////////////// +// RLVa Main // +/////////////// + + +class RLVaMainToggle : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + rlvDbgToggleEnabled(NULL); + return true; + } +}; + +class RLVaMainCheck : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + bool new_value = rlvDbgGetEnabled(NULL); + std::string control_name = userdata["control"].asString(); + gMenuHolder->findControl(control_name)->setValue(new_value); + return true; + } +}; + + + +//////////////////// +// RLVa BEHAVIORS // +//////////////////// + + +class RLVaBehaviorsShow : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + RlvFloaterBehaviour::show(NULL); + return true; + } +}; + + + static void addMenu(view_listener_t *menu, const char *name) { sMenus.push_back(menu); @@ -9778,6 +10546,10 @@ void initialize_menus() addMenu(new LLObjectBuy(), "Object.Buy"); addMenu(new LLObjectEdit(), "Object.Edit"); addMenu(new LLObjectInspect(), "Object.Inspect"); + addMenu(new LLObjectCopyUUID(), "Object.CopyUUID"); + addMenu(new LLObjectExport(), "Object.Export"); + addMenu(new LLObjectImport(), "Object.Import"); + addMenu(new LLObjectImportUpload(), "Object.ImportUpload"); addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); @@ -9788,6 +10560,9 @@ void initialize_menus() addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); addMenu(new LLObjectEnableMute(), "Object.EnableMute"); addMenu(new LLObjectEnableBuy(), "Object.EnableBuy"); + addMenu(new LLObjectEnableCopyUUID(), "Object.EnableCopyUUID"); + addMenu(new LLObjectEnableExport(), "Object.EnableExport"); + addMenu(new LLObjectEnableImport(), "Object.EnableImport"); /*addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch"); addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); @@ -9988,4 +10763,11 @@ void initialize_menus() addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions"); addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); addMenu(new LLAdvancedLeaveAdminStatus(), "Advanced.LeaveAdminStatus"); + + + // RLVa + addMenu(new RLVaMainToggle(), "RLVa.Main.Toggle"); + addMenu(new RLVaMainCheck(), "RLVa.Main.Enabled"); + addMenu(new RLVaBehaviorsShow(), "RLVa.Behaviors.Show"); + } -- cgit v1.1