diff --git a/.hgpatchinfo/RLVa.dep b/.hgpatchinfo/RLVa.dep new file mode 100644 index 0000000000..060eb10921 --- /dev/null +++ b/.hgpatchinfo/RLVa.dep @@ -0,0 +1 @@ +9ea58fa9198ff25fa7ff9446a1bbe52b01076f16 \ No newline at end of file diff --git a/.hgtags b/.hgtags index a2f9903e0c..5d1cc134f0 100644 --- a/.hgtags +++ b/.hgtags @@ -876,3 +876,16 @@ e59ffd3fe0838ae6b09b242a6e9df71761b88f41 SL-3.4.1 16310aabccf315870f7cc9bf966926c0ad6954fa SL-3.4.2 0a2ca6546b499239afeb66d17b2fadbcdbe36ab1 SL-3.4.3 e1bb1ae7d8b12faeb37933a737c199cc9b9f89cc SL-3.4.4 +425f96b1e81e01644bf5e951961e7d1023bffb89 RLVa-1.2.0 +fc0cbb86f5bd6e7737159e35aea2c4cf9f619b62 RLVa-1.2.1 +43cb7dc1804de1a25c0b2b3f0715584af1f8b470 RLVa-1.2.2 +89532c8dfd5b6c29f1cb032665b44a74a52452e1 RLVa-1.3.0 +7bc5039ccf0b36eafbf6ce33a52b5e26332aa04c RLVa-1.3.1 +a563f7e215c7883c1cfd20908085687a0ed96284 RLVa-1.4.0 +40644beae9c4a617504163d5c9f195dc7bfff1b4 RLVa-1.4.1 +8787094c309a44ca32b7472acc9217a3c37f00c3 RLVa-1.4.2 +11c6c85ddd223bcbd6b3afc53f9a0f5fd349ba65 RLVa-1.4.3 +53b44208d44a601fe24e78c1a1909dc82356cded RLVa-1.4.4 +6522747820037cc11e5b7d0491a0a9808a958709 RLVa-1.4.5 +0c8f23b2c4cf96d1a08bd527b3ccb6339a9fdb60 RLVa-1.4.6 +674db463770b78f836fc9c87a1b2235e212a576c RLVa-1.4.7 diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp index 38aa1bbeb2..00c118be51 100644 --- a/indra/integration_tests/llui_libtest/llui_libtest.cpp +++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp @@ -52,6 +52,17 @@ LLControlGroup gSavedSettings("Global"); // saved at end of session LLControlGroup gSavedPerAccountSettings("PerAccount"); // saved at end of session LLControlGroup gWarningSettings("Warnings"); // persists ignored dialogs/warnings +// [RLVa:KB] - Checked: 2010-11-12 (RLVa-1.2.2a) | Added: RLVa-1.2.2a +#include "llavatarname.h" + +// Stub for rlvGetAnonym +const std::string& rlvGetAnonym(const LLAvatarName& avName) +{ + static std::string strAnonym = "A resident"; + return strAnonym; +} +// [/RLVa:KB] + // We can't create LLImageGL objects because we have no window or rendering // context. Provide enough of an LLUIImage to test the LLUI library without // an underlying image. diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 2d5744bb5e..a83fa5df8b 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -464,7 +464,10 @@ void LLAvatarAppearance::computeBodySize() F32 old_offset = mAvatarOffset.mV[VZ]; - mAvatarOffset.mV[VZ] = getVisualParamWeight(11001); +// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) + mAvatarOffset.mV[VZ] = getAvatarOffset(); +// [/RLVa:KB] +// mAvatarOffset.mV[VZ] = getVisualParamWeight(11001); mPelvisToFoot = hip.mV[VZ] * pelvis_scale.mV[VZ] - knee.mV[VZ] * hip_scale.mV[VZ] - @@ -495,6 +498,13 @@ void LLAvatarAppearance::computeBodySize() } } +// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) +F32 LLAvatarAppearance::getAvatarOffset() /*const*/ +{ + return getVisualParamWeight(11001); +} +// [/RLVa:KB] + //----------------------------------------------------------------------------- // parseSkeletonFile() //----------------------------------------------------------------------------- diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index bce2540258..f554468184 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -145,6 +145,9 @@ protected: virtual void buildCharacter(); virtual BOOL loadAvatar(); virtual void bodySizeChanged() = 0; +// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) + virtual F32 getAvatarOffset() /*const*/; +// [/RLVa:KB] BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num); BOOL allocateCharacterJoints(U32 num); diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp index 68fdcca782..ae67f36194 100644 --- a/indra/llappearance/llwearabledata.cpp +++ b/indra/llappearance/llwearabledata.cpp @@ -102,16 +102,36 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type, llwarns << "Null wearable sent for type " << type << llendl; return MAX_CLOTHING_PER_TYPE; } - if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_CLOTHING_PER_TYPE) +// [RLVa:KB] - Checked: 2010-06-08 (RLVa-1.2.0) + if ( (type < LLWearableType::WT_COUNT) && (mWearableDatas[type].size() < MAX_CLOTHING_PER_TYPE) ) { - mWearableDatas[type].push_back(wearable); + // Don't add the same wearable twice + U32 idxWearable = getWearableIndex(wearable); + llassert(MAX_CLOTHING_PER_TYPE == idxWearable); // pushWearable() on an already added wearable is a bug *somewhere* + if (MAX_CLOTHING_PER_TYPE == idxWearable) + { + mWearableDatas[type].push_back(wearable); + idxWearable = mWearableDatas[type].size() - 1; + } + if (trigger_updated) { const BOOL removed = FALSE; wearableUpdated(wearable, removed); } - return mWearableDatas[type].size()-1; + return idxWearable; } +// [/RLVa:KB] +// if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_CLOTHING_PER_TYPE) +// { +// mWearableDatas[type].push_back(wearable); +// if (trigger_updated) +// { +// const BOOL removed = FALSE; +// wearableUpdated(wearable, removed); +// } +// return mWearableDatas[type].size()-1; +// } return MAX_CLOTHING_PER_TYPE; } @@ -160,16 +180,16 @@ void LLWearableData::popWearable(const LLWearableType::EType type, U32 index) } } -void LLWearableData::clearWearableType(const LLWearableType::EType type) -{ - wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type); - if (wearable_iter == mWearableDatas.end()) - { - return; - } - wearableentry_vec_t& wearable_vec = wearable_iter->second; - wearable_vec.clear(); -} +//void LLWearableData::clearWearableType(const LLWearableType::EType type) +//{ +// wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type); +// if (wearable_iter == mWearableDatas.end()) +// { +// return; +// } +// wearableentry_vec_t& wearable_vec = wearable_iter->second; +// wearable_vec.clear(); +//} bool LLWearableData::swapWearables(const LLWearableType::EType type, U32 index_a, U32 index_b) { diff --git a/indra/llappearance/llwearabledata.h b/indra/llappearance/llwearabledata.h index 3e92f2ead8..3817b27b3c 100644 --- a/indra/llappearance/llwearabledata.h +++ b/indra/llappearance/llwearabledata.h @@ -77,7 +77,7 @@ protected: virtual void wearableUpdated(LLWearable *wearable, BOOL removed); void popWearable(LLWearable *wearable); void popWearable(const LLWearableType::EType type, U32 index); - void clearWearableType(const LLWearableType::EType type); +// void clearWearableType(const LLWearableType::EType type); bool swapWearables(const LLWearableType::EType type, U32 index_a, U32 index_b); private: diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index 65afb0adde..7ee49d21e8 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -72,6 +72,12 @@ class LLWearableDictionary : public LLSingleton, { public: LLWearableDictionary(); + +// [RLVa:KB] - Checked: 2010-03-03 (RLVa-1.2.0a) | Added: RLVa-1.2.0a +protected: + // The default implementation asserts on 'notFound()' and returns -1 which isn't a valid EWearableType + virtual LLWearableType::EType notFound() const { return LLWearableType::WT_INVALID; } +// [/RLVa:KB] }; LLWearableDictionary::LLWearableDictionary() diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h index f5b242fdfc..746103b911 100644 --- a/indra/llcommon/llchat.h +++ b/indra/llcommon/llchat.h @@ -81,6 +81,10 @@ public: mChatType(CHAT_TYPE_NORMAL), mAudible(CHAT_AUDIBLE_FULLY), mMuted(FALSE), +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.0.0a + mRlvLocFiltered(FALSE), + mRlvNamesFiltered(FALSE), +// [/RLVa:KB] mTime(0.0), mTimeStr(), mPosAgent(), @@ -98,6 +102,10 @@ public: EChatType mChatType; EChatAudible mAudible; BOOL mMuted; // pass muted chat to maintain list of chatters +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.0.0a + BOOL mRlvLocFiltered; + BOOL mRlvNamesFiltered; +// [/RLVa:KB] F64 mTime; // viewer only, seconds from viewer start std::string mTimeStr; LLVector3 mPosAgent; diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index a6e2c89ba4..3116111980 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -47,6 +47,11 @@ namespace LLAvatarNameCache // supports it. bool sUseDisplayNames = true; +// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c + // RLVa override for display names + bool sForceDisplayNames = false; +// [/RLVa:KB] + // Cache starts in a paused state until we can determine if the // current region supports display names. bool sRunning = false; @@ -716,9 +721,28 @@ LLAvatarNameCache::callback_connection_t LLAvatarNameCache::get(const LLUUID& ag return connection; } +// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c +bool LLAvatarNameCache::getForceDisplayNames() +{ + return sForceDisplayNames; +} + +void LLAvatarNameCache::setForceDisplayNames(bool force) +{ + sForceDisplayNames = force; + if ( (!sUseDisplayNames) && (force) ) + { + setUseDisplayNames(true); + } +} +// [/RLVa:KB] void LLAvatarNameCache::setUseDisplayNames(bool use) { +// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c + // We need to force the use of the "display names" cache when @shownames=n restricted (and disallow toggling it) + use |= getForceDisplayNames(); +// [/RLVa:KB] if (use != sUseDisplayNames) { sUseDisplayNames = use; diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index 79f170f7c8..b879934786 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -81,6 +81,11 @@ namespace LLAvatarNameCache void setUseDisplayNames(bool use); bool useDisplayNames(); +// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c + bool getForceDisplayNames(); + void setForceDisplayNames(bool force); +// [/RLVa:KB] + void erase(const LLUUID& agent_id); /// Provide some fallback for agents that return errors diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 306caf2b91..a15013c011 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -45,6 +45,10 @@ std::set LLFloaterReg::sAlwaysShowableList; static LLFloaterRegListener sFloaterRegListener; +// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.4.0a) | Modified: RLVa-1.2.0a +LLFloaterReg::validate_signal_t LLFloaterReg::mValidateSignal; +// [/RLVa:KB] + //******************************************************* //static @@ -240,12 +244,23 @@ LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::str // Visibility Management +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 +//static +bool LLFloaterReg::canShowInstance(const std::string& name, const LLSD& key) +{ + return mValidateSignal(name, key); +} +// [/RLVa:KB] + //static LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, BOOL focus) { - if( sBlockShowFloaters - // see EXT-7090 - && sAlwaysShowableList.find(name) == sAlwaysShowableList.end()) +// if( sBlockShowFloaters +// // see EXT-7090 +// && sAlwaysShowableList.find(name) == sAlwaysShowableList.end()) +// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.4.0a) | Modified: RLVa-1.2.0a + if ( (sBlockShowFloaters && sAlwaysShowableList.find(name) == sAlwaysShowableList.end()) || (!mValidateSignal(name, key)) ) +// [/RLVa:KB] return 0;// LLFloater* instance = getInstance(name, key); if (instance) @@ -496,8 +511,16 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& } else if (!instance->isShown()) { - instance->openFloater(key); - instance->setVisibleAndFrontmost(); +// [RLVa:KB] - Checked: 2011-12-17 (RLVa-1.4.5a) | Added: RLVa-1.4.5a + // [See LLFloaterReg::showInstance()] + if ( ((!sBlockShowFloaters) || (sAlwaysShowableList.find(name) != sAlwaysShowableList.end())) && (mValidateSignal(name, key)) ) + { + instance->openFloater(key); + instance->setVisibleAndFrontmost(); + } +// [/RLVa:KB] +// instance->openFloater(key); +// instance->setVisibleAndFrontmost(); } else if (!instance->isFrontmost()) { diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index a1e1f8a988..78a8b7676c 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -31,6 +31,10 @@ #include "llsd.h" #include +// [RLVa:KB] - Checked: 2011-05-25 (RLVa-1.4.0a) +#include +#include "llboost.h" +// [/RLVa:KB] //******************************************************* // @@ -71,6 +75,15 @@ private: */ static std::set sAlwaysShowableList; +// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.4.0a) | Modified: RLVa-1.2.0a + // Used to determine whether a floater can be shown +public: + typedef boost::signals2::signal validate_signal_t; + static boost::signals2::connection setValidateCallback(const validate_signal_t::slot_type& cb) { return mValidateSignal.connect(cb); } +private: + static validate_signal_t mValidateSignal; +// [/RLVa:KB] + public: // Registration @@ -99,6 +112,10 @@ public: static const_instance_list_t& getFloaterList(const std::string& name); // Visibility Management +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + // return false if floater can not be shown (=doesn't pass the validation filter) + static bool canShowInstance(const std::string& name, const LLSD& key = LLSD()); +// [/RLVa:KB] // return NULL if instance not found or can't create instance (no builder) static LLFloater* showInstance(const std::string& name, const LLSD& key = LLSD(), BOOL focus = FALSE); // Close a floater (may destroy or set invisible) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 2bf88532c6..aa8f06f7a4 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -888,6 +888,13 @@ std::string LLNotification::getLabel() const return (mTemplatep ? label : ""); } +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a +bool LLNotification::hasLabel() const +{ + return !mTemplatep->mLabel.empty(); +} +// [/SL:KB] + std::string LLNotification::getURL() const { if (!mTemplatep) diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index d7534c416d..4119118a07 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -507,6 +507,10 @@ public: return mTimestamp; } +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a + bool hasLabel() const; +// [/SL:KB] + std::string getType() const; std::string getMessage() const; std::string getFooter() const; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 740c1aa0de..a8deb5398b 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -1206,6 +1206,9 @@ void LLToolBarButton::setEnabled(BOOL enabled) mImageOverlayColor = mImageOverlayDisabledColor; mImageOverlaySelectedColor = mImageOverlayDisabledColor; } +// [RLVa:KB] - Checked: 2011-12-17 (RLVa-1.4.5a) | Added: RLVa-1.4.5a + LLButton::setEnabled(enabled); +// [/RLVa:KB] } const std::string LLToolBarButton::getToolTip() const diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index fc769b6da7..f9594f00c8 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -178,6 +178,9 @@ void LLUI::initClass(const settings_map_t& settings, // Used by menus along with Floater.Toggle to display visibility as a check-mark LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD())); LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD())); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.CanShow", boost::bind(&LLFloaterReg::canShowInstance, _2, LLSD())); +// [/RLVa:KB] // Parse the master list of commands LLCommandManager::load(); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index a9e8fbb4e4..e5df9ba8dd 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -616,6 +616,27 @@ std::string LLUrlEntryAgentUserName::getName(const LLAvatarName& avatar_name) return avatar_name.mUsername.empty() ? avatar_name.getLegacyName() : avatar_name.mUsername; } +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + +// Defined in rlvcommon.cpp - redirects to RlvStrings::getAnonym() since we can't really get to that class from here +extern const std::string& rlvGetAnonym(const LLAvatarName& avName); + +// +// LLUrlEntryAgentRLVAnonymizedName Describes an RLV anonymized agent name Url, e.g., +// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/rlvanonym +// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/rlvanonym +// +LLUrlEntryAgentRLVAnonymizedName::LLUrlEntryAgentRLVAnonymizedName() +{ + mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/rlvanonym", boost::regex::perl|boost::regex::icase); +} + +std::string LLUrlEntryAgentRLVAnonymizedName::getName(const LLAvatarName& avatar_name) +{ + return rlvGetAnonym(avatar_name); +} +// [/RLVa:KB] + // // LLUrlEntryGroup Describes a Second Life group Url, e.g., // secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 5f82721c0f..8834a73a3a 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -241,6 +241,21 @@ private: /*virtual*/ std::string getName(const LLAvatarName& avatar_name); }; +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a +/// +/// LLUrlEntryAgentRLVAnonymizedName Describes an RLV anonymized agent name Url, e.g., +/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/rlvanonym +/// that diplays an anonym (based on the display name) for an avatar +/// such as "An individual" +class LLUrlEntryAgentRLVAnonymizedName : public LLUrlEntryAgentName +{ +public: + LLUrlEntryAgentRLVAnonymizedName(); +private: + /*virtual*/ std::string getName(const LLAvatarName& avatar_name); +}; +// [/RLVa:KB] + /// /// LLUrlEntryGroup Describes a Second Life group Url, e.g., /// secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 523ee5d78c..877a1e6e6b 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -37,7 +37,10 @@ void LLUrlRegistryNullCallback(const std::string &url, const std::string &label, LLUrlRegistry::LLUrlRegistry() { - mUrlEntry.reserve(20); +// mUrlEntry.reserve(20); +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + mUrlEntry.reserve(21); +// [/RLVa:KB] // Urls are matched in the order that they were registered registerUrl(new LLUrlEntryNoLink()); @@ -48,6 +51,9 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntryAgentCompleteName()); registerUrl(new LLUrlEntryAgentDisplayName()); registerUrl(new LLUrlEntryAgentUserName()); +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + registerUrl(new LLUrlEntryAgentRLVAnonymizedName()); +// [/RLVa:KB] // LLUrlEntryAgent*Name must appear before LLUrlEntryAgent since // LLUrlEntryAgent is a less specific (catchall for agent urls) registerUrl(new LLUrlEntryAgent()); diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 74ed72ef97..8749ea90bd 100644 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -34,6 +34,15 @@ #include +// [RLVa:KB] - Checked: 2010-11-12 (RLVa-1.2.2a) | Added: RLVa-1.2.2a +// Stub for rlvGetAnonym +const std::string& rlvGetAnonym(const LLAvatarName& avName) +{ + static std::string strAnonym = "A resident"; + return strAnonym; +} +// [/RLVa:KB] + // Stub for LLAvatarNameCache bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) { diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 46de945f87..4f916c022d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -652,6 +652,14 @@ set(viewer_SOURCE_FILES llxmlrpctransaction.cpp noise.cpp pipeline.cpp + rlvhandler.cpp + rlvhelper.cpp + rlvcommon.cpp + rlvlocks.cpp + rlvinventory.cpp + rlvextensions.cpp + rlvfloaters.cpp + rlvui.cpp ) set(VIEWER_BINARY_NAME "secondlife-bin" CACHE STRING @@ -1213,6 +1221,15 @@ set(viewer_HEADER_FILES macmain.h noise.h pipeline.h + rlvdefines.h + rlvhandler.h + rlvhelper.h + rlvcommon.h + rlvlocks.h + rlvinventory.h + rlvextensions.h + rlvfloaters.h + rlvui.h VertexCache.h VorbisFramework.h ) diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 73df064ab2..ce91ae9445 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -7,6 +7,8 @@ tooltip_ref="Command_AboutLand_Tooltip" execute_function="Floater.ToggleOrBringToFront" execute_parameters="about_land" + is_enabled_function="Floater.CanShow" + is_enabled_parameters="about_land" is_running_function="Floater.IsOpen" is_running_parameters="about_land" /> @@ -97,6 +99,8 @@ tooltip_ref="Command_Inventory_Tooltip" execute_function="Floater.ToggleOrBringToFront" execute_parameters="inventory" + is_enabled_function="RLV.EnableIfNot" + is_enabled_parameters="showinv" is_running_function="Floater.IsOpen" is_running_parameters="inventory" /> @@ -107,6 +111,8 @@ tooltip_ref="Command_Map_Tooltip" execute_function="Floater.ToggleOrBringToFront" execute_parameters="world_map" + is_enabled_function="RLV.EnableIfNot" + is_enabled_parameters="showworldmap" is_running_function="Floater.IsOpen" is_running_parameters="world_map" /> @@ -124,6 +130,8 @@ tooltip_ref="Command_MiniMap_Tooltip" execute_function="Floater.ToggleOrBringToFront" execute_parameters="mini_map" + is_enabled_function="RLV.EnableIfNot" + is_enabled_parameters="showminimap" is_running_function="Floater.IsOpen" is_running_parameters="mini_map" /> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 68c49d7dff..d65d1b0a04 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2,6 +2,248 @@ + RestrainedLove + + Comment + Toggles the RestrainedLove features (BDSM lockable toys support). Needs a restart of the viewer. + Persist + 1 + Type + Boolean + Value + 1 + + RestrainedLoveDebug + + Comment + Toggles the RestrainedLove debug mode (displays the commands when in debug mode). + Persist + 1 + Type + Boolean + Value + 0 + + RestrainedLoveCanOOC + + Comment + Allows sending OOC chat when send chat restricted, or seeing OOC chat when receive chat restricted + Persist + 1 + Type + Boolean + Value + 1 + + RestrainedLoveForbidGiveToRLV + + Comment + When TRUE, forbids to give sub-folders to the #RLV RestrainedLove folder. + Persist + 1 + Type + Boolean + Value + 0 + + RestrainedLoveNoSetEnv + + Comment + When TRUE, forbids to set the environment (time of day and Windlight settings) via RestrainedLove. Needs a restart of the viewer. + Persist + 1 + Type + Boolean + Value + 0 + + RestrainedLoveOffsetAvatarZ + + Comment + Offset the avatar. + Persist + 1 + Type + F32 + Value + 0.0 + + RestrainedLoveReplaceWhenFolderBeginsWith + + Comment + If a folder name begins with this string, its attach behavior will always be "replace", never "stack". Default is blank (disabled). + Persist + 1 + Type + String + Value + + + RestrainedLoveShowEllipsis + + Comment + When TRUE, show "..." when someone speaks, while the avatar is prevented from hearing. When FALSE, don't show anything. + Persist + 1 + Type + Boolean + Value + 1 + + RestrainedLoveStackWhenFolderBeginsWith + + Comment + If a folder name begins with this string, its attach behavior will always be "stack", never "replace". Default is "+". + Persist + 1 + Type + String + Value + + + + RLVaDebugDeprecateExplicitPoint + + Comment + Ignore attachment point names on inventory items and categories (incomplete) + Persist + 1 + Type + Boolean + Value + 0 + + RLVaDebugHideUnsetDuplicate + + Comment + Suppresses reporting "unset" or "duplicate" command restrictions when RestrainedLoveDebug is TRUE + Persist + 1 + Type + Boolean + Value + 0 + + RLVaEnableCompositeFolders + + Comment + Enables composite folders for shared inventory + Persist + 1 + Type + Boolean + Value + 0 + + RLVaEnableLegacyNaming + + Comment + Enables legacy naming convention for folders + Persist + 1 + Type + Boolean + Value + 1 + + RLVaEnableSharedWear + + Comment + Attachments in the shared #RLV folder can be force-attached without needing to specify an attachment point + Persist + 1 + Type + Boolean + Value + 1 + + RLVaHideLockedLayers + + Comment + Hides "remove outfit" restricted worn clothing layers from @getoufit + Persist + 1 + Type + Boolean + Value + 0 + + RLVaHideLockedAttachments + + Comment + Hides non-detachable worn attachments from @getattach + Persist + 1 + Type + Boolean + Value + 0 + + RLVaSharedInvAutoRename + + Comment + Automatically renames shared inventory items when worn + Persist + 1 + Type + Boolean + Value + 1 + + RLVaShowAssertionFailures + + Comment + Notify the user when an assertion fails + Persist + 1 + Type + Boolean + Value + 1 + + RLVaShowNameTags + + Comment + Display of names above avatars is subject to the general "Show Names" setting when @shownames=n restricted + Persist + 1 + Type + Boolean + Value + 0 + + RLVaTopLevelMenu + + Comment + Show the RLVa specific menu as a top level menu + Persist + 1 + Type + Boolean + Value + 1 + + RLVaWearReplaceUnlocked + + Comment + Don't block wear replace when at least one attachment on the target attachment point is non-detachable + Persist + 1 + Type + Boolean + Value + 0 + + WarnFirstRLVGiveToRLV + + Comment + Enables FirstRLVGiveToRLV warning dialog + Persist + 1 + Type + Boolean + Value + 1 + CrashHostUrl Comment @@ -3930,6 +4172,17 @@ Value 255 + ForceInitialCOFDelay + + Comment + Number of seconds to delay initial processing of COF contents + Persist + 1 + Type + F32 + Value + 0.0 + ForceShowGrid Comment @@ -3952,6 +4205,17 @@ Value 0 + ForceMissingType + + Comment + Force this wearable type to be missing from COF + Persist + 1 + Type + U32 + Value + 255 + FreezeTime Comment @@ -6274,6 +6538,17 @@ Value 305 + NotificationCanEmbedInIM + + Comment + Controls notification panel embedding in IMs (0 = default, 1 = focused, 2 = never) + Persist + 1 + Type + S32 + Value + 0 + NotificationToastLifeTime Comment @@ -10052,6 +10327,17 @@ Value 1 + NearbyListShowMap + + Comment + Show/hide map above nearby people list + Persist + 1 + Type + Boolean + Value + 1 + NearbyListShowIcons Comment @@ -12658,39 +12944,6 @@ Value 0 - VerifyInitialWearables - - Comment - Compares the initial wearables to the COF contents to determine which one to use for the intial outfit - Persist - 1 - Type - Boolean - Value - 0 - - VerifyInitialWearables - - Comment - Compares the initial wearables to the COF contents to determine which one to use for the intial outfit - Persist - 1 - Type - Boolean - Value - 0 - - VerifyInitialWearables - - Comment - Compares the initial wearables to the COF contents to determine which one to use for the intial outfit - Persist - 1 - Type - Boolean - Value - 0 - VertexShaderEnable Comment diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 143126b334..70cfe0511d 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -1,6 +1,17 @@ - BusyResponseChanged + RLVaLoginLastLocation + + Comment + Determines whether the next login will be forced to the last logoff location (set by the viewer) + Persist + 1 + Type + Boolean + Value + 1 + + BusyResponseChanged Comment Does user's busy mode message differ from default? diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 99b79aadc4..b1095182e6 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -90,6 +90,11 @@ #include "llworld.h" #include "llworldmap.h" #include "stringize.h" +// [RLVa:KB] - Checked: 2011-11-04 (RLVa-1.4.4a) +#include "rlvhandler.h" +#include "rlvhelper.h" +#include "rlvui.h" +// [/RLVa:KB] using namespace LLAvatarAppearanceDefines; @@ -340,7 +345,10 @@ LLAgent::LLAgent() : mDoubleTapRunMode(DOUBLETAP_NONE), mbAlwaysRun(false), - mbRunning(false), +// mbRunning(false), +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + mbTempRun(false), +// [/RLVa:KB] mbTeleportKeepsLookAt(false), mAgentAccess(new LLAgentAccess(gSavedSettings)), @@ -694,6 +702,9 @@ void LLAgent::movePitch(F32 mag) // Does this parcel allow you to fly? BOOL LLAgent::canFly() { +// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.2.0d) | Modified: RLVa-1.0.0c + if (gRlvHandler.hasBehaviour(RLV_BHVR_FLY)) return FALSE; +// [/RLVa:KB] if (isGodlike()) return TRUE; LLViewerRegion* regionp = getRegion(); @@ -742,6 +753,13 @@ void LLAgent::setFlying(BOOL fly) if (fly) { +// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.2.0d) | Modified: RLVa-1.0.0c + if (gRlvHandler.hasBehaviour(RLV_BHVR_FLY)) + { + return; + } +// [/RLVa:KB] + BOOL was_flying = getFlying(); if (!canFly() && !was_flying) { @@ -804,7 +822,14 @@ bool LLAgent::enableFlying() void LLAgent::standUp() { - setControlFlags(AGENT_CONTROL_STAND_UP); +// setControlFlags(AGENT_CONTROL_STAND_UP); +// [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c) | Added: RLVa-1.2.0a + // RELEASE-RLVa: [SL-2.0.0] Check this function's callers since usually they require explicit blocking + if ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canStand()) ) + { + setControlFlags(AGENT_CONTROL_STAND_UP); + } +// [/RLVa:KB] } @@ -916,7 +941,10 @@ void LLAgent::setRegion(LLViewerRegion *regionp) LLSelectMgr::getInstance()->updateSelectionCenter(); - LLFloaterMove::sUpdateFlyingStatus(); +// LLFloaterMove::sUpdateFlyingStatus(); +// [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a + LLFloaterMove::sUpdateMovementStatus(); +// [/RLVa:KB] if (teleport) { @@ -1136,7 +1164,14 @@ LLVector3d LLAgent::getPosGlobalFromAgent(const LLVector3 &pos_agent) const void LLAgent::sitDown() { - setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); +// setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); +// [RLVa:KB] - Checked: 2010-08-28 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + // RELEASE-RLVa: [SL-2.0.0] Check this function's callers since usually they require explicit blocking + if ( (!rlv_handler_t::isEnabled()) || ((gRlvHandler.canStand()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SIT))) ) + { + setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); + } +// [/RLVa:KB] } @@ -2431,7 +2466,15 @@ void LLAgent::onAnimStop(const LLUUID& id) } else if (id == ANIM_AGENT_AWAY) { +// clearAFK(); +// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Added: RLVa-1.1.0g +#ifdef RLV_EXTENSION_CMD_ALLOWIDLE + if (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) + clearAFK(); +#else clearAFK(); +#endif // RLV_EXTENSION_CMD_ALLOWIDLE +// [/RLVa:KB] } else if (id == ANIM_AGENT_STANDUP) { @@ -3097,7 +3140,36 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) sendReliableMessage(); } -void LLAgent::sendWalkRun(bool running) +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i +void LLAgent::setAlwaysRun() +{ + mbAlwaysRun = (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasBehaviour(RLV_BHVR_ALWAYSRUN)); + sendWalkRun(); +} + +void LLAgent::setTempRun() +{ + mbTempRun = (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasBehaviour(RLV_BHVR_TEMPRUN)); + sendWalkRun(); +} + +void LLAgent::clearAlwaysRun() +{ + mbAlwaysRun = false; + sendWalkRun(); +} + +void LLAgent::clearTempRun() +{ + mbTempRun = false; + sendWalkRun(); +} +// [/RLVa:KB] + +//void LLAgent::sendWalkRun(bool running) +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i +void LLAgent::sendWalkRun() +// [/RLVa:KB] { LLMessageSystem* msgsys = gMessageSystem; if (msgsys) @@ -3106,7 +3178,10 @@ void LLAgent::sendWalkRun(bool running) msgsys->nextBlockFast(_PREHASH_AgentData); msgsys->addUUIDFast(_PREHASH_AgentID, getID()); msgsys->addUUIDFast(_PREHASH_SessionID, getSessionID()); - msgsys->addBOOLFast(_PREHASH_AlwaysRun, BOOL(running) ); +// msgsys->addBOOLFast(_PREHASH_AlwaysRun, BOOL(running) ); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + msgsys->addBOOLFast(_PREHASH_AlwaysRun, BOOL(getRunning()) ); +// [/RLVa:KB] sendReliableMessage(); } } @@ -3991,6 +4066,18 @@ void LLAgent::teleportRequest( // Landmark ID = LLUUID::null means teleport home void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) { +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a + // NOTE: we'll allow teleporting home unless both @tplm=n *and* @tploc=n restricted + if ( (rlv_handler_t::isEnabled()) && + ( ( (landmark_asset_id.notNull()) ? gRlvHandler.hasBehaviour(RLV_BHVR_TPLM) + : gRlvHandler.hasBehaviour(RLV_BHVR_TPLM) && gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC) ) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (isAgentAvatarValid()) && (gAgentAvatarp->isSitting())) )) + { + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT); + return; + } +// [/RLVa:KB] + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); startTeleportRequest(); } @@ -4070,6 +4157,25 @@ void LLAgent::teleportCancel() void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { +// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.2.0c) | Modified: RLVa-1.2.0a + if ( (rlv_handler_t::isEnabled()) && (!RlvUtil::isForceTp()) ) + { + // If we're getting teleported due to @tpto we should disregard any @tploc=n or @unsit=n restrictions from the same object + if ( (gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOC, gRlvHandler.getCurrentObject())) || + ( (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) && + (gRlvHandler.hasBehaviourExcept(RLV_BHVR_UNSIT, gRlvHandler.getCurrentObject()))) ) + { + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT); + return; + } + + if ( (gRlvHandler.getCurrentCommand()) && (RLV_BHVR_TPTO == gRlvHandler.getCurrentCommand()->getBehaviourType()) ) + { + gRlvHandler.setCanCancelTp(false); + } + } +// [/RLVa:KB] + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocation(pos_global)); startTeleportRequest(); } @@ -4124,6 +4230,16 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) // Teleport to global position, but keep facing in the same direction void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) { +// [RLVa:KB] - Checked: 2010-10-07 (RLVa-1.2.1f) | Added: RLVa-1.2.1f + // RELEASE-RLVa: [SL-2.2.0] Make sure this isn't used for anything except double-click teleporting + if ( (rlv_handler_t::isEnabled()) && (!RlvUtil::isForceTp()) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) || (!gRlvHandler.canStand())) ) + { + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT); + return; + } +// [/RLVa:KB] + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); startTeleportRequest(); } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 306dc2d99c..d74317d04a 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -355,19 +355,31 @@ public: DOUBLETAP_SLIDERIGHT }; - void setAlwaysRun() { mbAlwaysRun = true; } - void clearAlwaysRun() { mbAlwaysRun = false; } - void setRunning() { mbRunning = true; } - void clearRunning() { mbRunning = false; } - void sendWalkRun(bool running); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + void setAlwaysRun(); + void setTempRun(); + void clearAlwaysRun(); + void clearTempRun(); + void sendWalkRun(); + bool getTempRun() { return mbTempRun; } + bool getRunning() const { return (mbAlwaysRun) || (mbTempRun); } +// [/RLVa:KB] +// void setAlwaysRun() { mbAlwaysRun = true; } +// void clearAlwaysRun() { mbAlwaysRun = false; } +// void setRunning() { mbRunning = true; } +// void clearRunning() { mbRunning = false; } +// void sendWalkRun(bool running); bool getAlwaysRun() const { return mbAlwaysRun; } - bool getRunning() const { return mbRunning; } +// bool getRunning() const { return mbRunning; } public: LLFrameTimer mDoubleTapRunTimer; EDoubleTapRunMode mDoubleTapRunMode; private: bool mbAlwaysRun; // Should the avatar run by default rather than walk? - bool mbRunning; // Is the avatar trying to run right now? +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + bool mbTempRun; +// [/RLVa:KB] +// bool mbRunning; // Is the avatar trying to run right now? bool mbTeleportKeepsLookAt; // Try to keep look-at after teleport is complete //-------------------------------------------------------------------- diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 0896aa5972..c3cfd05264 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -49,6 +49,9 @@ #include "llvoavatarself.h" #include "llwindow.h" #include "llworld.h" +// [RLVa:KB] - Checked: 2010-05-10 (RLVa-1.2.0g) +#include "rlvhandler.h" +// [/RLVa:KB] using namespace LLAvatarAppearanceDefines; @@ -2248,6 +2251,13 @@ void LLAgentCamera::changeCameraToCustomizeAvatar() return; } +// [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c) | Modified: RLVa-1.0.0g + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStand()) ) + { + return; + } +// [/RLVa:KB] + gAgent.standUp(); // force stand up gViewerWindow->getWindow()->resetBusyCount(); diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index a4c0b056ac..e49b9cc20e 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -43,6 +43,10 @@ #include "lltoolgrab.h" #include "llhudeffectlookat.h" #include "llagentcamera.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "llvoavatarself.h" +// [/RLVa:KB] LLAgentListener::LLAgentListener(LLAgent &agent) : LLEventAPI("LLAgent", @@ -179,8 +183,28 @@ void LLAgentListener::requestSit(LLSD const & event_data) const object = findObjectClosestTo(target_position); } +// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) | Modified: RLVa-1.1.0j + // TODO-RLVa: [RLVa-1.2.1] Figure out how to call this? + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canSit(object)) ) + { + return; + } +// [/RLVa:KB] + if (object && object->getPCode() == LL_PCODE_VOLUME) { +// [RLVa:KB] - Checked: 2010-08-29 (RLVa-1.2.1c) | Added: RLVa-1.2.1c + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_STANDTP)) && (isAgentAvatarValid()) ) + { + if (gAgentAvatarp->isSitting()) + { + gAgent.standUp(); + return; + } + gRlvHandler.setSitSource(gAgent.getPositionGlobal()); + } +// [/RLVa:KB] + gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, mAgent.getID()); @@ -200,6 +224,14 @@ void LLAgentListener::requestSit(LLSD const & event_data) const void LLAgentListener::requestStand(LLSD const & event_data) const { +// [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c) | Added: RLVa-1.2.0a + // TODO-RLVa: [RLVa-1.2.1] Figure out how to call this? + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStand()) ) + { + return; + } +// [/RLVa:KB] + mAgent.setControlFlags(AGENT_CONTROL_STAND_UP); } diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index b9ec304b7e..01fb2e5427 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -38,6 +38,9 @@ #include "llviewerparcelmgr.h" #include "llvoavatarself.h" #include "llslurl.h" +// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d) +#include "rlvhandler.h" +// [/RLVa:KB] //static void LLAgentUI::buildFullname(std::string& name) @@ -99,6 +102,18 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const // create a default name and description for the landmark std::string parcel_name = LLViewerParcelMgr::getInstance()->getAgentParcelName(); std::string region_name = region->getName(); +// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d + // RELEASE-RLVa: [SL-2.0.0] Check ELocationFormat to make sure our switch still makes sense + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + parcel_name = RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL); + region_name = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); + if (LOCATION_FORMAT_NO_MATURITY == fmt) + fmt = LOCATION_FORMAT_LANDMARK; + else if (LOCATION_FORMAT_FULL == fmt) + fmt = LOCATION_FORMAT_NO_COORDS; + } +// [/RLVa:KB] std::string sim_access_string = region->getSimAccessString(); std::string buffer; if( parcel_name.empty() ) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index a5a23f2cfd..c7ab6600c9 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -49,6 +49,10 @@ #include "llvoavatarself.h" #include "llviewerwearable.h" #include "llwearablelist.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] #include @@ -771,6 +775,34 @@ const LLUUID LLAgentWearables::getWearableItemID(LLWearableType::EType type, U32 return LLUUID(); } +// [RLVa:KB] - Checked: 2011-03-31 (RLVa-1.3.0) +void LLAgentWearables::getWearableItemIDs(uuid_vec_t& idItems) const +{ + for (wearableentry_map_t::const_iterator itWearableType = mWearableDatas.begin(); + itWearableType != mWearableDatas.end(); ++itWearableType) + { + getWearableItemIDs(itWearableType->first, idItems); + } +} + +void LLAgentWearables::getWearableItemIDs(LLWearableType::EType eType, uuid_vec_t& idItems) const +{ + wearableentry_map_t::const_iterator itWearableType = mWearableDatas.find(eType); + if (mWearableDatas.end() != itWearableType) + { + for (wearableentry_vec_t::const_iterator itWearable = itWearableType->second.begin(); + itWearable != itWearableType->second.end(); ++itWearable) + { + const LLViewerWearable* pWearable = dynamic_cast(*itWearable); + if (pWearable) + { + idItems.push_back(pWearable->getItemID()); + } + } + } +} +// [/RLVa:KB] + const LLUUID LLAgentWearables::getWearableAssetID(LLWearableType::EType type, U32 index) const { const LLViewerWearable *wearable = getViewerWearable(type,index); @@ -1214,7 +1246,11 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo old_wearable->removeFromAvatar(TRUE); } } - clearWearableType(type); +// clearWearableType(type); +// [RLVa:KB] - Checked: 2010-05-14 (RLVa-1.2.0) + // The line above shouldn't be needed + RLV_VERIFY(0 == getWearableCount(type)); +// [/RLVa:KB] } else { @@ -1325,46 +1361,46 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it } -// User has picked "wear on avatar" from a menu. -void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLViewerWearable* new_wearable, bool do_append) -{ - //LLAgentDumper dumper("setWearableItem"); - if (isWearingItem(new_item->getUUID())) - { - llwarns << "wearable " << new_item->getUUID() << " is already worn" << llendl; - return; - } - - const LLWearableType::EType type = new_wearable->getType(); - - if (!do_append) - { - // Remove old wearable, if any - // MULTI_WEARABLE: hardwired to 0 - LLViewerWearable* old_wearable = getViewerWearable(type,0); - if (old_wearable) - { - const LLUUID& old_item_id = old_wearable->getItemID(); - if ((old_wearable->getAssetID() == new_wearable->getAssetID()) && - (old_item_id == new_item->getUUID())) - { - lldebugs << "No change to wearable asset and item: " << LLWearableType::getTypeName(type) << llendl; - return; - } - - if (old_wearable->isDirty()) - { - // Bring up modal dialog: Save changes? Yes, No, Cancel - LLSD payload; - payload["item_id"] = new_item->getUUID(); - LLNotificationsUtil::add("WearableSave", LLSD(), payload, boost::bind(onSetWearableDialog, _1, _2, new_wearable)); - return; - } - } - } - - setWearableFinal(new_item, new_wearable, do_append); -} +//// User has picked "wear on avatar" from a menu. +//void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLViewerWearable* new_wearable, bool do_append) +//{ +// //LLAgentDumper dumper("setWearableItem"); +// if (isWearingItem(new_item->getUUID())) +// { +// llwarns << "wearable " << new_item->getUUID() << " is already worn" << llendl; +// return; +// } +// +// const LLWearableType::EType type = new_wearable->getType(); +// +// if (!do_append) +// { +// // Remove old wearable, if any +// // MULTI_WEARABLE: hardwired to 0 +// LLViewerWearable* old_wearable = getViewerWearable(type,0); +// if (old_wearable) +// { +// const LLUUID& old_item_id = old_wearable->getItemID(); +// if ((old_wearable->getAssetID() == new_wearable->getAssetID()) && +// (old_item_id == new_item->getUUID())) +// { +// lldebugs << "No change to wearable asset and item: " << LLWearableType::getTypeName(type) << llendl; +// return; +// } +// +// if (old_wearable->isDirty()) +// { +// // Bring up modal dialog: Save changes? Yes, No, Cancel +// LLSD payload; +// payload["item_id"] = new_item->getUUID(); +// LLNotificationsUtil::add("WearableSave", LLSD(), payload, boost::bind(onSetWearableDialog, _1, _2, new_wearable)); +// return; +// } +// } +// } +// +// setWearableFinal(new_item, new_wearable, do_append); +//} // static bool LLAgentWearables::onSetWearableDialog(const LLSD& notification, const LLSD& response, LLViewerWearable* wearable) @@ -1515,24 +1551,24 @@ void LLAgentWearables::invalidateBakedTextureHash(LLMD5& hash) const // User has picked "remove from avatar" from a menu. // static -void LLAgentWearables::userRemoveWearable(const LLWearableType::EType &type, const U32 &index) -{ - if (!(type==LLWearableType::WT_SHAPE || type==LLWearableType::WT_SKIN || type==LLWearableType::WT_HAIR || type==LLWearableType::WT_EYES)) //&& - //!((!gAgent.isTeen()) && (type==LLWearableType::WT_UNDERPANTS || type==LLWearableType::WT_UNDERSHIRT))) - { - gAgentWearables.removeWearable(type,false,index); - } -} +//void LLAgentWearables::userRemoveWearable(const LLWearableType::EType &type, const U32 &index) +//{ +// if (!(type==LLWearableType::WT_SHAPE || type==LLWearableType::WT_SKIN || type==LLWearableType::WT_HAIR || type==LLWearableType::WT_EYES)) //&& +// //!((!gAgent.isTeen()) && (type==LLWearableType::WT_UNDERPANTS || type==LLWearableType::WT_UNDERSHIRT))) +// { +// gAgentWearables.removeWearable(type,false,index); +// } +//} //static -void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &type) -{ - if (!(type==LLWearableType::WT_SHAPE || type==LLWearableType::WT_SKIN || type==LLWearableType::WT_HAIR || type==LLWearableType::WT_EYES)) //&& - //!((!gAgent.isTeen()) && (type==LLWearableType::WT_UNDERPANTS || type==LLWearableType::WT_UNDERSHIRT))) - { - gAgentWearables.removeWearable(type,true,0); - } -} +//void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &type) +//{ +// if (!(type==LLWearableType::WT_SHAPE || type==LLWearableType::WT_SKIN || type==LLWearableType::WT_HAIR || type==LLWearableType::WT_EYES)) //&& +// //!((!gAgent.isTeen()) && (type==LLWearableType::WT_UNDERPANTS || type==LLWearableType::WT_UNDERSHIRT))) +// { +// gAgentWearables.removeWearable(type,true,0); +// } +//} // Combines userRemoveMulipleAttachments() and userAttachMultipleAttachments() logic to // get attachments into desired state with minimal number of adds/removes. @@ -1620,6 +1656,34 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo { if (!isAgentAvatarValid()) return; +// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.0) + // RELEASE-RLVa: [SL-3.4] Check our callers and verify that erasing elements from the passed vector won't break random things + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_REMOVE)) ) + { + llvo_vec_t::iterator itObj = objects_to_remove.begin(); + while (objects_to_remove.end() != itObj) + { + const LLViewerObject* pAttachObj = *itObj; + if (gRlvAttachmentLocks.isLockedAttachment(pAttachObj)) + { + itObj = objects_to_remove.erase(itObj); + + // Fall-back code: re-add the attachment if it got removed from COF somehow (compensates for possible bugs elsewhere) + bool fInCOF = LLAppearanceMgr::isLinkInCOF(pAttachObj->getAttachmentItemID()); + RLV_ASSERT(fInCOF); + if (!fInCOF) + { + LLAppearanceMgr::instance().registerAttachment(pAttachObj->getAttachmentItemID()); + } + } + else + { + ++itObj; + } + } + } +// [/RLVa:KB] + if (objects_to_remove.empty()) return; @@ -1641,6 +1705,25 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array) { +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1) + static bool sInitialAttachmentsRequested = false; + + // RELEASE-RLVa: [SL-3.4] Check our callers and verify that erasing elements from the passed vector won't break random things + if ( (rlv_handler_t::isEnabled()) && (sInitialAttachmentsRequested) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) ) + { + // Fall-back code: everything should really already have been pruned before we get this far + for (S32 idxItem = obj_item_array.count() - 1; idxItem >= 0; idxItem--) + { + const LLInventoryItem* pItem = obj_item_array.get(idxItem).get(); + if (!gRlvAttachmentLocks.canAttach(pItem)) + { + obj_item_array.remove(idxItem); + RLV_ASSERT(false); + } + } + } +// [/RLVa:KB] + // Build a compound message to send all the objects that need to be rezzed. S32 obj_count = obj_item_array.count(); @@ -1678,6 +1761,12 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); msg->addU8Fast(_PREHASH_AttachmentPt, 0 | ATTACHMENT_ADD); // Wear at the previous or default attachment point +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1) + if ( (rlv_handler_t::isEnabled()) && (sInitialAttachmentsRequested) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) ) + { + RlvAttachmentLockWatchdog::instance().onWearAttachment(item, RLV_WEAR_ADD); + } +// [/RLVa:KB] pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); msg->addStringFast(_PREHASH_Name, item->getName()); msg->addStringFast(_PREHASH_Description, item->getDescription()); @@ -1688,6 +1777,10 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra msg->sendReliable( gAgent.getRegion()->getHost() ); } } + +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1) + sInitialAttachmentsRequested = true; +// [/RLVa:KB] } void LLAgentWearables::checkWearablesLoaded() const diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 2b2a167995..a54f362dcf 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -93,6 +93,10 @@ public: // Accessors //-------------------------------------------------------------------- public: +// [RLVa:KB] - Checked: 2011-03-31 (RLVa-1.3.0) + void getWearableItemIDs(uuid_vec_t& idItems) const; + void getWearableItemIDs(LLWearableType::EType eType, uuid_vec_t& idItems) const; +// [/RLVa:KB] const LLUUID getWearableItemID(LLWearableType::EType type, U32 index /*= 0*/) const; const LLUUID getWearableAssetID(LLWearableType::EType type, U32 index /*= 0*/) const; const LLViewerWearable* getWearableFromItemID(const LLUUID& item_id) const; @@ -109,7 +113,7 @@ public: private: /*virtual*/void wearableUpdated(LLWearable *wearable, BOOL removed); public: - void setWearableItem(LLInventoryItem* new_item, LLViewerWearable* wearable, bool do_append = false); +// void setWearableItem(LLInventoryItem* new_item, LLViewerWearable* wearable, bool do_append = false); void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLViewerWearable* >& wearables, BOOL remove); void setWearableName(const LLUUID& item_id, const std::string& new_name); // *TODO: Move this into llappearance/LLWearableData ? @@ -149,8 +153,11 @@ private: // Removing wearables //-------------------------------------------------------------------- public: - void removeWearable(const LLWearableType::EType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); +// void removeWearable(const LLWearableType::EType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); private: +// [RLVa:KB] - Checked: 2010-05-11 (RLVa-1.2.0) + void removeWearable(const LLWearableType::EType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); +// [/RLVa:KB] void removeWearableFinal(const LLWearableType::EType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); protected: static bool onRemoveWearableDialog(const LLSD& notification, const LLSD& response); @@ -196,8 +203,8 @@ public: // Static UI hooks //-------------------------------------------------------------------- public: - static void userRemoveWearable(const LLWearableType::EType &type, const U32 &index); - static void userRemoveWearablesOfType(const LLWearableType::EType &type); +// static void userRemoveWearable(const LLWearableType::EType &type, const U32 &index); +// static void userRemoveWearablesOfType(const LLWearableType::EType &type); typedef std::vector llvo_vec_t; diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 30e763a4a9..8f1a4799e5 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -36,6 +36,9 @@ // [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2011-09-10 (Catznip-3.0.0a) #include "llviewercontrol.h" // [/SL:KB] +// [RLVa:KB] - Checked: 2010-12-15 (RLVa-1.2.2c) +#include "rlvhelper.h" +// [/RLVa:KB] void order_my_outfits_cb() { @@ -98,7 +101,14 @@ void LLInitialWearablesFetch::done() // gInventory.notifyObservers. The results will be handled in the next // idle tick instead. gInventory.removeObserver(this); - doOnIdleOneTime(boost::bind(&LLInitialWearablesFetch::processContents,this)); +// doOnIdleOneTime(boost::bind(&LLInitialWearablesFetch::processContents,this)); +// [RLVa:KB] - Checked: 2010-12-15 (RLVa-1.2.2c) | Added: RLVa-1.2.2c + F32 nDelay = gSavedSettings.getF32("ForceInitialCOFDelay"); + if (0.0f == nDelay) + doOnIdleOneTime(boost::bind(&LLInitialWearablesFetch::processContents,this)); + else + rlvCallbackTimerOnce(nDelay, boost::bind(&LLInitialWearablesFetch::processContents,this)); +// [/RLVa:KB] if (isAgentAvatarValid()) { gAgentAvatarp->stopPhase("initial_wearables_fetch"); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 3147c102f5..dacd206147 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -51,6 +51,11 @@ #include "llwearablelist.h" #include "llsdutil.h" #include "llsdserialize.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvhelper.h" +#include "rlvlocks.h" +// [/RLVa:KB] std::string self_av_string() { @@ -1204,6 +1209,23 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items) items = new_items; } +// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2011-07-24 (Catznip-2.6.0e) | Added: Catznip-2.6.0e +static void removeDuplicateWearableItemsByAssetID(LLInventoryModel::item_array_t& items) +{ + std::set idsAsset; + for (S32 idxItem = items.count() - 1; idxItem >= 0; idxItem--) + { + const LLViewerInventoryItem* pItem = items.get(idxItem); + if (!pItem->isWearableType()) + continue; + if (idsAsset.end() == idsAsset.find(pItem->getAssetUUID())) + idsAsset.insert(pItem->getAssetUUID()); + else + items.remove(idxItem); + } +} +// [/SL:KB] + const LLUUID LLAppearanceMgr::getCOF() const { return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); @@ -1353,6 +1375,14 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up return false; } +// [RLVa:KB] - Checked: 2013-02-12 (RLVa-1.4.8) + replace |= (LLAssetType::AT_BODYPART == item_to_wear->getType()); // Body parts should always replace + if ( (rlv_handler_t::isEnabled()) && (!rlvPredCanWearItem(item_to_wear, (replace) ? RLV_WEAR_REPLACE : RLV_WEAR_ADD)) ) + { + return false; + } +// [/RLVa:KB] + switch (item_to_wear->getType()) { case LLAssetType::AT_CLOTHING: @@ -1738,6 +1768,78 @@ void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_lin } } +// [SL:KB] - Checked: 2010-04-24 (RLVa-1.2.0f) | Added: RLVa-1.2.0f +void LLAppearanceMgr::purgeItems(const LLInventoryModel::item_array_t& items) +{ + for (LLInventoryModel::item_array_t::const_iterator itItem = items.begin(); itItem != items.end(); ++itItem) + { + const LLViewerInventoryItem* pItem = *itItem; + if (pItem->getIsLinkType()) + { + gInventory.purgeObject(pItem->getUUID()); + } + } +} + +void LLAppearanceMgr::purgeItemsOfType(LLAssetType::EType asset_type) +{ + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(getCOF(), cats, items, LLInventoryModel::EXCLUDE_TRASH); + for (LLInventoryModel::item_array_t::const_iterator itItem = items.begin(); itItem != items.end(); ++itItem) + { + const LLInventoryItem* pItem = *itItem; + if ( (pItem->getIsLinkType()) && (asset_type == pItem->getType()) ) + { + gInventory.purgeObject(pItem->getUUID()); + } + } +} + +void LLAppearanceMgr::syncCOF(const LLInventoryModel::item_array_t& items, + LLInventoryModel::item_array_t& items_to_add, LLInventoryModel::item_array_t& items_to_remove) +{ + const LLUUID idCOF = getCOF(); + LLInventoryModel::item_array_t cur_cof_items, new_cof_items = items; + + // Grab the current COF contents + LLInventoryModel::cat_array_t cats; + gInventory.collectDescendents(getCOF(), cats, cur_cof_items, LLInventoryModel::EXCLUDE_TRASH); + + // Purge everything in cur_cof_items that isn't part of new_cof_items + for (S32 idxCurItem = 0, cntCurItem = cur_cof_items.count(); idxCurItem < cntCurItem; idxCurItem++) + { + LLViewerInventoryItem* pItem = cur_cof_items.get(idxCurItem); + if (std::find_if(new_cof_items.begin(), new_cof_items.end(), RlvPredIsEqualOrLinkedItem(pItem)) == new_cof_items.end()) + { + // Item doesn't exist in new_cof_items => purge (if it's a link) + if ( (pItem->getIsLinkType()) && + (LLAssetType::AT_LINK_FOLDER != pItem->getActualType()) && + (items_to_remove.end() == std::find(items_to_remove.begin(), items_to_remove.end(), pItem)) ) + { + items_to_remove.push_back(pItem); + } + } + else + { + // Item exists in new_cof_items => remove *all* occurances in new_cof_items (removes duplicate COF links to this item as well) + new_cof_items.erase( + std::remove_if(new_cof_items.begin(), new_cof_items.end(), RlvPredIsEqualOrLinkedItem(pItem)), new_cof_items.end()); + } + } + + // Whatever remains in new_cof_items will need to have a link created + for (S32 idxNewItem = 0, cntNewItem = new_cof_items.count(); idxNewItem < cntNewItem; idxNewItem++) + { + LLViewerInventoryItem* pItem = new_cof_items.get(idxNewItem); + if (items_to_add.end() == std::find(items_to_add.begin(), items_to_add.end(), pItem)) + { + items_to_add.push_back(pItem); + } + } +} +// [/SL:KB] + // Keep the last N wearables of each type. For viewer 2.0, N is 1 for // both body parts and clothing items. void LLAppearanceMgr::filterWearableItems( @@ -1789,10 +1891,31 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, } } +//void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) +// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0b) | Added: RLVa-1.2.0b void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { - LLViewerInventoryCategory *pcat = gInventory.getCategory(category); - LL_INFOS("Avatar") << self_av_string() << "starting, cat '" << (pcat ? pcat->getName() : "[UNKNOWN]") << "'" << LL_ENDL; + LLInventoryModel::item_array_t body_items_new, wear_items_new, obj_items_new, gest_items_new; + getDescendentsOfAssetType(category, body_items_new, LLAssetType::AT_BODYPART, false); + getDescendentsOfAssetType(category, wear_items_new, LLAssetType::AT_CLOTHING, false); + getDescendentsOfAssetType(category, obj_items_new, LLAssetType::AT_OBJECT, false); + getDescendentsOfAssetType(category, gest_items_new, LLAssetType::AT_GESTURE, false); + updateCOF(body_items_new, wear_items_new, obj_items_new, gest_items_new, append, category); +} + +void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new, + LLInventoryModel::item_array_t& wear_items_new, + LLInventoryModel::item_array_t& obj_items_new, + LLInventoryModel::item_array_t& gest_items_new, + bool append /*=false*/, const LLUUID& idOutfit /*=LLUUID::null*/) +// [/RLVa:KB] +{ +// LLViewerInventoryCategory *pcat = gInventory.getCategory(category); +// LL_INFOS("Avatar") << self_av_string() << "starting, cat '" << (pcat ? pcat->getName() : "[UNKNOWN]") << "'" << LL_ENDL; +// [RLVa:KB] - Checked: 2010-03-26 (RLVa-1.2.0b) | Added: RLVa-1.2.0b + // RELEASE-RLVa: [SL-2.0.0] If pcat ever gets used for anything further down the beta we'll know about it + llinfos << "starting" << llendl; +// [/RLVa:KB] const LLUUID cof = getCOF(); @@ -1813,39 +1936,87 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // Collect and filter descendents to determine new COF contents. - // - Body parts: always include COF contents as a fallback in case any - // required parts are missing. + // + // - Body parts: always include COF contents as a fallback in case any required parts are missing. + // // Preserve body parts from COF if appending. LLInventoryModel::item_array_t body_items; getDescendentsOfAssetType(cof, body_items, LLAssetType::AT_BODYPART, false); - getDescendentsOfAssetType(category, body_items, LLAssetType::AT_BODYPART, false); - if (append) - reverse(body_items.begin(), body_items.end()); +// getDescendentsOfAssetType(category, body_items, LLAssetType::AT_BODYPART, false); +// [RLVa:KB] - Checked: 2010-03-19 (RLVa-1.2.0c) | Modified: RLVa-1.2.0b + // Filter out any new body parts that can't be worn before adding them + if ( (rlv_handler_t::isEnabled()) && (gRlvWearableLocks.hasLockedWearableType(RLV_LOCK_ANY)) ) + body_items_new.erase(std::remove_if(body_items_new.begin(), body_items_new.end(), RlvPredCanNotWearItem(RLV_WEAR_REPLACE)), body_items_new.end()); + body_items.insert(body_items.end(), body_items_new.begin(), body_items_new.end()); +// [/RLVa:KB] + // NOTE-RLVa: we don't actually want to favour COF body parts over the folder's body parts (if only because it breaks force wear) +// if (append) +// reverse(body_items.begin(), body_items.end()); // Reduce body items to max of one per type. removeDuplicateItems(body_items); filterWearableItems(body_items, 1); + // // - Wearables: include COF contents only if appending. + // LLInventoryModel::item_array_t wear_items; if (append) getDescendentsOfAssetType(cof, wear_items, LLAssetType::AT_CLOTHING, false); - getDescendentsOfAssetType(category, wear_items, LLAssetType::AT_CLOTHING, false); +// [RLVa:KB] - Checked: 2010-03-19 (RLVa-1.2.0c) | Modified: RLVa-1.2.0b + else if ( (rlv_handler_t::isEnabled()) && (gRlvWearableLocks.hasLockedWearableType(RLV_LOCK_ANY)) ) + { + // Make sure that all currently locked clothing layers remain in COF when replacing + getDescendentsOfAssetType(cof, wear_items, LLAssetType::AT_CLOTHING, false); + wear_items.erase(std::remove_if(wear_items.begin(), wear_items.end(), rlvPredCanRemoveItem), wear_items.end()); + } +// [/RLVa:KB] +// getDescendentsOfAssetType(category, wear_items, LLAssetType::AT_CLOTHING, false); +// [RLVa:KB] - Checked: 2010-03-19 (RLVa-1.2.0c) | Modified: RLVa-1.2.0b + // Filter out any new wearables that can't be worn before adding them + if ( (rlv_handler_t::isEnabled()) && (gRlvWearableLocks.hasLockedWearableType(RLV_LOCK_ANY)) ) + wear_items_new.erase(std::remove_if(wear_items_new.begin(), wear_items_new.end(), RlvPredCanNotWearItem(RLV_WEAR)), wear_items_new.end()); + wear_items.insert(wear_items.end(), wear_items_new.begin(), wear_items_new.end()); +// [/RLVa:KB] // Reduce wearables to max of one per type. removeDuplicateItems(wear_items); +// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2011-07-24 (Catznip-2.6.0e) | Added: Catznip-2.6.0e + removeDuplicateWearableItemsByAssetID(wear_items); +// [/SL:KB] filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE); + // // - Attachments: include COF contents only if appending. + // LLInventoryModel::item_array_t obj_items; if (append) getDescendentsOfAssetType(cof, obj_items, LLAssetType::AT_OBJECT, false); - getDescendentsOfAssetType(category, obj_items, LLAssetType::AT_OBJECT, false); +// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0z) | Modified: RLVa-1.2.0b + else if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) ) + { + // Make sure that all currently locked attachments remain in COF when replacing + getDescendentsOfAssetType(cof, obj_items, LLAssetType::AT_OBJECT, false); + obj_items.erase(std::remove_if(obj_items.begin(), obj_items.end(), rlvPredCanRemoveItem), obj_items.end()); + } +// [/RLVa:KB] +// getDescendentsOfAssetType(category, obj_items, LLAssetType::AT_OBJECT, false); +// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0z) | Modified: RLVa-1.2.0b + // Filter out any new attachments that can't be worn before adding them + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) ) + obj_items_new.erase(std::remove_if(obj_items_new.begin(), obj_items_new.end(), RlvPredCanNotWearItem(RLV_WEAR)), obj_items_new.end()); + obj_items.insert(obj_items.end(), obj_items_new.begin(), obj_items_new.end()); +// [/RLVa:KB] removeDuplicateItems(obj_items); + // // - Gestures: include COF contents only if appending. + // LLInventoryModel::item_array_t gest_items; if (append) getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE, false); - getDescendentsOfAssetType(category, gest_items, LLAssetType::AT_GESTURE, false); +// getDescendentsOfAssetType(category, gest_items, LLAssetType::AT_GESTURE, false); +// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0z) | Added: RLVa-1.2.0b + gest_items.insert(gest_items.end(), gest_items_new.begin(), gest_items_new.end()); +// [/RLVa:KB] removeDuplicateItems(gest_items); // Create links to new COF contents. @@ -1855,23 +2026,50 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) all_items += obj_items; all_items += gest_items; +// [SL:KB] + // Synchronize COF + // -> it's possible that we don't link to any new items in which case 'link_waiter' fires when it goes out of scope below + LLInventoryModel::item_array_t items_add, items_remove; + syncCOF(all_items, items_add, items_remove); +// [/SL:KB] + // Will link all the above items. LLPointer link_waiter = new LLUpdateAppearanceOnDestroy; - linkAll(cof,all_items,link_waiter); +// [SL:KB] - Checked: 2013-03-05 (RLVa-1.4.8) + linkAll(cof, items_add, link_waiter); +// [/SL:KB] +// linkAll(cof,all_items,link_waiter); // Add link to outfit if category is an outfit. - if (!append) +// [SL:KB] - Checked: 2010-04-24 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + if ( (!append) && (idOutfit.notNull()) ) { - createBaseOutfitLink(category, link_waiter); + createBaseOutfitLink(idOutfit, link_waiter); } - +// [/SL:KB] +// if (!append) +// { +// createBaseOutfitLink(category, link_waiter); +// } +// // Remove current COF contents. Have to do this after creating // the link_waiter so links can be followed for any items that get // carried over (e.g. keeping old shape if the new outfit does not // contain one) +// [SL:KB] + purgeItems(items_remove); + bool keep_outfit_links = append; - purgeCategory(cof, keep_outfit_links, &all_items); + if (!keep_outfit_links) + { + purgeItemsOfType(LLAssetType::AT_LINK_FOLDER); + } + gInventory.notifyObservers(); +// [/SL:KB] +// bool keep_outfit_links = append; +// purgeCategory(cof, keep_outfit_links, &all_items); +// gInventory.notifyObservers(); LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; } @@ -1909,6 +2107,14 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo lldebugs << "updateAgentWearables()" << llendl; LLInventoryItem::item_array_t items; LLDynamicArray< LLViewerWearable* > wearables; +// [RLVa:KB] - Checked: 2011-03-31 (RLVa-1.3.0f) | Added: RLVa-1.3.0f + uuid_vec_t idsCurrent; LLInventoryModel::item_array_t itemsNew; + if (rlv_handler_t::isEnabled()) + { + // Collect the item UUIDs of all currently worn wearables + gAgentWearables.getWearableItemIDs(idsCurrent); + } +// [/RLVa:KB] // For each wearable type, find the wearables of that type. for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ ) @@ -1923,13 +2129,60 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(data.mItemID); if( item && (item->getAssetUUID() == wearable->getAssetID()) ) { +// [RLVa:KB] - Checked: 2010-03-19 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g + // TODO-RLVa: [RLVa-1.2.1] This is fall-back code so if we don't ever trigger this code it can just be removed + // -> one way to trigger the assertion: + // 1) "Replace Outfit" on a folder with clothing and an attachment that goes @addoutfit=n + // 2) updateCOF will add/link the items into COF => no @addoutfit=n present yet => allowed + // 3) llOwnerSay("@addoutfit=n") executes + // 4) code below runs => @addoutfit=n conflicts with adding new wearables + // => if it's left as-is then the wearables won't get worn (but remain in COF which causes issues of its own) + // => if it's changed to debug-only then we make tge assumption that anything that makes it into COF is always OK +#ifdef RLV_DEBUG + // NOTE: make sure we don't accidentally block setting the initial wearables + if ( (rlv_handler_t::isEnabled()) && (RLV_WEAR_LOCKED == gRlvWearableLocks.canWear(wearable->getType())) && + (!gAgentWearables.getWearableFromItemID(item->getUUID())) && (gAgentWearables.areWearablesLoaded()) ) + { + RLV_VERIFY(RLV_WEAR_LOCKED == gRlvWearableLocks.canWear(wearable->getType())); + continue; + } +#endif // RLV_DEBUG +// [/RLVa:KB] items.put(item); wearables.put(wearable); +// [RLVa:KB] - Checked: 2011-03-31 (RLVa-1.3.0f) | Added: RLVa-1.3.0f + if ( (rlv_handler_t::isEnabled()) && (gAgentWearables.areInitalWearablesLoaded()) ) + { + // Remove the wearable from current item UUIDs if currently worn and requested, otherwise mark it as a new item + uuid_vec_t::iterator itItemID = std::find(idsCurrent.begin(), idsCurrent.end(), item->getUUID()); + if (idsCurrent.end() != itItemID) + idsCurrent.erase(itItemID); + else + itemsNew.push_back(item); + } +// [/RLVa:KB] } } } } +// [RLVa:KB] - Checked: 2011-03-31 (RLVa-1.3.0f) | Added: RLVa-1.3.0f + if ( (rlv_handler_t::isEnabled()) && (gAgentWearables.areInitalWearablesLoaded()) ) + { + // We need to report removals before additions or scripts will get confused + for (uuid_vec_t::const_iterator itItemID = idsCurrent.begin(); itItemID != idsCurrent.end(); ++itItemID) + { + const LLWearable* pWearable = gAgentWearables.getWearableFromItemID(*itItemID); + if (pWearable) + RlvBehaviourNotifyHandler::onTakeOff(pWearable->getType(), true); + } + for (S32 idxItem = 0, cntItem = itemsNew.count(); idxItem < cntItem; idxItem++) + { + RlvBehaviourNotifyHandler::onWear(itemsNew.get(idxItem)->getWearableType(), true); + } + } +// [/RLVa:KB] + if(wearables.count() > 0) { gAgentWearables.setWearableOutfit(items, wearables, !append); @@ -2093,6 +2346,10 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) removeDuplicateItems(gest_items); filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE); // [/SL:KB] +// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2011-07-24 (Catznip-2.6.0e) | Added: Catznip-2.6.0e + // Wearing two wearables that share the same asset causes some issues + removeDuplicateWearableItemsByAssetID(wear_items); +// [/SL:KB] dumpItemArray(wear_items,"asset_dump: wear_item"); dumpItemArray(obj_items,"asset_dump: obj_item"); @@ -2156,6 +2413,9 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) // fetch failures (should be replaced by new defaults in // lost&found). U32 skip_type = gSavedSettings.getU32("ForceAssetFail"); +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c + U32 missing_type = gSavedSettings.getU32("ForceMissingType"); +// [/RLVa:KB] if (item && item->getIsLinkType() && linked_item) { @@ -2166,10 +2426,25 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID ); - if (skip_type != LLWearableType::WT_INVALID && skip_type == found.mWearableType) +// [RLVa:KB] - Checked: 2010-12-15 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c +#ifdef LL_RELEASE_FOR_DOWNLOAD + // Don't allow forcing an invalid wearable if the initial wearables aren't set yet, or if any wearable type is currently locked + if ( (!rlv_handler_t::isEnabled()) || + ((gAgentWearables.areInitalWearablesLoaded()) && (!gRlvWearableLocks.hasLockedWearableType(RLV_LOCK_REMOVE))) ) +#endif // LL_RELEASE_FOR_DOWNLOAD { - found.mAssetID.generate(); // Replace with new UUID, guaranteed not to exist in DB + if (missing_type != LLWearableType::WT_INVALID && missing_type == found.mWearableType) + { + continue; + } +// [/RLVa:KB] + if (skip_type != LLWearableType::WT_INVALID && skip_type == found.mWearableType) + { + found.mAssetID.generate(); // Replace with new UUID, guaranteed not to exist in DB + } +// [RLVa:KB] - Checked: 2010-12-15 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c } +// [/RLVa:KB] //pushing back, not front, to preserve order of wearables for LLAgentWearables holder->getFoundList().push_back(found); } @@ -2564,6 +2839,13 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update // MULTI-WEARABLES: make sure we don't go over MAX_CLOTHING_PER_TYPE gInventory.purgeObject(inv_item->getUUID()); } +// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2011-07-24 (Catznip-2.6.0e) | Added: Catznip-2.6.0e + else if ( (vitem->getWearableType() == wearable_type) && (vitem->getAssetUUID() == inv_item->getAssetUUID()) ) + { + // Only allow one wearable per unique asset + linked_already = true; + } +// [/SL:KB] } } @@ -2693,6 +2975,16 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id) const LLInventoryItem* item = item_array.get(i).get(); if (item->getIsLinkType() && item->getLinkedUUID() == item_id) { +// [RLVa:KB] - Checked: 2013-02-12 (RLVa-1.4.8) +#if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG + // NOTE-RLVa: debug-only, can be removed down the line + if (rlv_handler_t::isEnabled()) + { + RLV_ASSERT(rlvPredCanRemoveItem(item)); + } +#endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG +// [/RLVa:KB] + gInventory.purgeObject(item->getUUID()); } } @@ -2711,6 +3003,16 @@ void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type) const LLViewerInventoryItem* item = *it; if (item->getIsLinkType()) // we must operate on links only { +// [RLVa:KB] - Checked: 2013-02-12 (RLVa-1.4.8) +#if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG + // NOTE-RLVa: debug-only, can be removed down the line + if (rlv_handler_t::isEnabled()) + { + RLV_ASSERT(rlvPredCanRemoveItem(item)); + } +#endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG +// [/RLVa:KB] + gInventory.purgeObject(item->getUUID()); } } @@ -3471,20 +3773,50 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove) { llwarns << "called with empty list, nothing to do" << llendl; } + +// [RLVa:KB] - Checked: 2013-02-12 (RLVa-1.4.8) + bool fUpdateAppearance = false; for (uuid_vec_t::const_iterator it = ids_to_remove.begin(); it != ids_to_remove.end(); ++it) { - const LLUUID& id_to_remove = *it; - const LLUUID& linked_item_id = gInventory.getLinkedItemID(id_to_remove); - removeCOFItemLinks(linked_item_id); + const LLInventoryItem* linked_item = gInventory.getLinkedItem(*it); + if ( (rlv_handler_t::isEnabled()) && (!rlvPredCanRemoveItem(linked_item)) ) + { + continue; + } + + fUpdateAppearance = true; + removeCOFItemLinks(linked_item->getUUID()); } - updateAppearanceFromCOF(); + + if (fUpdateAppearance) + { + updateAppearanceFromCOF(); + } +// [/RLVa:KB] +// for (uuid_vec_t::const_iterator it = ids_to_remove.begin(); it != ids_to_remove.end(); ++it) +// { +// const LLUUID& id_to_remove = *it; +// const LLUUID& linked_item_id = gInventory.getLinkedItemID(id_to_remove); +// removeCOFItemLinks(linked_item_id); +// } +// updateAppearanceFromCOF(); } void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) { - LLUUID linked_item_id = gInventory.getLinkedItemID(id_to_remove); - removeCOFItemLinks(linked_item_id); +// [RLVa:KB] - Checked: 2013-02-12 (RLVa-1.4.8) + const LLInventoryItem* linked_item = gInventory.getLinkedItem(id_to_remove); + if ( (rlv_handler_t::isEnabled()) && (!rlvPredCanRemoveItem(linked_item)) ) + { + return; + } + + removeCOFItemLinks(linked_item->getUUID()); updateAppearanceFromCOF(); +// [/RLVA:KB] +// LLUUID linked_item_id = gInventory.getLinkedItemID(id_to_remove); +// removeCOFItemLinks(linked_item_id); +// updateAppearanceFromCOF(); } bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_body) diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 77aa8e5c20..ce5a840237 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -55,6 +55,11 @@ public: // [/SL:KB] bool needToSaveCOF(); void updateCOF(const LLUUID& category, bool append = false); +// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0a) | Added: RLVa-1.2.0a + void updateCOF(LLInventoryModel::item_array_t& body_items_new, LLInventoryModel::item_array_t& wear_items_new, + LLInventoryModel::item_array_t& obj_items_new, LLInventoryModel::item_array_t& gest_items_new, + bool append = false, const LLUUID& idOutfit = LLUUID::null); +// [/RLVa:KB] void wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append); void wearInventoryCategoryOnAvatar(LLInventoryCategory* category, bool append); void wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append); @@ -232,6 +237,13 @@ private: void setOutfitLocked(bool locked); +// [SL:KB] - Checked: 2010-04-24 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + void purgeItems(const LLInventoryModel::item_array_t& items); + void purgeItemsOfType(LLAssetType::EType asset_type); + void syncCOF(const LLInventoryModel::item_array_t& items, + LLInventoryModel::item_array_t& items_to_add, LLInventoryModel::item_array_t& items_to_remove); +// [/SL:KB] + bool mAttachmentInvLinkEnabled; bool mOutfitIsDirty; bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls. diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6f66057b43..e78bb6cab3 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -90,6 +90,13 @@ #include "llprogressview.h" #include "llvocache.h" #include "llvopartgroup.h" +// [SL:KB] - Patch: Appearance-Misc | Checked: 2013-02-12 (Catznip-3.4) +#include "llappearancemgr.h" +// [/SL:KB] +// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) +#include "rlvhandler.h" +// [/RLVa:KB] + #include "llweb.h" #include "llsecondlifeurls.h" #include "llupdaterservice.h" @@ -448,7 +455,15 @@ void idle_afk_check() { // check idle timers F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32(); - F32 afk_timeout = gSavedSettings.getS32("AFKTimeout"); +// F32 afk_timeout = gSavedSettings.getS32("AFKTimeout"); +// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g +#ifdef RLV_EXTENSION_CMD_ALLOWIDLE + // Enforce an idle time of 30 minutes if @allowidle=n restricted + F32 afk_timeout = (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) ? gSavedSettings.getS32("AFKTimeout") : 60 * 30; +#else + F32 afk_timeout = gSavedSettings.getS32("AFKTimeout"); +#endif // RLV_EXTENSION_CMD_ALLOWIDLE +// [/RLVa:KB] if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK()) { LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL; @@ -5021,6 +5036,11 @@ void LLAppViewer::disconnectViewer() // close inventory interface, close all windows LLFloaterInventory::cleanup(); +// [SL:KB] - Patch: Appearance-Misc | Checked: 2013-02-12 (Catznip-3.4) + // Destroying all objects below will trigger attachment detaching code and attempt to remove the COF links for them + LLAppearanceMgr::instance().setAttachmentInvLinkEnable(false); +// [/SL:KB] + gAgentWearables.cleanup(); gAgentCamera.cleanup(); // Also writes cached agent settings to gSavedSettings diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index ea0b8f00a4..b5644fc7ab 100644 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -33,7 +33,10 @@ #include "llviewerinventory.h" #include "llviewerregion.h" #include "message.h" - +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] LLAttachmentsMgr::LLAttachmentsMgr() { @@ -45,12 +48,35 @@ LLAttachmentsMgr::~LLAttachmentsMgr() void LLAttachmentsMgr::addAttachment(const LLUUID& item_id, const U8 attachment_pt, - const BOOL add) +// const BOOL add) +// [RLVa:KB] - Checked: 2010-09-13 (RLVa-1.2.1c) | Added: RLVa-1.2.1c + const BOOL add, const BOOL fRlvForce /*=FALSE*/) +// [/RLVa:KB] { AttachmentsInfo attachment; attachment.mItemID = item_id; attachment.mAttachmentPt = attachment_pt; attachment.mAdd = add; + +// [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1d) | Modified: RLVa-1.2.1d + if ( (rlv_handler_t::isEnabled()) && (!fRlvForce) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) ) + { + const LLInventoryItem* pItem = gInventory.getItem(item_id); + if (!pItem) + return; + + LLViewerJointAttachment* pAttachPt = NULL; + ERlvWearMask eWearMask = gRlvAttachmentLocks.canAttach(pItem, &pAttachPt); + if ( ((add) && ((RLV_WEAR_ADD & eWearMask) == 0)) || ((!add) && ((RLV_WEAR_REPLACE & eWearMask) == 0)) ) + return; + + if ( (0 == attachment_pt) && (NULL != pAttachPt) ) + attachment.mAttachmentPt = RlvAttachPtLookup::getAttachPointIndex(pAttachPt); + RlvAttachmentLockWatchdog::instance().onWearAttachment(pItem, (add) ? RLV_WEAR_ADD : RLV_WEAR_REPLACE); + attachment.mAdd = true; + } +// [/RLVa:KB] + mPendingAttachments.push_back(attachment); } diff --git a/indra/newview/llattachmentsmgr.h b/indra/newview/llattachmentsmgr.h index 1d8ab74dfd..997db59d22 100644 --- a/indra/newview/llattachmentsmgr.h +++ b/indra/newview/llattachmentsmgr.h @@ -54,7 +54,10 @@ public: void addAttachment(const LLUUID& item_id, const U8 attachment_pt, - const BOOL add); +// const BOOL add); +// [RLVa:KB] - Checked: 2010-09-13 (RLVa-1.2.1c) | Added: RLVa-1.2.1c + const BOOL add, const BOOL fRlvForce = FALSE); +// [/RLVa:KB] static void onIdle(void *); protected: void onIdle(); diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index fdd4565e50..4ca58769ee 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -71,6 +71,9 @@ #include "llcallingcard.h" #include "llslurl.h" // IDEVO #include "llsidepanelinventory.h" +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h +#include "rlvhandler.h" +// [/RLVa:KB] // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -194,6 +197,19 @@ void LLAvatarActions::startIM(const LLUUID& id) if (id.isNull()) return; +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStartIM(id)) ) + { + LLUUID idSession = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id); + if ( (idSession.notNull()) && (!gIMMgr->hasSession(idSession)) ) + { + make_ui_sound("UISndInvalidOp"); + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", id, "completename").getSLURLString())); + return; + } + } +// [/RLVa:KB] + LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_cache_start_im, _1, _2)); } @@ -230,6 +246,20 @@ void LLAvatarActions::startCall(const LLUUID& id) { return; } + +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStartIM(id)) ) + { + LLUUID idSession = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id); + if ( (idSession.notNull()) && (!gIMMgr->hasSession(idSession)) ) + { + make_ui_sound("UISndInvalidOp"); + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", id, "completename").getSLURLString())); + return; + } + } +// [/RLVa:KB] + LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_cache_start_call, _1, _2)); } @@ -246,7 +276,17 @@ void LLAvatarActions::startAdhocCall(const uuid_vec_t& ids) LLDynamicArray id_array; for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { - id_array.push_back(*it); +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + const LLUUID& idAgent = *it; + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStartIM(idAgent)) ) + { + make_ui_sound("UISndInvalidOp"); + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTCONF, LLSD().with("RECIPIENT", LLSLURL("agent", idAgent, "completename").getSLURLString())); + return; + } + id_array.push_back(idAgent); +// [/RLVa:KB] +// id_array.push_back(*it); } // create the new ad hoc voice session @@ -291,7 +331,17 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids) LLDynamicArray id_array; for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { - id_array.push_back(*it); +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + const LLUUID& idAgent = *it; + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStartIM(idAgent)) ) + { + make_ui_sound("UISndInvalidOp"); + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTCONF, LLSD().with("RECIPIENT", LLSLURL("agent", idAgent, "completename").getSLURLString())); + return; + } + id_array.push_back(idAgent); +// [/RLVa:KB] +// id_array.push_back(*it); } const std::string title = LLTrans::getString("conference-title"); LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START, ids[0], id_array); diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 76f10e2d56..eea9bec10b 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -310,3 +310,13 @@ void LLAvatarIconCtrl::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarN } } } + +// [SL:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a +BOOL LLAvatarIconCtrl::handleToolTip(S32 x, S32 y, MASK mask) +{ + // Don't show our tooltip if we were asked not to + if (!mDrawTooltip) + return FALSE; + return LLIconCtrl::handleToolTip(x, y, mask); +} +// [/SL:KB] diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h index 7f568fc5b8..abb0f545dc 100644 --- a/indra/newview/llavatariconctrl.h +++ b/indra/newview/llavatariconctrl.h @@ -81,6 +81,10 @@ protected: public: virtual ~LLAvatarIconCtrl(); +// [SL:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); +// [/SL:KB] + virtual void setValue(const LLSD& value); // LLAvatarPropertiesProcessor observer trigger diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 771419f60a..cbbac4d7ff 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -46,6 +46,9 @@ #include "lluuid.h" #include "llvoiceclient.h" #include "llviewercontrol.h" // for gSavedSettings +// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) +#include "rlvhandler.h" +// [/RLVa:KB] static LLDefaultChildRegistry::Register r("avatar_list"); @@ -139,6 +142,9 @@ LLAvatarList::LLAvatarList(const Params& p) , mShowProfileBtn(p.show_profile_btn) , mShowSpeakingIndicator(p.show_speaking_indicator) , mShowPermissions(p.show_permissions_granted) +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d +, mRlvCheckShowNames(false) +// [/RLVa:KB] { setCommitOnSelectionChange(true); @@ -432,6 +438,9 @@ S32 LLAvatarList::notifyParent(const LLSD& info) void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d + item->setRlvCheckShowNames(mRlvCheckShowNames); +// [/RLVa:KB] // This sets the name as a side effect item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); @@ -452,7 +461,10 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is BOOL LLAvatarList::handleRightMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); - if ( mContextMenu && !isAvalineItemSelected()) +// if ( mContextMenu && !isAvalineItemSelected()) +// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) | Modified: RLVa-1.2.0d + if ( (mContextMenu && !isAvalineItemSelected()) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ) +// [/RLVa:KB] { uuid_vec_t selected_uuids; getSelectedUUIDs(selected_uuids); @@ -523,7 +535,11 @@ void LLAvatarList::updateLastInteractionTimes() void LLAvatarList::onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask) { - mItemDoubleClickSignal(ctrl, x, y, mask); +// mItemDoubleClickSignal(ctrl, x, y, mask); +// [RLVa:KB] - Checked: 2010-06-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d + if ( (!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) + mItemDoubleClickSignal(ctrl, x, y, mask); +// [/RLVa:KB] } bool LLAvatarItemComparator::compare(const LLPanel* item1, const LLPanel* item2) const diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 4814a88a79..4a3af31c57 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -88,6 +88,12 @@ public: // Return true if filter has at least one match. bool filterHasMatches(); +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d + void setRlvCheckShowNames(bool fRlvCheckShowNames) { mRlvCheckShowNames = fRlvCheckShowNames; } + // We need this to be public since we call it from RlvUIEnabler::onToggleShowNames() + void updateAvatarNames(); +// [/RLVa:KB] + boost::signals2::connection setRefreshCompleteCallback(const commit_signal_t::slot_type& cb); boost::signals2::connection setItemDoubleClickCallback(const mouse_signal_t::slot_type& cb); @@ -108,7 +114,7 @@ protected: void updateLastInteractionTimes(); void rebuildNames(); void onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask); - void updateAvatarNames(); +// void updateAvatarNames(); private: @@ -123,6 +129,9 @@ private: bool mShowProfileBtn; bool mShowSpeakingIndicator; bool mShowPermissions; +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d + bool mRlvCheckShowNames; +// [/RLVa:KB] LLTimer* mLITUpdateTimer; // last interaction time update timer std::string mIconParamName; diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 30eecfe323..cded558f46 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -38,6 +38,9 @@ #include "llavatarnamecache.h" #include "llavatariconctrl.h" #include "lloutputmonitorctrl.h" +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) +#include "rlvhandler.h" +// [/RLVa:KB] bool LLAvatarListItem::sStaticInitialized = false; S32 LLAvatarListItem::sLeftPadding = 0; @@ -72,6 +75,9 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) mOnlineStatus(E_UNKNOWN), mShowInfoBtn(true), mShowProfileBtn(true), +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d + mRlvCheckShowNames(false), +// [/RLVa:KB] mShowPermissions(false), mHovered(false) { @@ -142,8 +148,12 @@ S32 LLAvatarListItem::notifyParent(const LLSD& info) void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) { getChildView("hovered_icon")->setVisible( true); - mInfoBtn->setVisible(mShowInfoBtn); - mProfileBtn->setVisible(mShowProfileBtn); +// mInfoBtn->setVisible(mShowInfoBtn); +// mProfileBtn->setVisible(mShowProfileBtn); +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d + mInfoBtn->setVisible( (mShowInfoBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ); + mProfileBtn->setVisible( (mShowProfileBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ); +// [/RLVa:KB] mHovered = true; LLPanel::onMouseEnter(x, y, mask); @@ -321,12 +331,18 @@ void LLAvatarListItem::onProfileBtnClick() BOOL LLAvatarListItem::handleDoubleClick(S32 x, S32 y, MASK mask) { - if(mInfoBtn->getRect().pointInRect(x, y)) +// if(mInfoBtn->getRect().pointInRect(x, y)) +// [SL:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + if ( (mInfoBtn->getVisible()) && (mInfoBtn->getEnabled()) && (mInfoBtn->getRect().pointInRect(x, y)) ) +// [/SL:KB] { onInfoBtnClick(); return TRUE; } - if(mProfileBtn->getRect().pointInRect(x, y)) +// if(mProfileBtn->getRect().pointInRect(x, y)) +// [SL:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + if ( (mProfileBtn->getVisible()) && (mProfileBtn->getEnabled()) && (mProfileBtn->getRect().pointInRect(x, y)) ) +// [/SL:KB] { onProfileBtnClick(); return TRUE; @@ -371,8 +387,15 @@ void LLAvatarListItem::setNameInternal(const std::string& name, const std::strin void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name) { - setAvatarName(av_name.mDisplayName); - setAvatarToolTip(av_name.mUsername); +// setAvatarName(av_name.mDisplayName); +// setAvatarToolTip(av_name.mUsername); +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + bool fRlvFilter = (mRlvCheckShowNames) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + setAvatarName( (!fRlvFilter) ? av_name.mDisplayName : RlvStrings::getAnonym(av_name) ); + setAvatarToolTip( (!fRlvFilter) ? av_name.mUsername : RlvStrings::getAnonym(av_name) ); + // TODO-RLVa: bit of a hack putting this here. Maybe find a better way? + mAvatarIcon->setDrawTooltip(!fRlvFilter); +// [/RLVa:KB] //requesting the list to resort notifyParent(LLSD().with("sort", LLSD())); diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index c95ac39696..0738c5a85e 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -103,6 +103,9 @@ public: void setShowPermissions(bool show) { mShowPermissions = show; }; void showLastInteractionTime(bool show); void setAvatarIconVisible(bool visible); +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d + void setRlvCheckShowNames(bool fRlvCheckShowNames) { mRlvCheckShowNames = fRlvCheckShowNames; } +// [/RLVa:KB] const LLUUID& getAvatarId() const; std::string getAvatarName() const; @@ -208,6 +211,9 @@ private: //Speaker indicator and avatar name coords are translated accordingly bool mShowInfoBtn; bool mShowProfileBtn; +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d + bool mRlvCheckShowNames; +// [/RLVa:KB] /// indicates whether to show icons representing permissions granted bool mShowPermissions; diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index f2375bfa4f..afd261a00e 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -315,6 +315,10 @@ void LLCallFloater::updateSession() setVisible(true); } } + +// [RLVa:KB] - Checked: 2010-06-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d + mAvatarList->setRlvCheckShowNames(is_local_chat); +// [/RLVa:KB] } void LLCallFloater::refreshParticipantList() diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 00a3f76e56..7b106a5fd9 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -75,6 +75,10 @@ public: static void sOnCurrentChannelChanged(const LLUUID& session_id); +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d + LLAvatarList* getAvatarCallerList() { return mAvatarList; } +// [/RLVa:KB] + private: typedef enum e_voice_controls_type { diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index d6095cce07..33ea772b02 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -60,6 +60,9 @@ #include "llui.h" #include "llviewermenu.h" #include "lluictrlfactory.h" +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) +#include "rlvhandler.h" +// [/RLVa:KB] // // Globals @@ -79,7 +82,10 @@ private: }; -extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); +//extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) | Modified: RLVa-0.2.2a +extern void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel); +// [/RLVa:KB] // // Functions @@ -472,7 +478,11 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata ) S32 length = raw_text.length(); - if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences +// if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences +// [RLVa:KB] - Checked: 2010-03-26 (RLVa-1.2.0b) | Modified: RLVa-1.0.0d + // RELEASE-RLVa: [SL-2.0.0] This entire class appears to be dead/non-functional? + if ( (length > 0) && (raw_text[0] != '/') && (!gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT)) ) +// [/RLVa:KB] { gAgent.startTyping(); } @@ -584,6 +594,22 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL utf8_text = utf8str_truncate(utf8_text, MAX_STRING - 1); } +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0b + // RELEASE-RLVa: [SL-2.0.0] This entire class appears to be dead/non-functional? + if ( (0 == channel) && (rlv_handler_t::isEnabled()) ) + { + // Adjust the (public) chat "volume" on chat and gestures (also takes care of playing the proper animation) + if ( ((CHAT_TYPE_SHOUT == type) || (CHAT_TYPE_NORMAL == type)) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATNORMAL)) ) + type = CHAT_TYPE_WHISPER; + else if ( (CHAT_TYPE_SHOUT == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATSHOUT)) ) + type = CHAT_TYPE_NORMAL; + else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATWHISPER)) ) + type = CHAT_TYPE_NORMAL; + + animate &= !gRlvHandler.hasBehaviour( (!RlvUtil::isEmote(utf8_text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE ); + } +// [/RLVa:KB] + // Don't animate for chats people can't hear (chat to scripts) if (animate && (channel == 0)) { diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 3e1fa1e49b..d7ce35d745 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -56,8 +56,10 @@ #include "llworld.h" #include "lluiconstants.h" #include "llstring.h" - #include "llviewercontrol.h" +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) +#include "rlvcommon.h" +// [/RLVa:KB] static LLDefaultChildRegistry::Register r("chat_history"); @@ -89,6 +91,10 @@ public: LLSD payload; payload["object_id"] = object_id; payload["owner_id"] = query_map["owner"]; +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + if (query_map.has("rlv_shownames")) + payload["rlv_shownames"] = query_map["rlv_shownames"]; +// [/RLVa:KB] payload["name"] = query_map["name"]; payload["slurl"] = LLWeb::escapeURL(query_map["slurl"]); payload["group_owned"] = query_map["groupowned"]; @@ -103,6 +109,10 @@ class LLChatHistoryHeader: public LLPanel public: LLChatHistoryHeader() : LLPanel(), +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) | Added: RLVa-1.2.0f + mShowContextMenu(true), + mShowInfoCtrl(true), +// [/RLVa:KB] mPopupMenuHandleAvatar(), mPopupMenuHandleObject(), mAvatarID(), @@ -226,7 +236,11 @@ public: void showInspector() { - if (mAvatarID.isNull() && CHAT_SOURCE_SYSTEM != mSourceType) return; +// if (mAvatarID.isNull() && CHAT_SOURCE_SYSTEM != mSourceType) return; +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) | Added: RLVa-1.2.0f + // Don't double-click show the inspector if we're not showing the info control + if ( (!mShowInfoCtrl) || (mAvatarID.isNull() && CHAT_SOURCE_SYSTEM != mSourceType) ) return; +// [/RLVa:KB] if (mSourceType == CHAT_SOURCE_OBJECT) { @@ -286,9 +300,26 @@ public: // Start with blank so sample data from XUI XML doesn't // flash on the screen - user_name->setValue( LLSD() ); - LLAvatarNameCache::get(mAvatarID, - boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); +// user_name->setValue( LLSD() ); +// LLAvatarNameCache::get(mAvatarID, +// boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + if (!chat.mRlvNamesFiltered) + { + user_name->setValue( LLSD() ); + LLAvatarNameCache::get(mAvatarID, + boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); + } + else + { + // If the agent's chat was subject to @shownames=n we should display their anonimized name + mFrom = chat.mFromName; + user_name->setValue(mFrom); + user_name->setToolTip(mFrom); + setToolTip(mFrom); + updateMinUserNameWidth(); + } +// [/RLVa:KB] } else if (chat.mChatStyle == CHAT_STYLE_HISTORY || mSourceType == CHAT_SOURCE_AGENT) @@ -340,6 +371,15 @@ public: if(mSourceType != CHAT_SOURCE_AGENT || mAvatarID.isNull()) icon->setDrawTooltip(false); +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) | Added: RLVa-1.2.0f + // Don't show the context menu, info control or avatar icon tooltip if this chat was subject to @shownames=n + if ( (chat.mRlvNamesFiltered) && ((CHAT_SOURCE_AGENT == mSourceType) || (CHAT_SOURCE_OBJECT == mSourceType)) ) + { + mShowInfoCtrl = mShowContextMenu = false; + icon->setDrawTooltip(false); + } +// [/RLVa:KB] + switch (mSourceType) { case CHAT_SOURCE_AGENT: @@ -450,6 +490,10 @@ protected: void showContextMenu(S32 x,S32 y) { +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) | Added: RLVa-1.2.0f + if (!mShowContextMenu) + return; +// [/RLVa:KB] if(mSourceType == CHAT_SOURCE_SYSTEM) showSystemContextMenu(x,y); if(mAvatarID.notNull() && mSourceType == CHAT_SOURCE_AGENT) @@ -501,6 +545,9 @@ protected: void showInfoCtrl() { if (mAvatarID.isNull() || mFrom.empty() || CHAT_SOURCE_SYSTEM == mSourceType) return; +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) | Added: RLVa-1.2.0f + if ( (!mShowInfoCtrl) || (mAvatarID.isNull() || mFrom.empty() || CHAT_SOURCE_SYSTEM == mSourceType) ) return; +// [/RLVa:KB] if (!sInfoCtrl) { @@ -570,6 +617,10 @@ protected: EChatSourceType mSourceType; std::string mFrom; LLUUID mSessionID; +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) | Added: RLVa-1.2.0f + bool mShowContextMenu; + bool mShowInfoCtrl; +// [/RLVa:KB] S32 mMinUserNameWidth; const LLFontGL* mUserNameFont; @@ -800,8 +851,18 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. if ( chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mFromID.notNull()) { - // for object IMs, create a secondlife:///app/objectim SLapp - std::string url = LLViewerChat::getSenderSLURL(chat, args); +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + // NOTE-RLVa: we don't need to do any @shownames or @showloc filtering here because we'll already have an existing URL + std::string url = chat.mURL; + RLV_ASSERT( (url.empty()) || (std::string::npos != url.find("objectim")) ); + if ( (url.empty()) || (std::string::npos == url.find("objectim")) ) + { +// [/RLVa:KB] + // for object IMs, create a secondlife:///app/objectim SLapp + /*std::string*/ url = LLViewerChat::getSenderSLURL(chat, args); +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + } +// [/RLVa:KB] // set the link for the object name to be the objectim SLapp // (don't let object names with hyperlinks override our objectim Url) @@ -815,7 +876,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL mEditor->appendText(chat.mFromName + delimiter, false, link_params); } - else if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) +// else if (chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + else if (chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log && !chat.mRlvNamesFiltered) +// [/RLVa:KB] { LLStyle::Params link_params(style_params); link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 9a84280f25..e798fe3cfc 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -42,6 +42,10 @@ #include "llslurl.h" +// [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.0f) +#include "rlvhandler.h" +// [/RLVa:KB] + static const S32 msg_left_offset = 10; static const S32 msg_right_offset = 10; static const S32 msg_height_pad = 5; @@ -177,7 +181,11 @@ void LLNearbyChatToastPanel::init(LLSD& notification) std::string fromName = notification["from"].asString(); // agent or object name mFromID = notification["from_id"].asUUID(); // agent id or object id mFromName = fromName; - + +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + mShowIconTooltip = notification.has("show_icon_tooltip") ? notification["show_icon_tooltip"].asBoolean() : true; +// [/RLVa:KB] + int sType = notification["source"].asInteger(); mSourceType = (EChatSourceType)sType; @@ -222,8 +230,15 @@ void LLNearbyChatToastPanel::init(LLSD& notification) style_params_name.font.name(font_name); style_params_name.font.size(font_style_size); - style_params_name.link_href = notification["sender_slurl"].asString(); - style_params_name.is_link = true; +// style_params_name.link_href = notification["sender_slurl"].asString(); +// style_params_name.is_link = true; +// [RLVa:KB] - Checked: 2011-12-13 (RLVa-1.4.6) | Added: RLVa-1.4.6 + if (notification.has("sender_slurl")) + { + style_params_name.link_href = notification["sender_slurl"].asString(); + style_params_name.is_link = true; + } +// [/RLVa:KB] msg_text->appendText(str_sender, FALSE, style_params_name); @@ -360,7 +375,10 @@ void LLNearbyChatToastPanel::draw() LLAvatarIconCtrl* icon = getChild("avatar_icon", false); if(icon) { - icon->setDrawTooltip(mSourceType == CHAT_SOURCE_AGENT); +// icon->setDrawTooltip(mSourceType == CHAT_SOURCE_AGENT); +// [RLVa:KB] - Checked: 2010-04-200 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + icon->setDrawTooltip( (mShowIconTooltip) && (mSourceType == CHAT_SOURCE_AGENT) ); +// [/RLVa:KB] if(mSourceType == CHAT_SOURCE_OBJECT) icon->setValue(LLSD("OBJECT_Icon")); else if(mSourceType == CHAT_SOURCE_SYSTEM) diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h index 1d700dcede..f1ae1fe283 100644 --- a/indra/newview/llchatitemscontainerctrl.h +++ b/indra/newview/llchatitemscontainerctrl.h @@ -46,6 +46,9 @@ protected: LLNearbyChatToastPanel() : mIsDirty(false), +// [RLVa:KB] - Checked: 2010-04-200 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + mShowIconTooltip(true), +// [/RLVa:KB] mSourceType(CHAT_SOURCE_OBJECT) {}; public: @@ -89,6 +92,9 @@ private: bool mIsDirty; +// [RLVa:KB] - Checked: 2010-04-200 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + bool mShowIconTooltip; +// [/RLVa:KB] }; diff --git a/indra/newview/lldaycyclemanager.cpp b/indra/newview/lldaycyclemanager.cpp index 8af2f4ea33..b8b4f9b09d 100644 --- a/indra/newview/lldaycyclemanager.cpp +++ b/indra/newview/lldaycyclemanager.cpp @@ -30,6 +30,10 @@ #include "lldiriterator.h" +// [RLVa:KB] - Checked: 2011-09-04 (RLVa-1.4.1a) | Added: RLVa-1.4.1a +#include +// [/RLVa:KB] + void LLDayCycleManager::getPresetNames(preset_name_list_t& names) const { names.clear(); @@ -60,6 +64,18 @@ void LLDayCycleManager::getPresetNames(preset_name_list_t& user, preset_name_lis } } +// [RLVa:KB] - Checked: 2011-09-04 (RLVa-1.4.1a) | Added: RLVa-1.4.1a +const std::string& LLDayCycleManager::findPreset(const std::string& strPresetName) +{ + for (dc_map_t::const_iterator itCycle = mDayCycleMap.begin(); itCycle != mDayCycleMap.end(); ++itCycle) + { + if (boost::iequals(itCycle->first, strPresetName)) + return itCycle->first; + } + return LLStringUtil::null; +} +// [/RLVa:KB] + void LLDayCycleManager::getUserPresetNames(preset_name_list_t& user) const { preset_name_list_t sys; // unused diff --git a/indra/newview/lldaycyclemanager.h b/indra/newview/lldaycyclemanager.h index 3d2144960d..81b31dc71c 100644 --- a/indra/newview/lldaycyclemanager.h +++ b/indra/newview/lldaycyclemanager.h @@ -51,6 +51,9 @@ public: void getPresetNames(preset_name_list_t& names) const; void getPresetNames(preset_name_list_t& user, preset_name_list_t& sys) const; void getUserPresetNames(preset_name_list_t& user) const; +// [RLVa:KB] - Checked: 2011-09-04 (RLVa-1.4.1a) | Added: RLVa-1.4.1a + const std::string& findPreset(const std::string& strPresetName); +// [/RLVa:KB] bool getPreset(const std::string name, LLWLDayCycle& day_cycle) const; bool getPreset(const std::string name, LLSD& day_cycle) const; diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index 86fe6754dc..5df9ac428b 100644 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -35,6 +35,10 @@ #include "llwaterparammanager.h" #include "llwlhandlers.h" #include "llwlparammanager.h" +// [RLVa:KB] - Checked: 2011-09-04 (RLVa-1.4.1a) | Added: RLVa-1.4.1a +#include +#include "rlvhandler.h" +// [/RLVa:KB] std::string LLEnvPrefs::getWaterPresetName() const { @@ -484,7 +488,10 @@ void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content) LLWLParamManager::instance().refreshRegionPresets(); // If using server settings, update managers. - if (getUseRegionSettings()) +// if (getUseRegionSettings()) +// [RLVa:KB] - Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a + if ( (getUseRegionSettings()) && (LLWLParamManager::getInstance()->mAnimator.getIsRunning()) ) +// [/RLVa:KB] { updateManagersFromPrefs(mInterpNextChangeMessage); } @@ -594,6 +601,13 @@ void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate) void LLEnvManagerNew::updateManagersFromPrefs(bool interpolate) { +// [RLVa:KB] - Checked: 2011-09-04 (RLVa-1.4.1a) | Added: RLVa-1.4.1a + if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) + { + return; + } +// [/RLVa:KB] + // Apply water settings. updateWaterFromPrefs(interpolate); diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 83fb887d81..88b389e0fb 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -43,6 +43,9 @@ #include "llviewerregion.h" #include "llversioninfo.h" #include "llweb.h" +// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.4.0a) +#include "rlvhandler.h" +// [/RLVa:KB] // Linden library includes #include "llaudioengine.h" @@ -274,6 +277,9 @@ LLSD LLFloaterAbout::getInfo() } #endif +// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.4.0a) | Added: RLVa-1.2.0e + info["RLV_VERSION"] = (rlv_handler_t::isEnabled()) ? RlvStrings::getVersionAbout() : "(disabled)"; +// [/RLVa:KB] info["OPENGL_VERSION"] = (const char*)(glGetString(GL_VERSION)); info["LIBCURL_VERSION"] = LLCurl::getVersionString(); info["J2C_VERSION"] = LLImageJ2C::getEngineInfo(); diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 0290e7cdf0..d23d6bbc8c 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -37,6 +37,9 @@ #include "llviewercontrol.h" #include "llviewerregion.h" // getCapability() #include "llworld.h" +// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) +#include "rlvhandler.h" +// [/RLVa:KB] // Linden libraries #include "llavatarnamecache.h" // IDEVO @@ -260,6 +263,22 @@ void LLFloaterAvatarPicker::onRangeAdjust() void LLFloaterAvatarPicker::onList() { getChildView("ok_btn")->setEnabled(isSelectBtnEnabled()); + +// [RLVa:KB] - Checked: 2010-06-05 (RLVa-1.2.2a) | Modified: RLVa-1.2.0d + if (rlv_handler_t::isEnabled()) + { + LLTabContainer* pTabs = getChild("ResidentChooserTabs"); + LLPanel* pNearMePanel = getChild("NearMePanel"); + RLV_ASSERT( (pTabs) && (pNearMePanel) ); + if ( (pTabs) && (pNearMePanel) ) + { + bool fRlvEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); + pTabs->enableTabButton(pTabs->getIndexForPanel(pNearMePanel), fRlvEnable); + if ( (!fRlvEnable) && (pTabs->getCurrentPanel() == pNearMePanel) ) + pTabs->selectTabByName("SearchPanel"); + } + } +// [/RLVa:KB] } void LLFloaterAvatarPicker::populateNearMe() @@ -515,7 +534,10 @@ BOOL LLFloaterAvatarPicker::handleDragAndDrop(S32 x, S32 y, MASK mask, std::string avatar_name = selection->getColumn(0)->getValue().asString(); if (dest_agent_id.notNull() && dest_agent_id != gAgentID) { - if (drop) +// if (drop) +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + if ( (drop) && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canStartIM(dest_agent_id)) ) ) +// [/RLVa:KB] { // Start up IM before give the item session_id = gIMMgr->addSession(avatar_name, IM_NOTHING_SPECIAL, dest_agent_id); diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index cece8d299c..41b7b24f70 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -41,6 +41,10 @@ #include "llviewercontrol.h" #include "llviewerobject.h" #include "lluictrlfactory.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "llagent.h" +// [/RLVa:KB] //LLFloaterInspect* LLFloaterInspect::sInstance = NULL; @@ -113,7 +117,16 @@ void LLFloaterInspect::onClickCreatorProfile() LLSelectNode* node = mObjectSelection->getFirstNode(&func); if(node) { - LLAvatarActions::showProfile(node->mPermissions->getCreator()); +// LLAvatarActions::showProfile(node->mPermissions->getCreator()); +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e + const LLUUID& idCreator = node->mPermissions->getCreator(); + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + ((node->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator))) ) + { + return; + } + LLAvatarActions::showProfile(idCreator); +// [/RLVa:KB] } } } @@ -139,6 +152,10 @@ void LLFloaterInspect::onClickOwnerProfile() if(node) { const LLUUID& owner_id = node->mPermissions->getOwner(); +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + return; +// [/RLVa:KB] LLAvatarActions::showProfile(owner_id); } } @@ -148,8 +165,13 @@ void LLFloaterInspect::onSelectObject() { if(LLFloaterInspect::getSelectedUUID() != LLUUID::null) { - getChildView("button owner")->setEnabled(true); +// getChildView("button owner")->setEnabled(true); +// getChildView("button creator")->setEnabled(true); +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e + getChildView("button owner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + // TODO-RLVa: [RLVa-1.2.2] Is it worth checking the selected node just to selectively disable this button? getChildView("button creator")->setEnabled(true); +// [/RLVa:KB] } } @@ -224,7 +246,12 @@ void LLFloaterInspect::refresh() // actual name and set a placeholder. if (LLAvatarNameCache::get(idOwner, &av_name)) { - owner_name = av_name.getCompleteName(); +// owner_name = av_name.getCompleteName(); +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idOwner != gAgent.getID()) && + (!obj->mPermissions->isGroupOwned()); + owner_name = (!fRlvFilterOwner) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); +// [/RLVa:KB] } else { @@ -234,14 +261,21 @@ void LLFloaterInspect::refresh() if (LLAvatarNameCache::get(idCreator, &av_name)) { - creator_name = av_name.getCompleteName(); +// creator_name = av_name.getCompleteName(); +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + const LLUUID& idCreator = obj->mPermissions->getCreator(); + LLAvatarNameCache::get(idCreator, &av_name); + bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idCreator != gAgent.getID()) && + ( (obj->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator)) ); + creator_name = (!fRlvFilterCreator) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); +// [/RLVa:KB] } else { creator_name = LLTrans::getString("RetrievingData"); LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::onGetAvNameCallback, _1, _2, this)); } - + row["id"] = obj->getObject()->getID(); row["columns"][0]["column"] = "object_name"; row["columns"][0]["type"] = "text"; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 542e96cf16..97413c7765 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -106,6 +106,9 @@ #include "llpluginclassmedia.h" #include "llteleporthistorystorage.h" #include "llproxy.h" +// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) +#include "rlvhandler.h" +// [/RLVa:KB] #include "lllogininstance.h" // to check if logged in yet #include "llsdserialize.h" @@ -1025,6 +1028,11 @@ void LLFloaterPreference::refreshEnabledState() LLComboBox* ctrl_reflections = getChild("Reflections"); LLRadioGroup* radio_reflection_detail = getChild("ReflectionDetailRadio"); +// [RLVa:KB] - Checked: 2010-04-09 (RLVa-1.2.0e) | Modified: RLVa-1.2.0e + if (rlv_handler_t::isEnabled()) + childSetEnabled("busy_response", !gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)); +// [/RLVa:KB] + // Reflections BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable") && gGLManager.mHasCubeMap @@ -1068,8 +1076,14 @@ void LLFloaterPreference::refreshEnabledState() // radio set for terrain detail mode LLRadioGroup* mRadioTerrainDetail = getChild("TerrainDetailRadio"); // can be linked with control var - ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); - +// ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); +// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-0.2.0a + // "Basic Shaders" can't be disabled - but can be enabled - under @setenv=n + bool fCtrlShaderEnable = LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"); + ctrl_shader_enable->setEnabled( + fCtrlShaderEnable && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) || (!gSavedSettings.getBOOL("VertexShaderEnable"))) ); +// [/RLVa:KB] + BOOL shaders = ctrl_shader_enable->get(); if (shaders) { @@ -1086,7 +1100,13 @@ void LLFloaterPreference::refreshEnabledState() // *HACK just checks to see if we can use shaders... // maybe some cards that use shaders, but don't support windlight - ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); +// ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); +// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-0.2.0a + // "Atmospheric Shaders" can't be disabled - but can be enabled - under @setenv=n + bool fCtrlWindLightEnable = fCtrlShaderEnable && shaders; + ctrl_wind_light->setEnabled( + fCtrlWindLightEnable && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) ); +// [/RLVa:KB] //Deferred/SSAO/Shadows LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 3f00ba39c7..4eaa325657 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -58,6 +58,9 @@ #include "lluictrlfactory.h" +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) +#include "rlvhandler.h" +// [/RLVa:KB] //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLPropertiesObserver @@ -278,6 +281,16 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) getChildView("BtnCreator")->setEnabled(TRUE); getChildView("LabelCreatorTitle")->setEnabled(TRUE); getChildView("LabelCreatorName")->setEnabled(TRUE); +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.0.0e + // If the object creator matches the object owner we need to anonymize the creator field as well + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || + (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) ) + { + childSetEnabled("BtnCreator", FALSE); + name = RlvStrings::getAnonym(name); + } +// [/RLVa:KB] getChild("LabelCreatorName")->setValue(name); } else @@ -301,8 +314,15 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) else { gCacheName->getFullName(perm.getOwner(), name); +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.0.0e + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + name = RlvStrings::getAnonym(name); +// [/RLVa:KB] } - getChildView("BtnOwner")->setEnabled(TRUE); +// getChildView("BtnOwner")->setEnabled(TRUE); +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.0.0e + getChildView("BtnOwner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] getChildView("LabelOwnerTitle")->setEnabled(TRUE); getChildView("LabelOwnerName")->setEnabled(TRUE); getChild("LabelOwnerName")->setValue(name); @@ -539,6 +559,17 @@ void LLFloaterProperties::onClickCreator() if(!item) return; if(!item->getCreatorUUID().isNull()) { +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + const LLPermissions& perm = item->getPermissions(); + if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || + (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) + { + return; + } + } +// [/RLVa:KB] LLAvatarActions::showProfile(item->getCreatorUUID()); } } @@ -554,6 +585,10 @@ void LLFloaterProperties::onClickOwner() } else { +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.0.0e + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + return; +// [/RLVa:KB] LLAvatarActions::showProfile(item->getPermissions().getOwner()); } } diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 86bd15b217..4d69fc5ff0 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -251,6 +251,14 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) if (regionp) { getChild("sim_field")->setValue(regionp->getName()); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) +/* + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + childSetText("sim_field", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); + } +*/ +// [/RLVa:KB] LLVector3d global_pos; global_pos.setVec(objectp->getPositionRegion()); setPosBox(global_pos); diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 07f5220ab7..796710bfb0 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -209,6 +209,20 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) if (controlp) { +// [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a + // If "HideFromEditor" was toggled while the floater is open then we need to manually disable access to the control + // NOTE: this runs per-frame so there's no need to explictly handle onCommitSettings() or onClickDefault() + bool fEnable = !controlp->isHiddenFromSettingsEditor(); + spinner1->setEnabled(fEnable); + spinner2->setEnabled(fEnable); + spinner3->setEnabled(fEnable); + spinner4->setEnabled(fEnable); + color_swatch->setEnabled(fEnable); + childSetEnabled("val_text", fEnable); + childSetEnabled("boolean_combo", fEnable); + childSetEnabled("default_btn", fEnable); +// [/RLVa:KB] + eControlType type = controlp->type(); //hide combo box only for non booleans, otherwise this will result in the combo box closing every frame diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index ce5ea66471..aa4280d911 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -39,6 +39,10 @@ //static const std::string LLFloaterSidePanelContainer::sMainPanelName("main_panel"); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 +LLFloaterSidePanelContainer::validate_signal_t LLFloaterSidePanelContainer::mValidateSignal; +// [/RLVa:KB] + LLFloaterSidePanelContainer::LLFloaterSidePanelContainer(const LLSD& key, const Params& params) : LLFloater(key, params) { @@ -107,10 +111,25 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na return panel; } +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 +bool LLFloaterSidePanelContainer::canShowPanel(const std::string& floater_name, const LLSD& key) +{ + return mValidateSignal(floater_name, sMainPanelName, key); +} + +bool LLFloaterSidePanelContainer::canShowPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key) +{ + return mValidateSignal(floater_name, panel_name, key); +} +// [/RLVa:KB] + void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& key) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance(floater_name); - if (floaterp) +// if (floaterp) +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (floaterp) && (mValidateSignal(floater_name, sMainPanelName, key)) ) +// [/RLVa:KB] { floaterp->openChildPanel(sMainPanelName, key); } @@ -119,7 +138,10 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance(floater_name); - if (floaterp) +// if (floaterp) +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (floaterp) && (mValidateSignal(floater_name, panel_name, key)) ) +// [/RLVa:KB] { floaterp->openChildPanel(panel_name, key); } diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 491723471f..0dfcefe060 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -55,6 +55,11 @@ public: LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + static bool canShowPanel(const std::string& floater_name, const LLSD& key); + static bool canShowPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); +// [/RLVa:KB] + static void showPanel(const std::string& floater_name, const LLSD& key); static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); @@ -78,6 +83,15 @@ public: } return panel; } + +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + // Used to determine whether a sidepanel can be shown +public: + typedef boost::signals2::signal validate_signal_t; + static boost::signals2::connection setValidateCallback(const validate_signal_t::slot_type& cb) { return mValidateSignal.connect(cb); } +private: + static validate_signal_t mValidateSignal; +// [/RLVa:KB] }; #endif // LL_LLFLOATERSIDEPANELCONTAINER_H diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 137b5446cf..3d679cc886 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -75,6 +75,10 @@ #include "llwindow.h" // copyTextToClipboard() #include +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) +#include "rlvhandler.h" +// [/RLVa:KB] + //--------------------------------------------------------------------------- // Constants //--------------------------------------------------------------------------- @@ -492,6 +496,10 @@ void LLFloaterWorldMap::draw() // getChildView("Clear")->setEnabled((BOOL)tracking_status); getChildView("Show Destination")->setEnabled((BOOL)tracking_status || LLWorldMap::getInstance()->isTracking()); getChildView("copy_slurl")->setEnabled((mSLURL.isValid()) ); +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + childSetEnabled("Go Home", + (!rlv_handler_t::isEnabled()) || !(gRlvHandler.hasBehaviour(RLV_BHVR_TPLM) && gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC))); +// [/RLVa:KB] setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE); @@ -665,7 +673,10 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) std::string tooltip(""); mTrackedStatus = LLTracker::TRACKING_LOCATION; - LLTracker::trackLocation(pos_global, full_name, tooltip); +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + LLTracker::trackLocation(pos_global, (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? full_name : RlvStrings::getString(RLV_STRING_HIDDEN).c_str(), tooltip); +// [/RLVa:KB] +// LLTracker::trackLocation(pos_global, full_name, tooltip); LLWorldMap::getInstance()->cancelTracking(); // The floater is taking over the tracking LLVector3d coord_pos = LLTracker::getTrackedPositionGlobal(); @@ -680,9 +691,25 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) // enable/disable teleport destination coordinates void LLFloaterWorldMap::enableTeleportCoordsDisplay( bool enabled ) { - childSetEnabled("teleport_coordinate_x", enabled ); - childSetEnabled("teleport_coordinate_y", enabled ); - childSetEnabled("teleport_coordinate_z", enabled ); +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + LLUICtrl* pCtrl = getChild("events_label"); + pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); + + pCtrl = getChild("teleport_coordinate_x"); + pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); + pCtrl->setEnabled(enabled); + + pCtrl = getChild("teleport_coordinate_y"); + pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); + pCtrl->setEnabled(enabled); + + pCtrl = getChild("teleport_coordinate_z"); + pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); + pCtrl->setEnabled(enabled); +// [/RLVa:KB] +// childSetEnabled("teleport_coordinate_x", enabled ); +// childSetEnabled("teleport_coordinate_y", enabled ); +// childSetEnabled("teleport_coordinate_z", enabled ); } // update display of teleport destination coordinates - pos is in global coordinates @@ -721,7 +748,22 @@ void LLFloaterWorldMap::updateLocation() // Make sure we know where we are before setting the current user position std::string agent_sim_name; gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( agentPos, agent_sim_name ); - if ( gotSimName ) +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + mSetToUserPosition = FALSE; + + // Fill out the location field + getChild("location")->setValue(RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); + + // update the coordinate display with location of avatar in region + updateTeleportCoordsDisplay( agentPos ); + + mSLURL = LLSLURL(); + } + else if (gotSimName) +// [/RLVa:KB] +// if ( gotSimName ) { mSetToUserPosition = FALSE; @@ -766,7 +808,16 @@ void LLFloaterWorldMap::updateLocation() updateTeleportCoordsDisplay( coord_pos ); // simNameFromPosGlobal can fail, so don't give the user an invalid SLURL - if ( gotSimName ) +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + mSLURL = LLSLURL(); + + childSetValue("location", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); + } + else if (gotSimName) +// [/RLVa:KB] +// if ( gotSimName ) { mSLURL = LLSLURL(sim_name, pos_global); } diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 72bea8db10..da4fefdc01 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -46,6 +46,11 @@ #include "llrecentpeople.h" #include "llviewerobjectlist.h" #include "llvoavatarself.h" +// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.2a) +#include "llavatarnamecache.h" +#include "rlvhandler.h" +#include "rlvui.h" +// [/RLVa:KB] // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES // or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a @@ -315,6 +320,20 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im { gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args); } +// [RLVa:KB] - Checked: 2010-05-26 (RLVa-1.2.2a) | Modified: RLVa-1.2.0h + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(to_agent)) && + (!RlvUIEnabler::hasOpenProfile(to_agent)) ) + { + // Log to chat history if the user didn't drop on an IM session or a profile to avoid revealing the name of the recipient + std::string strMsgName = "inventory_item_offered-im"; LLSD args; LLAvatarName avName; + if (LLAvatarNameCache::get(to_agent, &avName)) + { + args["NAME"] = RlvStrings::getAnonym(avName); + strMsgName = "inventory_item_offered_rlv"; + } + gIMMgr->addSystemMessage(LLUUID::null, strMsgName, args); + } +// [/RLVa:KB] // If this item was given by drag-and-drop on avatar while IM panel was open, log this action in the IM panel chat. else if (LLIMModel::getInstance()->findIMSession(session_id)) { @@ -422,7 +441,15 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent, logInventoryOffer(to_agent, im_session_id); // add buddy to recent people list - LLRecentPeople::instance().add(to_agent); +// LLRecentPeople::instance().add(to_agent); +// [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.2a) | Added: RLVa-1.2.0f + // Block the recent activity update if this was an in-world drop on an avatar (as opposed to a drop on an IM session or on a profile) + if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || + (RlvUIEnabler::hasOpenProfile(to_agent)) ) + { + LLRecentPeople::instance().add(to_agent); + } +// [/RLVa:KB] } // static @@ -488,7 +515,15 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, << cat->getUUID() << llendl; // add buddy to recent people list - LLRecentPeople::instance().add(to_agent); +// LLRecentPeople::instance().add(to_agent); +// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0f + // Block the recent activity update if this was an in-world drop on an avatar (as opposed to a drop on an IM session or on a profile) + if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || + (RlvUIEnabler::hasOpenProfile(to_agent)) ) + { + LLRecentPeople::instance().add(to_agent); + } +// [/RLVa:KB] // Test out how many items are being given. LLViewerInventoryCategory::cat_array_t cats; diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 60fa53f491..841be9ff29 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -62,6 +62,9 @@ #include "llresmgr.h" #include "pipeline.h" #include "llspatialpartition.h" +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) +#include "rlvhandler.h" +// [/RLVa:KB] // Height of the yellow selection highlight posts for land const F32 PARCEL_POST_HEIGHT = 0.666f; @@ -69,6 +72,18 @@ const F32 PARCEL_POST_HEIGHT = 0.666f; // Returns true if you got at least one object void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) { +// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + // Block rectangle selection if: + // - prevented from editing and no exceptions are set (see below for the case where exceptions are set) + // - prevented from interacting at all + if ( (rlv_handler_t::isEnabled()) && + ( ((gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (!gRlvHandler.hasException(RLV_BHVR_EDIT))) || + (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) ) ) + { + return; + } +// [/RLVa:KB] + LLVector3 av_pos = gAgent.getPositionAgent(); F32 select_dist_squared = gSavedSettings.getF32("MaxSelectDistance"); select_dist_squared = select_dist_squared * select_dist_squared; @@ -133,6 +148,27 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) LLViewerCamera::getInstance()->setFar(new_far); LLViewerCamera::getInstance()->setNear(new_near); } +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.0.0g + if (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) + { + // We'll allow drag selection under fartouch, but only within the fartouch range + // (just copy/paste the code above us to make that work, thank you Lindens!) + LLVector3 relative_av_pos = av_pos; + relative_av_pos -= LLViewerCamera::getInstance()->getOrigin(); + + F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + 1.5f; + F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - 1.5f; + + new_near = llmax(new_near, 0.1f); + + LLViewerCamera::getInstance()->setFar(new_far); + LLViewerCamera::getInstance()->setNear(new_near); + + // Usurp these two + limit_select_distance = TRUE; + select_dist_squared = 1.5f * 1.5f; + } +// [/RLVa:KB] LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, center_x-width/2, center_y-height/2, width, height, limit_select_distance); @@ -207,6 +243,13 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) continue; } +// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Added: RLVa-1.3.0c + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canEdit(vobjp)) ) + { + continue; + } +// [/RLVa:KB] + S32 result = LLViewerCamera::getInstance()->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); if (result) { diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 623ebb76f2..45bdc7c1ec 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -41,6 +41,10 @@ #include "llstatusbar.h" // can_afford_transaction() #include "llimfloater.h" #include "groupchatlistener.h" +// [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.3.0f) +#include "llslurl.h" +#include "rlvhandler.h" +// [/RLVa:KB] // // Globals @@ -134,6 +138,15 @@ void LLGroupActions::startCall(const LLUUID& group_id) return; } +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStartIM(group_id)) && (!gIMMgr->hasSession(group_id)) ) + { + make_ui_sound("UISndInvalidOp"); + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("group", group_id, "about").getSLURLString())); + return; + } +// [/RLVa:KB] + LLUUID session_id = gIMMgr->addSession(gdata.mName, IM_SESSION_GROUP_START, group_id, true); if (session_id == LLUUID::null) { @@ -207,8 +220,12 @@ bool LLGroupActions::onJoinGroup(const LLSD& notification, const LLSD& response) // static void LLGroupActions::leave(const LLUUID& group_id) { - if (group_id.isNull()) +// if (group_id.isNull()) +// return; +// [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.4.1a) | Added: RLVa-1.3.0f + if ( (group_id.isNull()) || ((gAgent.getGroupID() == group_id) && (gRlvHandler.hasBehaviour(RLV_BHVR_SETGROUP))) ) return; +// [/RLVa:KB] S32 count = gAgent.mGroups.count(); S32 i; @@ -230,6 +247,13 @@ void LLGroupActions::leave(const LLUUID& group_id) // static void LLGroupActions::activate(const LLUUID& group_id) { +// [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.4.1a) | Added: RLVa-1.3.0f + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SETGROUP)) && (gRlvHandler.getAgentGroup() != group_id) ) + { + return; + } +// [/RLVa:KB] + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ActivateGroup); msg->nextBlockFast(_PREHASH_AgentData); @@ -326,6 +350,15 @@ LLUUID LLGroupActions::startIM(const LLUUID& group_id) { if (group_id.isNull()) return LLUUID::null; +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStartIM(group_id)) && (!gIMMgr->hasSession(group_id)) ) + { + make_ui_sound("UISndInvalidOp"); + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("group", group_id, "about").getSLURLString())); + return LLUUID::null; + } +// [/RLVa:KB] + LLGroupData group_data; if (gAgent.getGroupData(group_id, group_data)) { diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 129cddda45..2b11fdd7d8 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -43,6 +43,9 @@ #include "llviewercontrol.h" // for gSavedSettings #include "llviewermenu.h" // for gMenuHolder #include "llvoiceclient.h" +// [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.3.0f) | Added: RLVa-1.3.0f +#include "rlvhandler.h" +// [/RLVa:KB] static LLDefaultChildRegistry::Register r("group_list"); S32 LLGroupListItem::sIconWidth = 0; @@ -279,8 +282,14 @@ bool LLGroupList::onContextMenuItemEnable(const LLSD& userdata) bool real_group_selected = selected_group_id.notNull(); // a "real" (not "none") group is selected // each group including "none" can be activated +// if (userdata.asString() == "activate") +// return gAgent.getGroupID() != selected_group_id; +// [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.4.1a) | Added: RLVa-1.3.0f if (userdata.asString() == "activate") - return gAgent.getGroupID() != selected_group_id; + return (gAgent.getGroupID() != selected_group_id) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SETGROUP)); + else if (userdata.asString() == "leave") + return (real_group_selected) && ((gAgent.getGroupID() != selected_group_id) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SETGROUP))); +// [/RLVa:KB] if (userdata.asString() == "call") return real_group_selected && LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking(); diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 3c6bcd9829..ec7c7c6ff6 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -46,9 +46,11 @@ #include "llstatusbar.h" #include "llmenugl.h" #include "pipeline.h" +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) +#include "rlvhandler.h" +// [/RLVa:KB] #include - const F32 SPRING_STRENGTH = 0.7f; const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f; const F32 HORIZONTAL_PADDING = 15.f; @@ -252,7 +254,30 @@ void LLHUDText::renderText() void LLHUDText::setString(const std::string &text_utf8) { mTextSegments.clear(); - addLine(text_utf8, mColor); +// addLine(text_utf8, mColor); +// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.4.0a) | Modified: RLVa-1.0.0f + // NOTE: setString() is called for debug and map beacons as well + if (rlv_handler_t::isEnabled()) + { + std::string text(text_utf8); + if (gRlvHandler.canShowHoverText(mSourceObject)) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + RlvUtil::filterLocation(text); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + RlvUtil::filterNames(text); + } + else + { + text = ""; + } + addLine(text, mColor); + } + else + { + addLine(text_utf8, mColor); + } +// [/RLVa:KB] } void LLHUDText::clearString() @@ -632,3 +657,15 @@ F32 LLHUDText::LLHUDTextSegment::getWidth(const LLFontGL* font) return width; } } + +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f +void LLHUDText::refreshAllObjectText() +{ + for (TextObjectIterator itText = sTextObjects.begin(); itText != sTextObjects.end(); ++itText) + { + LLHUDText* pText = *itText; + if ( (pText) && (!pText->mObjText.empty()) && (pText->mSourceObject) && (LL_PCODE_VOLUME == pText->mSourceObject->getPCode()) ) + pText->setString(pText->mObjText); + } +} +// [/RLVa:KB] diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 36015d51f0..d5d81e1336 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -124,6 +124,11 @@ public: static void reshape(); static void setDisplayText(BOOL flag) { sDisplayText = flag ; } +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f + const std::string& getObjectText() const { return mObjText; } + void setObjectText(const std::string &utf8string) { mObjText = utf8string; } + static void refreshAllObjectText(); +// [/RLVa:KB] protected: LLHUDText(const U8 type); @@ -161,6 +166,9 @@ private: ETextAlignment mTextAlignment; EVertAlignment mVertAlignment; BOOL mHidden; +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f + std::string mObjText; +// [/RLVa:KB] static BOOL sDisplayText ; static std::set > sTextObjects; diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 63eedcdfea..55002e39d7 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -57,6 +57,9 @@ #include "llspeakers.h" #include "llviewerchat.h" #include "llautoreplace.h" +// [RLVa:KB] - Checked: 2010-04-09 (RLVa-1.2.0e) +#include "rlvhandler.h" +// [/RLVa:KB] LLIMFloater::LLIMFloater(const LLUUID& session_id) : LLTransientDockableFloater(NULL, true, session_id), @@ -206,6 +209,56 @@ void LLIMFloater::sendMsg() std::string utf8_text = wstring_to_utf8str(text); utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1); +// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIMTO)) ) + { + LLIMModel::LLIMSession* pIMSession = LLIMModel::instance().findIMSession(mSessionID); + RLV_ASSERT(pIMSession); + + bool fRlvFilter = !pIMSession; + if (pIMSession) + { + switch (pIMSession->mSessionType) + { + case LLIMModel::LLIMSession::P2P_SESSION: // One-on-one IM + fRlvFilter = !gRlvHandler.canSendIM(mOtherParticipantUUID); + break; + case LLIMModel::LLIMSession::GROUP_SESSION: // Group chat + fRlvFilter = !gRlvHandler.canSendIM(mSessionID); + break; + case LLIMModel::LLIMSession::ADHOC_SESSION: // Conference chat: allow if all participants can be sent an IM + { + if (!pIMSession->mSpeakers) + { + fRlvFilter = true; + break; + } + + LLSpeakerMgr::speaker_list_t speakers; + pIMSession->mSpeakers->getSpeakerList(&speakers, TRUE); + for (LLSpeakerMgr::speaker_list_t::const_iterator itSpeaker = speakers.begin(); + itSpeaker != speakers.end(); ++itSpeaker) + { + const LLSpeaker* pSpeaker = *itSpeaker; + if ( (gAgent.getID() != pSpeaker->mID) && (!gRlvHandler.canSendIM(pSpeaker->mID)) ) + { + fRlvFilter = true; + break; + } + } + } + break; + default: + fRlvFilter = true; + break; + } + } + + if (fRlvFilter) + utf8_text = RlvStrings::getString(RLV_STRING_BLOCKED_SENDIM); + } +// [/RLVa:KB] + if (mSessionInitialized) { LLIMModel::sendMessage(utf8_text, mSessionID, diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 57373704ef..6090660f20 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -63,7 +63,9 @@ #include "lltoolbarview.h" #include "llviewercontrol.h" #include "llviewerparcelmgr.h" - +// [RLVa:KB] - Checked: 2010-04-09 (RLVa-1.2.0e) +#include "rlvhandler.h" +// [/RLVa:KB] const static std::string ADHOC_NAME_SUFFIX(" Conference"); @@ -3255,6 +3257,20 @@ public: { return; } +// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIMFROM)) ) + { + if (gAgent.isInGroup(session_id)) // Group chat: don't accept the invite if not an exception + { + if (!gRlvHandler.canReceiveIM(session_id)) + return; + } + else if (!gRlvHandler.canReceiveIM(from_id)) // Conference chat: don't block; censor if not an exception + { + message = RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM); + } + } +// [/RLVa:KB] // standard message, not from system std::string saved; diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index a7b93b8030..e9bf701a97 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -38,6 +38,10 @@ #include "llviewermedia.h" #include "llviewermediafocus.h" #include "llviewerobjectlist.h" // to select the requested object +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0c) +#include "rlvhandler.h" +#include "lltoolpie.h" +// [/RLVa:KB] // Linden libraries #include "llbutton.h" // setLabel(), not virtual! @@ -358,6 +362,10 @@ void LLInspectObject::updateButtons(LLSelectNode* nodep) || (parent && parent->flagHandleTouch())) { getChild("touch_btn")->setVisible(true); +// [RLVa:KB] - Checked: 2010-11-12 (RLVa-1.2.1g) | Added: RLVa-1.2.1g + if (rlv_handler_t::isEnabled()) + getChild("touch_btn")->setEnabled(gRlvHandler.canTouch(object)); +// [/RLVa:KB] updateTouchLabel(nodep); } else if ( enable_object_open() ) @@ -387,6 +395,15 @@ void LLInspectObject::updateSitLabel(LLSelectNode* nodep) { sit_btn->setLabel( getString("Sit") ); } + +// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) | Added: RLVa-1.2.0a + // RELEASE-RLVa: [SL-2.0.0] Make sure we're examining the same object that handle_sit_or_stand() will request a sit for + if (rlv_handler_t::isEnabled()) + { + const LLPickInfo& pick = LLToolPie::getInstance()->getPick(); + sit_btn->setEnabled( (pick.mObjectID.notNull()) && (gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset)) ); + } +// [/RLVa:KB] } void LLInspectObject::updateTouchLabel(LLSelectNode* nodep) @@ -482,10 +499,17 @@ void LLInspectObject::updateCreator(LLSelectNode* nodep) // a clickable link // Objects cannot be created by a group, so use agent URL format LLUUID creator_id = nodep->mPermissions->getCreator(); - std::string creator_url = - LLSLURL("agent", creator_id, "about").getSLURLString(); +// std::string creator_url = +// LLSLURL("agent", creator_id, "about").getSLURLString(); +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + // Only anonymize the creator if they're also the owner or if they're a nearby avie + bool fRlvHideCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + ((nodep->mPermissions->getOwner() == creator_id) || (RlvUtil::isNearbyAgent(creator_id))); + std::string creator_url = + LLSLURL("agent", creator_id, (!fRlvHideCreator) ? "about" : "rlvanonym").getSLURLString(); +// [/RLVa:KB] args["[CREATOR]"] = creator_url; - + // created by one user but owned by another std::string owner_url; LLUUID owner_id; @@ -498,7 +522,11 @@ void LLInspectObject::updateCreator(LLSelectNode* nodep) else { owner_id = nodep->mPermissions->getOwner(); - owner_url = LLSLURL("agent", owner_id, "about").getSLURLString(); +// owner_url = LLSLURL("agent", owner_id, "about").getSLURLString(); +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + bool fRlvHideOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + owner_url = LLSLURL("agent", owner_id, (!fRlvHideOwner) ? "about" : "rlvanonym").getSLURLString(); +// [/RLVa:KB] } args["[OWNER]"] = owner_url; diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp index a12ec390af..bd4bae7b02 100644 --- a/indra/newview/llinspectremoteobject.cpp +++ b/indra/newview/llinspectremoteobject.cpp @@ -35,6 +35,9 @@ #include "llui.h" #include "lluictrl.h" #include "llurlaction.h" +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) +#include "rlvhandler.h" +// [/RLVa:KB] ////////////////////////////////////////////////////////////////////////////// // LLInspectRemoteObject @@ -66,6 +69,9 @@ private: LLUUID mOwnerID; std::string mSLurl; std::string mName; +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + bool mRlvHideNames; +// [/RLVa:KB] bool mGroupOwned; }; @@ -75,6 +81,9 @@ LLInspectRemoteObject::LLInspectRemoteObject(const LLSD& sd) : mOwnerID(NULL), mSLurl(""), mName(""), +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + mRlvHideNames(false), +// [/RLVa:KB] mGroupOwned(false) { } @@ -107,6 +116,10 @@ void LLInspectRemoteObject::onOpen(const LLSD& data) mOwnerID = data["owner_id"].asUUID(); mGroupOwned = data["group_owned"].asBoolean(); mSLurl = data["slurl"].asString(); +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + if (data.has("rlv_shownames")) + mRlvHideNames = data["rlv_shownames"].asBoolean(); +// [/RLVa:KB] // update the inspector with the current object state update(); @@ -160,7 +173,10 @@ void LLInspectRemoteObject::update() } else { - owner = LLSLURL("agent", mOwnerID, "about").getSLURLString(); +// owner = LLSLURL("agent", mOwnerID, "about").getSLURLString(); +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + owner = LLSLURL("agent", mOwnerID, (!mRlvHideNames) ? "about" : "rlvanonym").getSLURLString(); +// [/RLVa:KB] } } else @@ -182,6 +198,14 @@ void LLInspectRemoteObject::update() // disable the Block button if we don't have the object ID (will this ever happen?) getChild("block_btn")->setEnabled(! mObjectID.isNull()); + +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + if ( (rlv_handler_t::isEnabled()) && (RlvStrings::getString(RLV_STRING_HIDDEN_REGION) == mSLurl) ) + { + getChild("object_slurl")->setValue(mSLurl); + getChild("map_btn")->setEnabled(false); + } +// [/RLVa:KB] } ////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0666c8330e..a99ae36956 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -73,6 +73,10 @@ #include "llvoavatarself.h" #include "llwearablelist.h" #include "lllandmarkactions.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); @@ -742,6 +746,20 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) addOpenRightClickMenuOption(items); items.push_back(std::string("Properties")); +// [RLVa:KB] - Checked: 2010-03-01 (RLVa-1.2.0b) | Modified: RLVa-1.1.0a + if (rlv_handler_t::isEnabled()) + { + const LLInventoryObject* pItem = getInventoryObject(); + if ( (pItem) && + ( ((LLAssetType::AT_NOTECARD == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE))) || + ((LLAssetType::AT_LSL_TEXT == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT))) || + ((LLAssetType::AT_TEXTURE == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) ) ) + { + disabled_items.push_back(std::string("Open")); + } + } +// [/RLVa:KB] + getClipboardEntries(true, items, disabled_items, flags); } hide_context_entries(menu, items, disabled_items); @@ -1639,6 +1657,13 @@ BOOL LLItemBridge::isItemRenameable() const return FALSE; } +// [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g + if ( (rlv_handler_t::isEnabled()) && (!RlvFolderLocks::instance().canRenameItem(mUUID)) ) + { + return FALSE; + } +// [/RLVa:KB] + return (item->getPermissions().allowModifyBy(gAgent.getID())); } return FALSE; @@ -2302,6 +2327,14 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } + +// [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Added: RLVa-1.3.0g + if ( (is_movable) && (rlv_handler_t::isEnabled()) && (RlvFolderLocks::instance().hasLockedFolder(RLV_LOCK_ANY)) ) + { + is_movable = RlvFolderLocks::instance().canMoveFolder(cat_id, mUUID); + } +// [/RLVa:KB] + // //-------------------------------------------------------------------------------- @@ -3843,6 +3876,24 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { is_movable = FALSE; } + +// [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g + if ( (rlv_handler_t::isEnabled()) && (is_movable) ) + { + if (move_is_into_current_outfit) + { + // RELEASE-RLVa: [RLVa-1.3.0] Keep sync'ed with code below => LLAppearanceMgr::wearItemOnAvatar() with "replace == true" + const LLViewerInventoryItem* pItem = dynamic_cast(inv_item); + is_movable = rlvPredCanWearItem(pItem, RLV_WEAR_REPLACE); + } + if (is_movable) + { + is_movable = (!RlvFolderLocks::instance().hasLockedFolder(RLV_LOCK_ANY)) || + (RlvFolderLocks::instance().canMoveItem(inv_item->getUUID(), mUUID)); + } + } +// [/RLVa:KB] + if (move_is_into_trash) { is_movable &= inv_item->getIsLinkType() || !get_is_item_worn(inv_item->getUUID()); @@ -4595,11 +4646,14 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act { callingcard_name = av_name.mDisplayName + " (" + av_name.mUsername + ")"; } - LLUUID session_id = gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID()); - if (session_id != LLUUID::null) - { - LLIMFloater::show(session_id); - } +// LLUUID session_id = gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID()); +// if (session_id != LLUUID::null) +// { +// LLIMFloater::show(session_id); +// } +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + LLAvatarActions::startIM(item->getCreatorUUID()); +// [/RLVa:KB] } } else if ("lure" == action) @@ -5163,6 +5217,16 @@ std::string LLObjectBridge::getLabelSuffix() const void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace) { +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1) + // If no attachment point was specified, try looking it up from the item name + static LLCachedControl fRlvDeprecateAttachPt(gSavedSettings, "RLVaDebugDeprecateExplicitPoint"); + if ( (rlv_handler_t::isEnabled()) && (!fRlvDeprecateAttachPt) && + (!attachment) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) ) + { + attachment = RlvAttachPtLookup::getAttachPoint(item); + } +// [/RLVa:KB] + const LLUUID& item_id = item->getLinkedUUID(); // Check for duplicate request. @@ -5197,10 +5261,24 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach if (replace && (attachment && attachment->getNumObjects() > 0)) { +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1) + // Block if we can't "replace wear" what's currently there + if ( (rlv_handler_t::isEnabled()) && ((gRlvAttachmentLocks.canAttach(attachment) & RLV_WEAR_REPLACE) == 0) ) + { + return; + } +// [/RLVa:KB] LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_attachment_rez); } else { +// [RLVa:KB] - Checked: 2010-08-07 (RLVa-1.2.0) + // Block wearing anything on a non-attachable attachment point + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachmentPoint(attach_pt, RLV_LOCK_ADD)) ) + { + return; + } +// [/RLVa:KB] LLNotifications::instance().forceResponse(LLNotification::Params("ReplaceAttachment").payload(payload), 0/*YES*/); } } @@ -5223,26 +5301,25 @@ bool confirm_attachment_rez(const LLSD& notification, const LLSD& response) if (itemp) { - /* - { - U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); - - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_ObjectData); - msg->addUUIDFast(_PREHASH_ItemID, itemp->getUUID()); - msg->addUUIDFast(_PREHASH_OwnerID, itemp->getPermissions().getOwner()); - msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt); - pack_permissions_slam(msg, itemp->getFlags(), itemp->getPermissions()); - msg->addStringFast(_PREHASH_Name, itemp->getName()); - msg->addStringFast(_PREHASH_Description, itemp->getDescription()); - msg->sendReliable(gAgent.getRegion()->getHost()); - return false; - } - */ +// /* +// { +// U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); +// LLMessageSystem* msg = gMessageSystem; +// msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv); +// msg->nextBlockFast(_PREHASH_AgentData); +// msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); +// msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); +// msg->nextBlockFast(_PREHASH_ObjectData); +// msg->addUUIDFast(_PREHASH_ItemID, itemp->getUUID()); +// msg->addUUIDFast(_PREHASH_OwnerID, itemp->getPermissions().getOwner()); +// msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt); +// pack_permissions_slam(msg, itemp->getFlags(), itemp->getPermissions()); +// msg->addStringFast(_PREHASH_Name, itemp->getName()); +// msg->addStringFast(_PREHASH_Description, itemp->getDescription()); +// msg->sendReliable(gAgent.getRegion()->getHost()); +// return false; +// } +// */ // Queue up attachments to be sent in next idle tick, this way the // attachments are batched up all into one message versus each attachment @@ -5294,6 +5371,10 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Detach From Yourself")); +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a + if ( (rlv_handler_t::isEnabled()) && (!gRlvAttachmentLocks.canDetach(item)) ) + disabled_items.push_back(std::string("Detach From Yourself")); +// [/RLVa:KB] } else if (!isItemInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing() && !isCOFFolder()) { @@ -5312,6 +5393,17 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) disabled_items.push_back(std::string("Attach To")); disabled_items.push_back(std::string("Attach To HUD")); } +// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a + else if (rlv_handler_t::isEnabled()) + { + ERlvWearMask eWearMask = gRlvAttachmentLocks.canAttach(item); + if ((eWearMask & RLV_WEAR_REPLACE) == 0) + disabled_items.push_back(std::string("Wearable And Object Wear")); + if ((eWearMask & RLV_WEAR_ADD) == 0) + disabled_items.push_back(std::string("Wearable Add")); + } +// [/RLVa:KB] + LLMenuGL* attach_menu = menu.findChildMenuByName("Attach To", TRUE); LLMenuGL* attach_hud_menu = menu.findChildMenuByName("Attach To HUD", TRUE); if (attach_menu @@ -5558,18 +5650,37 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { disabled_items.push_back(std::string("Wearable And Object Wear")); disabled_items.push_back(std::string("Wearable Add")); +// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0c) | Added: RLVa-1.2.0c + if ( (rlv_handler_t::isEnabled()) && (!gRlvWearableLocks.canRemove(item)) ) + disabled_items.push_back(std::string("Take Off")); +// [/RLVa:KB] } else { items.push_back(std::string("Wearable And Object Wear")); disabled_items.push_back(std::string("Take Off")); disabled_items.push_back(std::string("Wearable Edit")); + +// [RLVa:KB] - Checked: 2010-06-09 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g + if (rlv_handler_t::isEnabled()) + { + ERlvWearMask eWearMask = gRlvWearableLocks.canWear(item); + if ((eWearMask & RLV_WEAR_REPLACE) == 0) + disabled_items.push_back(std::string("Wearable And Object Wear")); + if ((eWearMask & RLV_WEAR_ADD) == 0) + disabled_items.push_back(std::string("Wearable Add")); + } +// [/RLVa:KB] } if (LLWearableType::getAllowMultiwear(mWearableType)) { items.push_back(std::string("Wearable Add")); - if (gAgentWearables.getWearableCount(mWearableType) >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) +// if (gAgentWearables.getWearableCount(mWearableType) >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) +// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2011-07-24 (Catznip-2.6.0e) | Added: Catznip-2.6.0e + if ( (gAgentWearables.getWearableCount(mWearableType) >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) || + (gAgentWearables.getWearableFromAssetID(item->getAssetUUID())) ) +// [/SL:KB] { disabled_items.push_back(std::string("Wearable Add")); } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 1d741437b9..7f196f656f 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -81,6 +81,10 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llwearablelist.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] #include @@ -345,6 +349,14 @@ BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id) } } +// [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g + if ( (rlv_handler_t::isEnabled()) && + (RlvFolderLocks::instance().hasLockedFolder(RLV_LOCK_ANY)) && (!RlvFolderLocks::instance().canRemoveItem(id)) ) + { + return FALSE; + } +// [/RLVa:KB] + const LLInventoryObject *obj = model->getItem(id); if (obj && obj->getIsLinkType()) { @@ -373,6 +385,14 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id) return FALSE; } +// [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g + if ( ((rlv_handler_t::isEnabled()) && + (RlvFolderLocks::instance().hasLockedFolder(RLV_LOCK_ANY)) && (!RlvFolderLocks::instance().canRemoveFolder(id))) ) + { + return FALSE; + } +// [/RLVa:KB] + if (!isAgentAvatarValid()) return FALSE; const LLInventoryCategory* category = model->getCategory(id); @@ -408,6 +428,13 @@ BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id) return FALSE; } +// [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g + if ( (rlv_handler_t::isEnabled()) && (model == &gInventory) && (!RlvFolderLocks::instance().canRenameFolder(id)) ) + { + return FALSE; + } +// [/RLVa:KB] + LLViewerInventoryCategory* cat = model->getCategory(id); if (cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType()) && diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index ac1f40b486..2c10193cf6 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -49,6 +49,10 @@ #include "llvoavatarself.h" #include "llgesturemgr.h" #include +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] //#define DIFF_INVENTORY_FILES #ifdef DIFF_INVENTORY_FILES @@ -609,6 +613,28 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, LLViewerInventoryItem* item = NULL; item_array_t* item_array = get_ptr_in_map(mParentChildItemTree, id); + // Move onto items + if(item_array) + { + S32 count = item_array->count(); + for(S32 i = 0; i < count; ++i) + { + item = item_array->get(i); + if(add(NULL, item)) + { + items.put(item); + } + } + } + +// [RLVa:KB] - Checked: 2010-09-30 (RLVa-1.2.1d) | Added: RLVa-1.2.1d + // The problem is that we want some way for the functor to know that it's being asked to decide on a folder link + // but it won't know that until after it has encountered the folder link item (which doesn't happen until *after* + // it has already collected all items from it the way the code was originally laid out) + // This breaks the "finish collecting all folders before collecting items (top to bottom and then bottom to top)" + // assumption but no functor is (currently) relying on it (and likely never should since it's an implementation detail?) + // [Only LLAppearanceMgr actually ever passes in 'follow_folder_links == TRUE'] +// [/RLVa:KB] // Follow folder links recursively. Currently never goes more // than one level deep (for current outfit support) // Note: if making it fully recursive, need more checking against infinite loops. @@ -638,20 +664,6 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, } } } - - // Move onto items - if(item_array) - { - S32 count = item_array->count(); - for(S32 i = 0; i < count; ++i) - { - item = item_array->get(i); - if(add(NULL, item)) - { - items.put(item); - } - } - } } void LLInventoryModel::addChangedMaskForLinks(const LLUUID& object_id, U32 mask) @@ -2725,6 +2737,14 @@ void LLInventoryModel::processSaveAssetIntoInventory(LLMessageSystem* msg, llinfos << "LLInventoryModel::processSaveAssetIntoInventory item" " not found: " << item_id << llendl; } + +// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0a) | Added: RLVa-0.2.0e + if (rlv_handler_t::isEnabled()) + { + RlvAttachmentLockWatchdog::instance().onSavedAssetIntoInventory(item_id); + } +// [/RLVa:KB] + if(gViewerWindow) { gViewerWindow->getWindow()->decBusyCount(); @@ -2775,6 +2795,20 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) { if(tfolder->getParentUUID() == folderp->getParentUUID()) { +// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.2.0e) | Added: RLVa-1.2.0e + // NOTE-RLVa: not sure if this is a hack or a bug-fix :o + // -> if we rename the folder on the first BulkUpdateInventory message subsequent messages will still contain + // the old folder name and gInventory.updateCategory() below will "undo" the folder name change but on the + // viewer-side *only* so the folder name actually becomes out of sync with what's on the inventory server + // -> so instead we keep the name of the existing folder and only do it for #RLV/~ in case this causes issues + // -> a better solution would be to only do the rename *after* the transaction completes but there doesn't seem + // to be any way to accomplish that either *sighs* + if ( (rlv_handler_t::isEnabled()) && (!folderp->getName().empty()) && (tfolder->getName() != folderp->getName()) && + ((tfolder->getName().find(RLV_PUTINV_PREFIX) == 0)) ) + { + tfolder->rename(folderp->getName()); + } +// [/RLVa:KB] update[tfolder->getParentUUID()]; } else diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 635a04af6e..366dfc5761 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -969,8 +969,11 @@ bool LLInventoryPanel::beginIMSession() std::string name; - LLDynamicArray members; - EInstantMessage type = IM_SESSION_CONFERENCE_START; +// LLDynamicArray members; +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + uuid_vec_t members; +// [/RLVa:KB] +// EInstantMessage type = IM_SESSION_CONFERENCE_START; std::set::const_iterator iter; for (iter = selected_items.begin(); iter != selected_items.end(); iter++) @@ -1012,7 +1015,10 @@ bool LLInventoryPanel::beginIMSession() id = item_array.get(i)->getCreatorUUID(); if(at.isBuddyOnline(id)) { - members.put(id); +// members.put(id); +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + members.push_back(id); +// [/RLVa:KB] } } } @@ -1034,7 +1040,10 @@ bool LLInventoryPanel::beginIMSession() if(at.isBuddyOnline(id)) { - members.put(id); +// members.put(id); +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + members.push_back(id); +// [/RLVa:KB] } } } //if IT_CALLINGCARD @@ -1050,11 +1059,14 @@ bool LLInventoryPanel::beginIMSession() name = LLTrans::getString("conference-title"); } - LLUUID session_id = gIMMgr->addSession(name, type, members[0], members); - if (session_id != LLUUID::null) - { - LLIMFloater::show(session_id); - } +// LLUUID session_id = gIMMgr->addSession(name, type, members[0], members); +// if (session_id != LLUUID::null) +// { +// LLIMFloater::show(session_id); +// } +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + LLAvatarActions::startConference(members); +// [/RLVa:KB] return true; } @@ -1142,8 +1154,11 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) active_inv_floaterp->setMinimized(FALSE); } } - else if (auto_open) +// else if (auto_open) +// [RLVa:KB] - Checked: 2012-05-15 (RLVa-1.4.6) + else if ( (auto_open) && (LLFloaterReg::canShowInstance(floater_inventory->getInstanceName())) ) { +// [/RLVa:KB] floater_inventory->openFloater(); res = inventory_panel->getActivePanel(); diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 5022dba934..2d9e61904b 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -63,6 +63,9 @@ #include "llviewermenu.h" #include "llurllineeditorctrl.h" #include "llagentui.h" +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) +#include "rlvhandler.h" +// [/RLVa:KB] //============================================================================ /* @@ -628,16 +631,31 @@ void LLLocationInputCtrl::reshape(S32 width, S32 height, BOOL called_from_parent void LLLocationInputCtrl::onInfoButtonClicked() { +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + return; +// [/RLVa:KB] + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); } void LLLocationInputCtrl::onForSaleButtonClicked() { +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + return; +// [/RLVa:KB] + handle_buy_land(); } void LLLocationInputCtrl::onAddLandmarkButtonClicked() { +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + return; +// [/RLVa:KB] + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); // Landmark exists, open it for preview and edit if(landmark && landmark->getUUID().notNull()) @@ -765,6 +783,10 @@ void LLLocationInputCtrl::onTextEditorRightClicked(S32 x, S32 y, MASK mask) void LLLocationInputCtrl::refresh() { +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 + mInfoBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); +// [/RLVa:KB] + refreshLocation(); // update location string refreshParcelIcons(); updateAddLandmarkButton(); // indicate whether current parcel has been landmarked @@ -1042,6 +1064,9 @@ void LLLocationInputCtrl::enableAddLandmarkButton(bool val) // depending on whether current parcel has been landmarked. void LLLocationInputCtrl::updateAddLandmarkButton() { +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 + mAddLandmarkBtn->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); +// [/RLVa:KB] enableAddLandmarkButton(LLLandmarkActions::hasParcelLandmark()); } void LLLocationInputCtrl::updateAddLandmarkTooltip() @@ -1071,6 +1096,9 @@ void LLLocationInputCtrl::updateContextMenu(){ { landmarkItem->setLabel(LLTrans::getString("EditLandmarkNavBarMenu")); } +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 + landmarkItem->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); +// [/RLVa:KB] } } void LLLocationInputCtrl::updateWidgetlayout() @@ -1126,17 +1154,23 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata) } else if (item == "landmark") { - LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); - - if(!landmark) +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id",landmark->getUUID())); - +// [/RLVa:KB] + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); + + if(!landmark) + { + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); + } + else + { + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id",landmark->getUUID())); + } +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d } +// [/RLVa:KB] } else if (item == "cut") { diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index b62db70ec8..6999b87af1 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -61,6 +61,9 @@ #include "llui.h" #include "pipeline.h" #include "llviewershadermgr.h" +// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0a) +#include "rlvhandler.h" +// [/RLVa:KB] const S32 NUM_AXES = 3; const S32 MOUSE_DRAG_SLOP = 2; // pixels diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index eb6591eb39..38b00059f5 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -50,6 +50,9 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "lltooltip.h" +// [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c) +#include "rlvhandler.h" +// [/RLVa:KB] // // Constants @@ -140,7 +143,10 @@ BOOL LLFloaterMove::postBuild() initMovementMode(); - LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(LLFloaterMove::sUpdateFlyingStatus); +// LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(LLFloaterMove::sUpdateFlyingStatus); +// [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a + LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(LLFloaterMove::sUpdateMovementStatus); +// [/RLVa:KB] return TRUE; } @@ -317,23 +323,32 @@ void LLFloaterMove::setMovementMode(const EMovementMode mode) { case MM_RUN: gAgent.setAlwaysRun(); - gAgent.setRunning(); +// gAgent.setRunning(); break; case MM_WALK: gAgent.clearAlwaysRun(); - gAgent.clearRunning(); +// gAgent.clearRunning(); break; default: //do nothing for other modes (MM_FLY) break; } // tell the simulator. - gAgent.sendWalkRun(gAgent.getAlwaysRun()); - - updateButtonsWithMovementMode(mode); +// gAgent.sendWalkRun(gAgent.getAlwaysRun()); +// +// updateButtonsWithMovementMode(mode); +// +// bool bHideModeButtons = MM_FLY == mode +// || (isAgentAvatarValid() && gAgentAvatarp->isSitting()); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + // Running may have been restricted so update walk-vs-run from the agent's actual running state + if ( (MM_WALK == mode) || (MM_RUN == mode) ) + mCurrentMode = (gAgent.getRunning()) ? MM_RUN : MM_WALK; - bool bHideModeButtons = MM_FLY == mode - || (isAgentAvatarValid() && gAgentAvatarp->isSitting()); + updateButtonsWithMovementMode(mCurrentMode); + + bool bHideModeButtons = (MM_FLY == mCurrentMode) || (isAgentAvatarValid() && gAgentAvatarp->isSitting()); +// [/RLVa:KB] showModeButtons(!bHideModeButtons); @@ -436,12 +451,23 @@ void LLFloaterMove::setModeTitle(const EMovementMode mode) } //static -void LLFloaterMove::sUpdateFlyingStatus() +//void LLFloaterMove::sUpdateFlyingStatus() +//{ +// LLFloaterMove *floater = LLFloaterReg::findTypedInstance("moveview"); +// if (floater) floater->mModeControlButtonMap[MM_FLY]->setEnabled(gAgent.canFly()); +// +//} +// [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a +void LLFloaterMove::sUpdateMovementStatus() { - LLFloaterMove *floater = LLFloaterReg::findTypedInstance("moveview"); - if (floater) floater->mModeControlButtonMap[MM_FLY]->setEnabled(gAgent.canFly()); - + LLFloaterMove* pFloater = LLFloaterReg::findTypedInstance("moveview"); + if (pFloater) + { + pFloater->mModeControlButtonMap[MM_RUN]->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_ALWAYSRUN)); + pFloater->mModeControlButtonMap[MM_FLY]->setEnabled(gAgent.canFly()); + } } +// [/RLVa:KB] void LLFloaterMove::showModeButtons(BOOL bShow) { @@ -481,7 +507,10 @@ void LLFloaterMove::onOpen(const LLSD& key) showModeButtons(FALSE); } - sUpdateFlyingStatus(); +// sUpdateFlyingStatus(); +// [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a + sUpdateMovementStatus(); +// [/RLVa:KB] } void LLFloaterMove::setModeButtonToggleState(const EMovementMode mode) @@ -672,10 +701,17 @@ LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel() void LLPanelStandStopFlying::onStandButtonClick() { - LLFirstUse::sit(false); +// [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c) | Added: RLVa-1.2.0a + if ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canStand()) ) + { + LLFirstUse::sit(false); - LLSelectMgr::getInstance()->deselectAllForStandingUp(); - gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); + LLSelectMgr::getInstance()->deselectAllForStandingUp(); + gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); + } +// [/RLVa:KB] +// LLSelectMgr::getInstance()->deselectAllForStandingUp(); +// gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); setFocus(FALSE); // EXT-482 mStandButton->setVisible(FALSE); // force visibility changing to avoid seeing Stand & Move buttons at once. diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h index c525d9dfdb..6f42db76a9 100644 --- a/indra/newview/llmoveview.h +++ b/indra/newview/llmoveview.h @@ -59,7 +59,10 @@ public: static void enableInstance(BOOL bEnable); /*virtual*/ void onOpen(const LLSD& key); - static void sUpdateFlyingStatus(); +// static void sUpdateFlyingStatus(); +// [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a + static void sUpdateMovementStatus(); +// [/RLVa:KB] protected: void turnLeft(); diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index c00dc4bc89..755907cbc2 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -50,6 +50,9 @@ #include "llviewerchat.h" #include "llnearbychat.h" #include "lltranslate.h" +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) +#include "rlvhandler.h" +// [/RLVa:KB] #include "llresizehandle.h" #include "llautoreplace.h" @@ -61,7 +64,10 @@ const S32 COLLAPSED_HEIGHT = 60; const S32 EXPANDED_MIN_HEIGHT = 150; // legacy callback glue -void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); +//void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) | Modified: RLVa-0.2.2a +void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel); +// [/RLVa:KB] struct LLChatTypeTrigger { std::string name; @@ -249,7 +255,10 @@ void LLNearbyChatBar::onChatBoxKeystroke(LLLineEditor* caller, void* userdata) S32 length = raw_text.length(); - if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences +// if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences +// [RLVa:KB] - Checked: 2010-03-26 (RLVa-1.2.0b) | Modified: RLVa-1.0.0d + if ( (length > 0) && (raw_text[0] != '/') && (!gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT)) ) +// [/RLVa:KB] { gAgent.startTyping(); } @@ -503,6 +512,21 @@ void LLNearbyChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, utf8_text = utf8str_truncate(utf8_text, MAX_STRING - 1); } +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0b + if ( (0 == channel) && (rlv_handler_t::isEnabled()) ) + { + // Adjust the (public) chat "volume" on chat and gestures (also takes care of playing the proper animation) + if ( ((CHAT_TYPE_SHOUT == type) || (CHAT_TYPE_NORMAL == type)) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATNORMAL)) ) + type = CHAT_TYPE_WHISPER; + else if ( (CHAT_TYPE_SHOUT == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATSHOUT)) ) + type = CHAT_TYPE_NORMAL; + else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATWHISPER)) ) + type = CHAT_TYPE_NORMAL; + + animate &= !gRlvHandler.hasBehaviour( (!RlvUtil::isEmote(utf8_text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE ); + } +// [/RLVa:KB] + // Don't animate for chats people can't hear (chat to scripts) if (animate && (channel == 0)) { @@ -624,8 +648,57 @@ LLWString LLNearbyChatBar::stripChannelNumber(const LLWString &mesg, S32* channe } } -void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel) +//void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel) +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) | Modified: RLVa-0.2.2a +void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel) +// [/RLVa:KB] { +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0a + // Only process chat messages (ie not CHAT_TYPE_START, CHAT_TYPE_STOP, etc) + if ( (rlv_handler_t::isEnabled()) && ( (CHAT_TYPE_WHISPER == type) || (CHAT_TYPE_NORMAL == type) || (CHAT_TYPE_SHOUT == type) ) ) + { + if (0 == channel) + { + // (We already did this before, but LLChatHandler::handle() calls this directly) + if ( ((CHAT_TYPE_SHOUT == type) || (CHAT_TYPE_NORMAL == type)) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATNORMAL)) ) + type = CHAT_TYPE_WHISPER; + else if ( (CHAT_TYPE_SHOUT == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATSHOUT)) ) + type = CHAT_TYPE_NORMAL; + else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATWHISPER)) ) + type = CHAT_TYPE_NORMAL; + + // Redirect chat if needed + if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT) || (gRlvHandler.hasBehaviour(RLV_BHVR_REDIREMOTE)) ) && + (gRlvHandler.redirectChatOrEmote(utf8_out_text)) ) ) + { + return; + } + + // Filter public chat if sendchat restricted + if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHAT)) + gRlvHandler.filterChat(utf8_out_text, true); + } + else + { + // Don't allow chat on a non-public channel if sendchannel restricted (unless the channel is an exception) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHANNEL)) && (!gRlvHandler.isException(RLV_BHVR_SENDCHANNEL, channel)) ) + return; + + // Don't allow chat on debug channel if @sendchat, @redirchat or @rediremote restricted (shows as public chat on viewers) + if (CHAT_CHANNEL_DEBUG == channel) + { + bool fIsEmote = RlvUtil::isEmote(utf8_out_text); + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHAT)) || + ((!fIsEmote) && (gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT))) || + ((fIsEmote) && (gRlvHandler.hasBehaviour(RLV_BHVR_REDIREMOTE))) ) + { + return; + } + } + } + } +// [/RLVa:KB] + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ChatFromViewer); msg->nextBlockFast(_PREHASH_AgentData); diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 600fd395fb..db4a6865c9 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -44,6 +44,10 @@ #include "llrootview.h" #include "lllayoutstack.h" +// [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.0f) +#include "rlvhandler.h" +// [/RLVa:KB] + //add LLNearbyChatHandler to LLNotificationsUI namespace using namespace LLNotificationsUI; @@ -485,10 +489,27 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, if(chat_msg.mText.empty()) return;//don't process empty messages +// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f + if (rlv_handler_t::isEnabled()) + { + // NOTE-RLVa: we can only filter the *message* here since most everything else will already be part of "args" as well + LLChat& tmp_chat = const_cast(chat_msg); + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!tmp_chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) ) + { + RlvUtil::filterLocation(tmp_chat.mText); + tmp_chat.mRlvLocFiltered = TRUE; + } + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) ) + { + RlvUtil::filterNames(tmp_chat.mText); + tmp_chat.mRlvNamesFiltered = TRUE; + } + } +// [/RLVa:KB] + LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar"); LLNearbyChat* nearby_chat = chat_bar->findChild("nearby_chat"); - // Build notification data LLSD notification; notification["message"] = chat_msg.mText; @@ -499,7 +520,11 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, notification["chat_type"] = (S32)chat_msg.mChatType; notification["chat_style"] = (S32)chat_msg.mChatStyle; // Pass sender info so that it can be rendered properly (STORM-1021). - notification["sender_slurl"] = LLViewerChat::getSenderSLURL(chat_msg, args); +// notification["sender_slurl"] = LLViewerChat::getSenderSLURL(chat_msg, args); +// [RLVa:KB] - Checked: 2011-12-13 (RLVa-1.4.6) | Added: RLVa-1.4.6 + if ((CHAT_SOURCE_AGENT != chat_msg.mSourceType) || (!chat_msg.mRlvNamesFiltered)) + notification["sender_slurl"] = LLViewerChat::getSenderSLURL(chat_msg, args); +// [/RLVa:KB] if (chat_msg.mChatType == CHAT_TYPE_DIRECT && chat_msg.mText.length() > 0 && @@ -548,8 +573,11 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, LLFirstUse::otherAvatarChatFirst(); // Add sender to the recent people list. - LLRecentPeople::instance().add(chat_msg.mFromID); - +// [RLVa:KB] - Checked: 2012-03-15 (RLVa-1.4.6) | Added: RLVa-1.4.6 + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + LLRecentPeople::instance().add(chat_msg.mFromID); +// [/RLVa:KB] +// LLRecentPeople::instance().add(chat_msg.mFromID); } // Send event on to LLEventStream @@ -605,6 +633,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, LLUUID id; id.generate(); notification["id"] = id; +// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + if (rlv_handler_t::isEnabled()) + notification["show_icon_tooltip"] = !chat_msg.mRlvNamesFiltered; +// [/RLVa:KB] std::string r_color_name = "White"; F32 r_color_alpha = 1.0f; LLViewerChat::getChatColor( chat_msg, r_color_name, r_color_alpha); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index dea90b9042..a4cf524056 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -60,6 +60,9 @@ #include "llviewerwindow.h" #include "llworld.h" #include "llworldmapview.h" // shared draw code +// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) +#include "rlvhandler.h" +// [/RLVa:KB] static LLDefaultChildRegistry::Register r1("net_map"); @@ -346,7 +349,11 @@ void LLNetMap::draw() pos_map = globalPosToView(positions[i]); LLUUID uuid = avatar_ids[i]; - bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL); +// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f + bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL) && + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] +// bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL); LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color; @@ -598,11 +605,29 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) // If the cursor is near an avatar on the minimap, a mini-inspector will be // shown for the avatar, instead of the normal map tooltip. - if (handleToolTipAgent(mClosestAgentToCursor)) +// if (handleToolTipAgent(mClosestAgentToCursor)) +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (handleToolTipAgent(mClosestAgentToCursor)) ) +// [/RLVa:KB] { return TRUE; } +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + LLStringUtil::format_map_t args; + + LLAvatarName avName; + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + (mClosestAgentToCursor.notNull()) && (LLAvatarNameCache::get(mClosestAgentToCursor, &avName)) ) + { + args["[AGENT]"] = RlvStrings::getAnonym(avName) + "\n"; + } + else + { + args["[AGENT]"] = ""; + } +// [/RLVa:KB] + LLRect sticky_rect; std::string region_name; LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) ); @@ -614,14 +639,17 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) sticky_rect.mRight = sticky_rect.mLeft + 2 * SLOP; sticky_rect.mTop = sticky_rect.mBottom + 2 * SLOP; - region_name = region->getName(); +// region_name = region->getName(); +// [RLVa:KB] - Checked: 2010-10-19 (RLVa-1.2.2b) | Modified: RLVa-1.2.2b + region_name = ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); +// [/RLVa:KB] if (!region_name.empty()) { region_name += "\n"; } } - LLStringUtil::format_map_t args; +// LLStringUtil::format_map_t args; args["[REGION]"] = region_name; std::string msg = mToolTipMsg; LLStringUtil::format(msg, args); diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 3569ad6447..707e10fe84 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -413,6 +413,13 @@ private: */ static LLIMFloater* findIMFloater(const LLNotificationPtr& notification); +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a + /** + * Checks whether the user has opted to embed (certain) notifications in IM sessions + */ + static bool canEmbedNotificationInIM(const LLNotificationPtr& notification); +// [/SL:KB] + }; } diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 34cb27d5ce..b5f8bfc564 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -38,6 +38,9 @@ #include "llimview.h" #include "llnearbychat.h" #include "llnotificationhandler.h" +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h +#include "rlvhandler.h" +// [/RLVa:KB] using namespace LLNotificationsUI; @@ -171,31 +174,77 @@ bool LLHandlerUtil::canLogToNearbyChat(const LLNotificationPtr& notification) // static bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) { - return OFFER_FRIENDSHIP == notification->getName() - || USER_GIVE_ITEM == notification->getName() - || TELEPORT_OFFERED == notification->getName() - || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() - || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName(); +// return OFFER_FRIENDSHIP == notification->getName() +// || USER_GIVE_ITEM == notification->getName() +// || TELEPORT_OFFERED == notification->getName() +// || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() +// || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName(); +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a +// return +// (canEmbedNotificationInIM(notification)) && +// ( (OFFER_FRIENDSHIP == notification->getName()) || (USER_GIVE_ITEM == notification->getName()) || +// (TELEPORT_OFFERED == notification->getName()) || +// (TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()) || (TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()) ); +// [/SL:KB] +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h + return + (canEmbedNotificationInIM(notification)) && + ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canStartIM(notification->getPayload()["from_id"].asUUID())) ) && + ( (OFFER_FRIENDSHIP == notification->getName()) || (USER_GIVE_ITEM == notification->getName()) || + (TELEPORT_OFFERED == notification->getName()) || + (TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()) || (TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()) ); +// [/RLVa:KB] } +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a +// static +bool LLHandlerUtil::canEmbedNotificationInIM(const LLNotificationPtr& notification) +{ + switch (gSavedSettings.getS32("NotificationCanEmbedInIM")) + { + case 1: // Focused + return isIMFloaterFocused(notification); + case 2: // Never + return false; + case 0: // Always (Viewer 2 default) + default: + return true; + } +} +// [/SL:KB] + // static bool LLHandlerUtil::canAddNotifPanelToIM(const LLNotificationPtr& notification) { - return OFFER_FRIENDSHIP == notification->getName() - || USER_GIVE_ITEM == notification->getName() - || TELEPORT_OFFERED == notification->getName() - || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() - || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName(); +// return OFFER_FRIENDSHIP == notification->getName() +// || USER_GIVE_ITEM == notification->getName() +// || TELEPORT_OFFERED == notification->getName() +// || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() +// || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName(); +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a + return + (canEmbedNotificationInIM(notification)) && + ( (OFFER_FRIENDSHIP == notification->getName()) || (USER_GIVE_ITEM == notification->getName()) || + (TELEPORT_OFFERED == notification->getName()) || + (TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()) || (TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()) ); +// [/SL:KB] } // static bool LLHandlerUtil::isNotificationReusable(const LLNotificationPtr& notification) { - return OFFER_FRIENDSHIP == notification->getName() - || USER_GIVE_ITEM == notification->getName() - || TELEPORT_OFFERED == notification->getName() - || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() - || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName(); +// return OFFER_FRIENDSHIP == notification->getName() +// || USER_GIVE_ITEM == notification->getName() +// || TELEPORT_OFFERED == notification->getName() +// || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() +// || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName(); +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a + return + (canEmbedNotificationInIM(notification)) && + ( (OFFER_FRIENDSHIP == notification->getName()) || (USER_GIVE_ITEM == notification->getName()) || + (TELEPORT_OFFERED == notification->getName()) || + (TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()) || (TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()) ); +// [/SL:KB] } // static @@ -227,7 +276,11 @@ bool LLHandlerUtil::canSpawnToast(const LLNotificationPtr& notification) || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()) { // When ANY offer arrives, show toast, unless IM window is already open - EXT-5904 - return ! isIMFloaterOpened(notification); +// return ! isIMFloaterOpened(notification); +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a + // Force a toast if the user opted not to embed notifications panels in IMs + return (!canEmbedNotificationInIM(notification)) || (!isIMFloaterOpened(notification)); +// [/SL:KB] } return true; diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 1552ed3346..37965dce2c 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -101,7 +101,15 @@ bool LLOfferHandler::processNotification(const LLSD& notify) notification->setReusable(LLHandlerUtil::isNotificationReusable(notification)); LLUUID session_id; - if (LLHandlerUtil::canSpawnIMSession(notification)) +// if (LLHandlerUtil::canSpawnIMSession(notification)) +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Modified: RLVa-1.3.0h + // Don't spawn a new IM session for inventory offers if this notification was subject to @shownames=n + bool spawn_session = (LLHandlerUtil::canSpawnIMSession(notification)) && (!notification->getPayload().has("rlv_shownames")); +// [/RLVa:KB] +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Modified: Catznip-2.5.0a +// bool spawn_session = LLHandlerUtil::canSpawnIMSession(notification); + if (spawn_session) +// [/SL:KB] { const std::string name = LLHandlerUtil::getSubstitutionName(notification); @@ -111,7 +119,12 @@ bool LLOfferHandler::processNotification(const LLSD& notify) } bool show_toast = LLHandlerUtil::canSpawnToast(notification); - bool add_notid_to_im = LLHandlerUtil::canAddNotifPanelToIM(notification); +// bool add_notid_to_im = LLHandlerUtil::canAddNotifPanelToIM(notification); +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Modified: Catznip-2.5.0a + // NOTE: add_notid_to_im needs to be FALSE if we suppressed spawning an IM because in that case the notification needs to + // be routed to the "syswell" or the inventory offer floater will dissapear and the user won't be able to accept it + bool add_notid_to_im = (spawn_session) && (LLHandlerUtil::canAddNotifPanelToIM(notification)); +// [/SL:KB] if (add_notid_to_im) { LLHandlerUtil::addNotifPanelToIM(notification); @@ -150,7 +163,15 @@ bool LLOfferHandler::processNotification(const LLSD& notify) if (LLHandlerUtil::canLogToIM(notification)) { // log only to file if notif panel can be embedded to IM and IM is opened - if (add_notid_to_im && LLHandlerUtil::isIMFloaterOpened(notification)) +// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0f + if (notification->getPayload().has("rlv_shownames")) + { + // Log to chat history if this notification was subject to @shownames=n + LLHandlerUtil::logToNearbyChat(notification, CHAT_SOURCE_SYSTEM); + } + else if (add_notid_to_im && LLHandlerUtil::isIMFloaterOpened(notification)) +// [/RLVa:KB] +// if (add_notid_to_im && LLHandlerUtil::isIMFloaterOpened(notification)) { LLHandlerUtil::logToIMP2P(notification, true); } @@ -171,8 +192,17 @@ bool LLOfferHandler::processNotification(const LLSD& notify) } else { - if (LLHandlerUtil::canAddNotifPanelToIM(notification) - && !LLHandlerUtil::isIMFloaterOpened(notification)) +// if (LLHandlerUtil::canAddNotifPanelToIM(notification) +// && !LLHandlerUtil::isIMFloaterOpened(notification)) +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Modified: Catznip-2.5.0a + // LLHandlerUtil::canAddNotifPanelToIM() won't necessarily tell us whether the notification went into an IM or to the syswell + // -> the one and only time we need to decrease the unread IM count is when we've clicked any of the buttons on the *toast* + // -> since LLIMFloater::updateMessages() hides the toast when we open the IM (which resets the unread count to 0) we should + // *only* decrease the unread IM count if there's a visible toast since the unread count will be at 0 otherwise anyway + LLScreenChannel* pChannel = dynamic_cast(mChannel.get()); + LLToast* pToast = (pChannel) ? pChannel->getToastByNotificationID(notification->getID()) : NULL; + if ( (pToast) && (!pToast->getCanBeStored()) ) +// [/SL:KB] { LLHandlerUtil::decIMMesageCounter(notification); } @@ -187,7 +217,10 @@ bool LLOfferHandler::processNotification(const LLSD& notify) void LLOfferHandler::onDeleteToast(LLToast* toast) { - if (!LLHandlerUtil::canAddNotifPanelToIM(toast->getNotification())) +// if (!LLHandlerUtil::canAddNotifPanelToIM(toast->getNotification())) +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Modified: Catznip-2.5.0a + if (toast->getCanBeStored()) +// [/SL:KB] { // send a signal to the counter manager mDelNotificationSignal(); @@ -203,12 +236,25 @@ void LLOfferHandler::onRejectToast(LLUUID& id) { LLNotificationPtr notification = LLNotifications::instance().find(id); - if (notification - && LLNotificationManager::getInstance()->getHandlerForNotification( - notification->getType()) == this - // don't delete notification since it may be used by IM floater - && !LLHandlerUtil::canAddNotifPanelToIM(notification)) +// if (notification +// && LLNotificationManager::getInstance()->getHandlerForNotification( +// notification->getType()) == this +// // don't delete notification since it may be used by IM floater +// && !LLHandlerUtil::canAddNotifPanelToIM(notification)) +// { +// LLNotifications::instance().cancel(notification); +// } +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Modified: Catznip-2.5.0a + // NOTE: this will be fired from LLScreenChannel::killToastByNotificationID() which treats visible and stored toasts differently + if ( (notification) && (!notification->isCancelled()) && + (LLNotificationManager::getInstance()->getHandlerForNotification(notification->getType()) == this) ) { - LLNotifications::instance().cancel(notification); + LLScreenChannel* pChannel = dynamic_cast(mChannel.get()); + LLToast* pToast = (pChannel) ? pChannel->getToastByNotificationID(notification->getID()) : NULL; + if ( (!pToast) || (pToast->getCanBeStored()) ) + { + LLNotifications::instance().cancel(notification); + } } +// [/SL:KB] } diff --git a/indra/newview/llpanelappearancetab.cpp b/indra/newview/llpanelappearancetab.cpp index 8fa8867c69..fdb331163b 100644 --- a/indra/newview/llpanelappearancetab.cpp +++ b/indra/newview/llpanelappearancetab.cpp @@ -32,6 +32,10 @@ #include "llinventoryfunctions.h" #include "llinventorymodel.h" #include "llviewerinventory.h" +// [RLVa:KB] - Checked: 2012-07-08 (RLVa-1.4.7) +#include "rlvcommon.h" +#include "rlvhandler.h" +// [/RLVa:KB] //virtual bool LLPanelAppearanceTab::canTakeOffSelected() @@ -46,6 +50,11 @@ bool LLPanelAppearanceTab::canTakeOffSelected() LLViewerInventoryItem* item = gInventory.getItem(*it); if (!item) continue; +// [RLVa:KB] - Checked: 2012-07-08 (RLVa-1.4.7) + if ( (rlv_handler_t::isEnabled()) && (rlvPredCanNotRemoveItem(item)) ) + return false; +// [/RLVa:KB] + if (is_worn(NULL, item)) return true; } return false; diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 1a427338e5..5c8b9746c7 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -59,6 +59,10 @@ #include "llviewerregion.h" #include "llviewerwindow.h" #include "llworld.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] // // Imported globals @@ -118,6 +122,25 @@ void LLPanelContents::getState(LLViewerObject *objectp ) && ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) ))); // solves SL-23488 BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); +// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (editable) ) + { + // Don't allow creation of new scripts if it's non-detachable + if (objectp->isAttachment()) + editable = !gRlvAttachmentLocks.isLockedAttachment(objectp->getRootEdit()); + + // Don't allow creation of new scripts if we're @unsit=n or @sittp=n restricted and we're sitting on the selection + if ( (editable) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) ) + { + // Only check the first (non-)root object because nothing else would result in enabling the button (see below) + LLViewerObject* pObj = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(TRUE); + + editable = + (pObj) && (isAgentAvatarValid()) && ((!gAgentAvatarp->isSitting()) || (gAgentAvatarp->getRoot() != pObj->getRootEdit())); + } + } +// [/RLVa:KB] + // Edit script button - ok if object is editable and there's an unambiguous destination for the object. getChildView("button new script")->setEnabled( editable && @@ -154,6 +177,21 @@ void LLPanelContents::onClickNewScript(void *userdata) LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok); if(object) { +// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c) | Modified: RLVa-1.0.5a + if (rlv_handler_t::isEnabled()) // Fallback code [see LLPanelContents::getState()] + { + if (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) + { + return; // Disallow creating new scripts in a locked attachment + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) + { + if ( (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) && (gAgentAvatarp->getRoot() == object->getRootEdit()) ) + return; // .. or in a linkset the avie is sitting on under @unsit=n/@sittp=n + } + } +// [/RLVa:KB] + LLPermissions perm; perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); perm.initMasks( diff --git a/indra/newview/llpanelland.cpp b/indra/newview/llpanelland.cpp index 5321ebc777..e54b2401a2 100644 --- a/indra/newview/llpanelland.cpp +++ b/indra/newview/llpanelland.cpp @@ -44,6 +44,10 @@ #include "lluictrlfactory.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + LLPanelLandSelectObserver* LLPanelLandInfo::sObserver = NULL; LLPanelLandInfo* LLPanelLandInfo::sInstance = NULL; @@ -224,6 +228,14 @@ void LLPanelLandInfo::refresh() //static void LLPanelLandInfo::onClickClaim() { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) +/* + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return; + } +*/ +// [/RLVa:KB] LLViewerParcelMgr::getInstance()->startBuyLand(); } diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index d6fccb9705..8625a6b691 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -55,6 +55,9 @@ #include "lltoggleablemenu.h" #include "llviewermenu.h" #include "llviewerregion.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] // Not yet implemented; need to remove buildPanel() from constructor when we switch //static LLRegisterPanelClassWrapper t_landmarks("panel_landmarks"); @@ -780,15 +783,22 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const std::string command_name = userdata.asString(); if("add_landmark" == command_name) { - LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); - if(landmark) +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - LLNotificationsUtil::add("LandmarkAlreadyExists"); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); +// [/RLVa:KB] + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); + if(landmark) + { + LLNotificationsUtil::add("LandmarkAlreadyExists"); + } + else + { + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); + } +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 } +// [/RLVa:KB] } else if ("category" == command_name) { @@ -1058,6 +1068,12 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const } return false; } +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + else if("add_landmark" == command_name) + { + return !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC); + } +// [/RLVa:KB] else { llwarns << "Unprocessed command has come: " << command_name << llendl; diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 25ef9a3d6a..133ed21e7e 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -66,6 +66,10 @@ #include "llviewercontrol.h" #include "lluictrlfactory.h" //#include "llfirstuse.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "llvoavatarself.h" +// [/RLVa:KB] #include "lldrawpool.h" @@ -356,6 +360,14 @@ void LLPanelObject::getState( ) enable_rotate = FALSE; } +// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c) | Modified: RLVa-1.0.0g + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) ) + { + if ( (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) && (gAgentAvatarp->getRoot() == objectp->getRootEdit()) ) + enable_move = enable_scale = enable_rotate = FALSE; + } +// [/RLVa:KB] + LLVector3 vec; if (enable_move) { diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 7c3425d71b..834b7acc83 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -66,7 +66,10 @@ #include "llviewerregion.h" #include "llviewerobjectlist.h" #include "llviewermessage.h" - +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] ///---------------------------------------------------------------------------- /// Class LLTaskInvFVBridge @@ -360,8 +363,16 @@ void LLTaskInvFVBridge::previewItem() BOOL LLTaskInvFVBridge::isItemRenameable() const { - if(gAgent.isGodlike()) return TRUE; +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); + if ( (rlv_handler_t::isEnabled()) && (object) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) ) + { + return FALSE; + } +// [/RLVa:KB] + + if(gAgent.isGodlike()) return TRUE; +// LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(object) { LLInventoryItem* item = (LLInventoryItem*)(object->getInventoryObject(mUUID)); @@ -376,7 +387,15 @@ BOOL LLTaskInvFVBridge::isItemRenameable() const BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name) { +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); + if ( (rlv_handler_t::isEnabled()) && (object) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) ) + { + return FALSE; + } +// [/RLVa:KB] + +// LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(object) { LLViewerInventoryItem* item = NULL; @@ -403,12 +422,45 @@ BOOL LLTaskInvFVBridge::isItemMovable() const // return TRUE; //} //return FALSE; +// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.5a + if (rlv_handler_t::isEnabled()) + { + const LLViewerObject* pObj = gObjectList.findObject(mPanel->getTaskUUID()); + if (pObj) + { + if (gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit())) + { + return FALSE; + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) + { + if ( (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) && (gAgentAvatarp->getRoot() == pObj->getRootEdit()) ) + return FALSE; + } + } + } +// [/RLVa:KB] return TRUE; } BOOL LLTaskInvFVBridge::isItemRemovable() const { const LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); +// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.5a + if ( (object) && (rlv_handler_t::isEnabled()) ) + { + if (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) + { + return FALSE; + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) + { + if ( (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) && (gAgentAvatarp->getRoot() == object->getRootEdit()) ) + return FALSE; + } + } +// [/RLVa:KB] + if(object && (object->permModify() || object->permYouOwner())) { @@ -557,6 +609,13 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const const LLPermissions& perm = inv->getPermissions(); bool can_copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); +// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a + // Kind of redundant due to the note below, but in case that ever gets fixed + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) ) + { + return FALSE; + } +// [/RLVa:KB] if (object->isAttachment() && !can_copy) { //RN: no copy contents of attachments cannot be dragged out @@ -676,16 +735,41 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { disabled_items.push_back(std::string("Task Open")); } +// [RLVa:KB] - Checked: 2010-03-01 (RLVa-1.2.0b) | Modified: RLVa-1.1.0a + else if (rlv_handler_t::isEnabled()) + { + LLViewerObject* pAttachObj = gObjectList.findObject(mPanel->getTaskUUID()); + bool fLocked = (pAttachObj) ? gRlvAttachmentLocks.isLockedAttachment(pAttachObj->getRootEdit()) : false; + if ( ((LLAssetType::AT_NOTECARD == item->getType()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) || (fLocked))) || + ((LLAssetType::AT_LSL_TEXT == item->getType()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) || (fLocked))) || + ((LLAssetType::AT_TEXTURE == item->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) ) + { + disabled_items.push_back(std::string("Task Open")); + } + } +// [/RLVa:KB] } items.push_back(std::string("Task Properties")); - if(isItemRenameable()) +// if(isItemRenameable()) +// { +// items.push_back(std::string("Task Rename")); +// } +// if(isItemRemovable()) +// { +// items.push_back(std::string("Task Remove")); +// } +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Added: RLVa-1.2.1f + items.push_back(std::string("Task Rename")); + items.push_back(std::string("Task Remove")); + if (!isItemRenameable()) { - items.push_back(std::string("Task Rename")); + disabled_items.push_back(std::string("Task Rename")); } - if(isItemRemovable()) + if (!isItemRemovable()) { - items.push_back(std::string("Task Remove")); + disabled_items.push_back(std::string("Task Remove")); } +// [/RLVa:KB] hide_context_entries(menu, items, disabled_items); } @@ -1091,6 +1175,13 @@ void LLTaskLSLBridge::openItem() { return; } +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.1.0a + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) ) + { + RlvUtil::notifyBlockedViewXXX(LLAssetType::AT_SCRIPT); + return; + } +// [/RLVa:KB] if (object->permModify() || gAgent.isGodlike()) { LLLiveLSLEditor* preview = LLFloaterReg::showTypedInstance("preview_scriptedit", LLSD(mUUID), TAKE_FOCUS_YES); @@ -1149,6 +1240,13 @@ void LLTaskNotecardBridge::openItem() { return; } +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0b + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) ) + { + RlvUtil::notifyBlockedViewXXX(LLAssetType::AT_NOTECARD); + return; + } +// [/RLVa:KB] if(object->permModify() || gAgent.isGodlike()) { LLPreviewNotecard* preview = LLFloaterReg::showTypedInstance("preview_notecard", LLSD(mUUID), TAKE_FOCUS_YES); diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 36234b9536..7771796b30 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -73,6 +73,9 @@ #include "llwearableitemslist.h" #include "llwearabletype.h" #include "llweb.h" +// [RLVa:KB] - Checked: 2010-09-16 (RLVa-1.2.1a) +#include "rlvhandler.h" +// [/RLVa:KB] static LLRegisterPanelClassWrapper t_outfit_edit("panel_outfit_edit"); @@ -607,6 +610,10 @@ void LLPanelOutfitEdit::toggleAddWearablesPanel() void LLPanelOutfitEdit::showAddWearablesPanel(bool show_add_wearables) { +// [RLVa:KB] - Checked: 2010-09-16 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + show_add_wearables = (show_add_wearables) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV)); +// [/RLVa:KB] + mAddWearablesPanel->setVisible(show_add_wearables); getChild("show_add_wearables_btn")->setValue(show_add_wearables); diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index a7917b457c..77c8a472e0 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -56,6 +56,12 @@ public: static LLSidepanelAppearance* getAppearanceSP(); +// [RLVa:KB] - Checked: 2010-08-24 (RLVa-1.4.0a) | Added: RLVa-1.2.1a + LLTabContainer* getAppearanceTabs() { return mAppearanceTabs; } + LLOutfitsList* getMyOutfitsPanel() { return mMyOutfitsPanel; } + LLPanelWearing* getCurrentOutfitPanel() { return mCurrentOutfitPanel; } +// [/RLVa:KB] + static LLPanelOutfitsInventory* findInstance(); protected: diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index f1380e7a36..b7976090c4 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -64,6 +64,9 @@ #include "llvoiceclient.h" #include "llworld.h" #include "llspeakers.h" +// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) +#include "rlvhandler.h" +// [/RLVa:KB] #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 @@ -578,6 +581,9 @@ BOOL LLPanelPeople::postBuild() mNearbyList->setNoItemsMsg(getString("no_one_near")); mNearbyList->setNoFilteredItemsMsg(getString("no_one_filtered_near")); mNearbyList->setShowIcons("NearbyListShowIcons"); +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d + mNearbyList->setRlvCheckShowNames(true); +// [/RLVa:KB] mMiniMap = (LLNetMap*)getChildView("Net Map",true); mMiniMap->setToolTipMsg(gSavedSettings.getBOOL("DoubleClickTeleport") ? getString("AltMiniMapToolTipMsg") : getString("MiniMapToolTipMsg")); @@ -876,7 +882,11 @@ void LLPanelPeople::updateButtons() } LLPanel* groups_panel = mTabContainer->getCurrentPanel(); - groups_panel->getChildView("activate_btn")->setEnabled(item_selected && !cur_group_active); // "none" or a non-active group selected +// groups_panel->getChildView("activate_btn")->setEnabled(item_selected && !cur_group_active); // "none" or a non-active group selected +// [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.4.1a) | Added: RLVa-1.3.0f + groups_panel->getChildView("activate_btn")->setEnabled( + item_selected && !cur_group_active && !gRlvHandler.hasBehaviour(RLV_BHVR_SETGROUP)); // "none" or a non-active group selected +// [/RLVa:KB] groups_panel->getChildView("minus_btn")->setEnabled(item_selected && selected_id.notNull()); } else @@ -893,7 +903,11 @@ void LLPanelPeople::updateButtons() LLPanel* cur_panel = mTabContainer->getCurrentPanel(); if (cur_panel) { - cur_panel->getChildView("add_friend_btn")->setEnabled(!is_friend); +// cur_panel->getChildView("add_friend_btn")->setEnabled(!is_friend); +// [RLVa:KB] - Checked: 2010-07-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0h + cur_panel->getChildView("add_friend_btn")->setEnabled( + !is_friend && ((!nearby_tab_active) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)))); +// [/RLBa:KB] if (friends_tab_active) { cur_panel->getChildView("del_btn")->setEnabled(multiple_selected); @@ -903,6 +917,13 @@ void LLPanelPeople::updateButtons() bool enable_calls = LLVoiceClient::getInstance()->isVoiceWorking() && LLVoiceClient::getInstance()->voiceEnabled(); +// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) | Modified: RLVa-1.2.0d + if ( (nearby_tab_active) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) + { + item_selected = multiple_selected = false; + } +// [/RLBa:KB] + buttonSetEnabled("view_profile_btn",item_selected); buttonSetEnabled("share_btn", item_selected); buttonSetEnabled("im_btn", multiple_selected); // allow starting the friends conference for multiple selection diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 46c58cd139..e8cfbe03f3 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -55,6 +55,10 @@ public: // when voice is available /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d + LLAvatarList* getNearbyList() { return mNearbyList; } +// [/RLVa:KB] + // internals class Updater; diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 131e8e9359..eb574f564d 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -63,7 +63,10 @@ #include "roles_constants.h" #include "llgroupactions.h" #include "lltrans.h" - +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) +#include "llslurl.h" +#include "rlvhandler.h" +// [/RLVa:KB] U8 string_value_to_click_action(std::string p_value); std::string click_action_to_string_value( U8 action); @@ -365,11 +368,18 @@ void LLPanelPermissions::refresh() // Update creator text field getChildView("Creator:")->setEnabled(TRUE); +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + BOOL creators_identical = FALSE; +// [/RLVa:KB] std::string creator_name; - LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); +// [/RLVa:KB] +// LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); - getChild("Creator Name")->setValue(creator_name); - getChildView("Creator Name")->setEnabled(TRUE); +// getChild("Creator Name")->setValue(creator_name); +// getChildView("Creator Name")->setEnabled(TRUE); +// [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row // Update owner text field getChildView("Owner:")->setEnabled(TRUE); @@ -397,8 +407,28 @@ void LLPanelPermissions::refresh() } } } +// getChild("Owner Name")->setValue(owner_name); +// getChildView("Owner Name")->setEnabled(TRUE); +// [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row + +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + // Only anonymize the creator if all of the selection was created by the same avie who's also the owner or they're a nearby avie + if ( (creators_identical) && (mCreatorID != gAgent.getID()) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) ) + creator_name = LLSLURL("agent", mCreatorID, "rlvanonym").getSLURLString(); + + // Only anonymize the owner name if all of the selection is owned by the same avie and isn't group owned + if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (mOwnerID != gAgent.getID()) ) + owner_name = LLSLURL("agent", mOwnerID, "rlvanonym").getSLURLString(); + } + + getChild("Creator Name")->setValue(creator_name); + getChildView("Creator Name")->setEnabled(TRUE); + getChild("Owner Name")->setValue(owner_name); getChildView("Owner Name")->setEnabled(TRUE); +// [/RLVa:KB] // update group text field getChildView("Group:")->setEnabled(TRUE); diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 884de65dd8..7f1576d3d5 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -52,6 +52,9 @@ #include "llviewercontrol.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" +// [RLVa:KB] - Checked: 2010-09-02 (RLVa-1.2.1b) +#include "rlvhandler.h" +// [/RLVa:KB] static LLRegisterPanelClassWrapper t_place_profile("panel_place_profile"); @@ -594,7 +597,10 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, mLastSelectedRegionID = region->getRegionID(); LLPanelPlaceInfo::processParcelInfo(parcel_data); - mYouAreHerePanel->setVisible(is_current_parcel); +// mYouAreHerePanel->setVisible(is_current_parcel); +// [RLVa:KB] - Checked: 2010-09-02 (RLVa-1.4.5) | Added: RLVa-1.2.1 + mYouAreHerePanel->setVisible(is_current_parcel && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))); +// [/RLVa:KB] getChild("sales_tab")->setVisible(for_sale); } @@ -661,6 +667,9 @@ void LLPanelPlaceProfile::updateYouAreHereBanner(void* userdata) BOOL display_banner = gAgent.getRegion()->getRegionID() == self->mLastSelectedRegionID && LLAgentUI::checkAgentDistance(self->mPosRegion, radius); - self->mYouAreHerePanel->setVisible(display_banner); +// self->mYouAreHerePanel->setVisible(display_banner); +// [RLVa:KB] - Checked: 2010-09-02 (RLVa-1.4.5) | Added: RLVa-1.2.1 + self->mYouAreHerePanel->setVisible(display_banner && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))); +// [/RLVa:KB] } } diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index d97f60ed22..63690c0e53 100755 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -52,13 +52,17 @@ public: S32 notifyParent(const LLSD& info); +// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RVLa-1.2.0f + const LLUUID& getAvatarId() const { return mAvatarId; } +// [/RLVa:KB] + protected: LLPanelProfile(); virtual void onTabSelected(const LLSD& param); - const LLUUID& getAvatarId() { return mAvatarId; } +// const LLUUID& getAvatarId() { return mAvatarId; } void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index b425bdddfc..33f283b98e 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -44,6 +44,9 @@ #include "llviewermenu.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 +#include "rlvhandler.h" +// [/RLVa:KB] class LLPanelTopInfoBar::LLParcelChangeObserver : public LLParcelObserver { @@ -452,28 +455,47 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item) { if (item == "landmark") { - LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { +// [/RLVa:KB] + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); - if(landmark == NULL) - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id",landmark->getUUID())); + if(landmark == NULL) + { + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); + } + else + { + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id",landmark->getUUID())); + } +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 } +// [/RLVa:KB] } else if (item == "copy") { - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl, false); - LLUIString location_str(slurl.getSLURLString()); +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { +// [/RLVa:KB] + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl, false); + LLUIString location_str(slurl.getSLURLString()); - LLClipboard::instance().copyToClipboard(location_str,0,location_str.length()); + LLClipboard::instance().copyToClipboard(location_str,0,location_str.length()); +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + } +// [/RLVa:KB] } } void LLPanelTopInfoBar::onInfoButtonClicked() { +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + return; +// [/RLVa:KB] + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); } diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index aa3ed22bee..df39e4b8f2 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -40,6 +40,10 @@ #include "llwearableitemslist.h" #include "llsdserialize.h" #include "llclipboard.h" +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) +#include "rlvcommon.h" +#include "rlvhandler.h" +// [/RLVa:KB] // Context menu and Gear menu helper. static void edit_outfit() @@ -110,6 +114,9 @@ protected: bool bp_selected = false; // true if body parts selected bool clothes_selected = false; bool attachments_selected = false; +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + S32 rlv_locked_count = 0; +// [/RLVa:KB] // See what types of wearables are selected. for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it) @@ -135,14 +142,27 @@ protected: { attachments_selected = true; } +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + if ( (rlv_handler_t::isEnabled()) && (!rlvPredCanRemoveItem(item)) ) + { + rlv_locked_count++; + } +// [/RLVa:KB] } // Enable/disable some menu items depending on the selection. +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + bool rlv_blocked = (mUUIDs.size() == rlv_locked_count); +// [/RLVa:KB] bool allow_detach = !bp_selected && !clothes_selected && attachments_selected; bool allow_take_off = !bp_selected && clothes_selected && !attachments_selected; menu->setItemVisible("take_off", allow_take_off); menu->setItemVisible("detach", allow_detach); +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + menu->setItemEnabled("take_off", !rlv_blocked); + menu->setItemEnabled("detach", !rlv_blocked); +// [/RLVa:KB] menu->setItemVisible("edit_outfit_separator", allow_take_off || allow_detach); } }; diff --git a/indra/newview/llparcelselection.h b/indra/newview/llparcelselection.h index 1cbdfc6f74..b2d64b2d6c 100644 --- a/indra/newview/llparcelselection.h +++ b/indra/newview/llparcelselection.h @@ -45,7 +45,10 @@ public: // this can return NULL at any time, as parcel selection // might have been invalidated. - LLParcel* getParcel() { return mParcel; } +// [RLVa:KB] - Checked: 2012-02-09 (RLVa-1.4.5) | Modified: RLVa-1.4.5 + LLParcel* getParcel() const { return mParcel; } +// [/RLVa:KB] +// LLParcel* getParcel() { return mParcel; } // Return the number of grid units that are owned by you within // the selection (computed by server). diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 9c25e69db0..8b23e5da23 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -86,6 +86,10 @@ #include "lltrans.h" #include "llviewercontrol.h" #include "llappviewer.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] const std::string HELLO_LSL = "default\n" @@ -1953,6 +1957,14 @@ void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata ) //self->mRunningCheckbox->get(); if( object ) { +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) ) + { + RlvUtil::notifyBlockedGeneric(); + return; + } +// [/RLVa:KB] + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetScriptRunning); msg->nextBlockFast(_PREHASH_AgentData); @@ -1978,6 +1990,14 @@ void LLLiveLSLEditor::onReset(void *userdata) LLViewerObject* object = gObjectList.findObject( self->mObjectUUID ); if(object) { +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) ) + { + RlvUtil::notifyBlockedGeneric(); + return; + } +// [/RLVa:KB] + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ScriptReset); msg->nextBlockFast(_PREHASH_AgentData); @@ -2095,6 +2115,14 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/) return; } +// [RLVa:KB] - Checked: 2010-11-25 (RLVa-1.2.2b) | Modified: RLVa-1.2.2b + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) ) + { + RlvUtil::notifyBlockedGeneric(); + return; + } +// [/RLVa:KB] + // get the latest info about it. We used to be losing the script // name on save, because the viewer object version of the item, // and the editor version would get out of synch. Here's a good @@ -2369,6 +2397,7 @@ void LLLiveLSLEditor::onLoad(void* userdata) void LLLiveLSLEditor::onSave(void* userdata, BOOL close_after_save) { LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; + self->mCloseAfterSave = close_after_save; self->saveIfNeeded(); } diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index a58c5dfbf0..33af0137e7 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -1087,8 +1087,17 @@ LLToast* LLScreenChannel::getToastByNotificationID(LLUUID id) std::vector::iterator it = find(mStoredToastList.begin(), mStoredToastList.end(), id); +// if (it == mStoredToastList.end()) +// return NULL; +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Modified: Catznip-2.5.0a if (it == mStoredToastList.end()) - return NULL; + { + // If we can't find it among the stored toasts then widen it to "all visible toasts" + it = find(mToastList.begin(), mToastList.end(), id); + if (it == mToastList.end()) + return NULL; + } +// [/SL:KB] return it->getToast(); } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 1ee9b377ba..d4a98f8055 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -90,6 +90,9 @@ #include "llvovolume.h" #include "pipeline.h" #include "llviewershadermgr.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +// [/RLVa:KB] #include "llglheaders.h" @@ -652,6 +655,16 @@ bool LLSelectMgr::enableLinkObjects() new_value = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); } } +// [RLVa:KB] - Checked: 2011-03-19 (RLVa-1.3.0f) | Modified: RLVa-0.2.0g + if ( (new_value) && ((rlv_handler_t::isEnabled()) && (!gRlvHandler.canStand())) ) + { + // Allow only if the avie isn't sitting on any of the selected objects + LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection(); + RlvSelectIsSittingOn f(gAgentAvatarp); + if (hSel->getFirstRootNode(&f, TRUE) != NULL) + new_value = false; + } +// [/RLVa:KB] return new_value; } @@ -664,7 +677,16 @@ bool LLSelectMgr::enableUnlinkObjects() first_editable_object && !first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced()); - +// [RLVa:KB] - Checked: 2011-03-19 (RLVa-1.3.0f) | Modified: RLVa-0.2.0g + if ( (new_value) && ((rlv_handler_t::isEnabled()) && (!gRlvHandler.canStand())) ) + { + // Allow only if the avie isn't sitting on any of the selected objects + LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection(); + RlvSelectIsSittingOn f(gAgentAvatarp); + if (hSel->getFirstRootNode(&f, TRUE) != NULL) + new_value = false; + } +// [/RLVa:KB] return new_value; } @@ -3278,6 +3300,16 @@ BOOL LLSelectMgr::selectGetPermissions(LLPermissions& result_perm) void LLSelectMgr::selectDelete() { +// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0e) | Added: RLVa-1.2.0a + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) + { + make_ui_sound("UISndInvalidOp"); + if (!gFloaterTools->getVisible()) + deselectAll(); + return; + } +// [/RLVa:KB] + S32 deleteable_count = 0; BOOL locked_but_deleteable_object = FALSE; @@ -3590,7 +3622,10 @@ struct LLDuplicateData void LLSelectMgr::selectDuplicate(const LLVector3& offset, BOOL select_copy) { - if (mSelectedObjects->isAttachment()) +// if (mSelectedObjects->isAttachment()) +// [RLVa:KB] - Checked: 2010-03-24 (RLVa-1.2.0e) | Added: RLVa-1.2.0a + if ( (mSelectedObjects->isAttachment()) || ((rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn())) ) +// [/RLVa:KB] { //RN: do not duplicate attachments make_ui_sound("UISndInvalidOp"); @@ -4044,11 +4079,39 @@ void LLSelectMgr::convertTransient() void LLSelectMgr::deselectAllIfTooFar() { +// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + if ( (!mSelectedObjects->isEmpty()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ))) ) + { + struct NotTransientOrFocusedMediaOrEditable : public LLSelectedNodeFunctor + { + bool apply(LLSelectNode* pNode) + { + const LLViewerObject* pObj = pNode->getObject(); + return (!pNode->isTransient()) && (pObj) && (!gRlvHandler.canEdit(pObj)) && + (pObj->getID() != LLViewerMediaFocus::getInstance()->getFocusedObjectID()); + } + } f; + if (mSelectedObjects->getFirstRootNode(&f, TRUE)) + deselectAll(); + } +// [/RLVa:KB] + if (mSelectedObjects->isEmpty() || mSelectedObjects->mSelectType == SELECT_TYPE_HUD) { return; } +// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.1.0l +#ifdef RLV_EXTENSION_CMD_INTERACT + // [Fall-back code] Don't allow an active selection (except for HUD attachments - see above) when @interact=n restricted + if (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) + { + deselectAll(); + return; + } +#endif // RLV_EXTENSION_CMD_INTERACT +// [/RLVa:KB] + // HACK: Don't deselect when we're navigating to rate an object's // owner or creator. JC if (gMenuObject->getVisible()) @@ -4057,13 +4120,20 @@ void LLSelectMgr::deselectAllIfTooFar() } LLVector3d selectionCenter = getSelectionCenterGlobal(); - if (gSavedSettings.getBOOL("LimitSelectDistance") +// if (gSavedSettings.getBOOL("LimitSelectDistance") +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-0.2.0f + BOOL fRlvFartouch = gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH) && gFloaterTools->getVisible(); + if ( (gSavedSettings.getBOOL("LimitSelectDistance") || (fRlvFartouch) ) +// [/RLVa:KB] && (!mSelectedObjects->getPrimaryObject() || !mSelectedObjects->getPrimaryObject()->isAvatar()) && (mSelectedObjects->getPrimaryObject() != LLViewerMediaFocus::getInstance()->getFocusedObject()) && !mSelectedObjects->isAttachment() && !selectionCenter.isExactlyZero()) { - F32 deselect_dist = gSavedSettings.getF32("MaxSelectDistance"); +// F32 deselect_dist = gSavedSettings.getF32("MaxSelectDistance"); +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-0.2.0f + F32 deselect_dist = (!fRlvFartouch) ? gSavedSettings.getF32("MaxSelectDistance") : 1.5f; +// [/RLVa:KB] F32 deselect_dist_sq = deselect_dist * deselect_dist; LLVector3d select_delta = gAgent.getPositionGlobal() - selectionCenter; @@ -6476,7 +6546,10 @@ BOOL LLSelectMgr::canDoDelete() const can_delete = true; } } - +// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0e) | Added: RLVa-1.2.0a + can_delete &= (!rlv_handler_t::isEnabled()) || (rlvCanDeleteOrReturn()); +// [/RLVa:KB] + return can_delete; } @@ -6508,7 +6581,12 @@ void LLSelectMgr::deselect() //----------------------------------------------------------------------------- BOOL LLSelectMgr::canDuplicate() const { - return const_cast(this)->mSelectedObjects->getFirstCopyableObject() != NULL; // HACK: casting away constness - MG +// return const_cast(this)->mSelectedObjects->getFirstCopyableObject() != NULL; // HACK: casting away constness - MG +// [RLVa:KB] - Checked: 2010-03-24 (RLVa-1.2.0e) | Added: RLVa-1.2.0a + return + (const_cast(this)->mSelectedObjects->getFirstCopyableObject() != NULL) && + ( (!rlv_handler_t::isEnabled()) || (rlvCanDeleteOrReturn()) ); +// [/RLVa:KB] } //----------------------------------------------------------------------------- // duplicate() diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index acad673b2b..eb8f996c86 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -544,3 +544,15 @@ void LLSidepanelAppearance::updateScrollingPanelList() mEditWearable->updateScrollingPanelList(); } } + +// [RLVa:KB] - Checked: 2010-09-16 (RLVa-1.2.1a) | Added: RLVa-1.2.1a +bool LLSidepanelAppearance::isOutfitEditPanelVisible() const +{ + return (mOutfitEdit) && (mOutfitEdit->getVisible()); +} + +bool LLSidepanelAppearance::isWearableEditPanelVisible() const +{ + return (mEditWearable) && (mEditWearable->getVisible()); +} +// [/RLVa:KB] diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 762f557a80..e12f765f56 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -66,6 +66,14 @@ public: void updateToVisibility( const LLSD& new_visibility ); LLPanelEditWearable* getWearable(){ return mEditWearable; } +// [RLVa:KB] - Checked: 2010-09-16 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + bool isOutfitEditPanelVisible() const; + bool isWearableEditPanelVisible() const; + + LLPanelOutfitEdit* getOutfitEditPanel() { return mOutfitEdit; } + LLPanelEditWearable* getWearableEditPanel() { return mEditWearable; } +// [/RLVa:KB] + private: void onFilterEdit(const std::string& search_string); void onVisibilityChange ( const LLSD& new_visibility ); diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 92c2863ffd..0a82b49e36 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -43,7 +43,9 @@ #include "llviewercontrol.h" #include "llviewerinventory.h" #include "llviewerobjectlist.h" - +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) +#include "rlvhandler.h" +// [/RLVa:KB] //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLItemPropertiesObserver @@ -340,9 +342,17 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (item->getCreatorUUID().notNull()) { LLUUID creator_id = item->getCreatorUUID(); - std::string name = - LLSLURL("agent", creator_id, "completename").getSLURLString(); - getChildView("BtnCreator")->setEnabled(TRUE); +// std::string name = +// LLSLURL("agent", creator_id, "completename").getSLURLString(); +// getChildView("BtnCreator")->setEnabled(TRUE); +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + // If the object creator matches the object owner we need to anonymize the creator field as well + bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == creator_id) && (perm.getOwner() != gAgent.getID())) || + (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ); + std::string name = LLSLURL("agent", creator_id, (!fRlvFilterCreator) ? "completename" : "rlvanonym").getSLURLString(); + getChildView("BtnCreator")->setEnabled(!fRlvFilterCreator); +// [/RLVa:KB] getChildView("LabelCreatorTitle")->setEnabled(TRUE); getChildView("LabelCreatorName")->setEnabled(FALSE); getChild("LabelCreatorName")->setValue(name); @@ -368,9 +378,16 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) else { LLUUID owner_id = perm.getOwner(); - name = LLSLURL("agent", owner_id, "completename").getSLURLString(); +// name = LLSLURL("agent", owner_id, "completename").getSLURLString(); +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (owner_id != gAgent.getID()); + name = LLSLURL("agent", owner_id, (!fRlvFilterOwner) ? "completename" : "rlvanonym").getSLURLString(); +// [/RLVa:KB] } - getChildView("BtnOwner")->setEnabled(TRUE); +// getChildView("BtnOwner")->setEnabled(TRUE); +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Added: RLVa-1.0.0e + getChildView("BtnOwner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] getChildView("LabelOwnerTitle")->setEnabled(TRUE); getChildView("LabelOwnerName")->setEnabled(FALSE); getChild("LabelOwnerName")->setValue(name); @@ -699,6 +716,17 @@ void LLSidepanelItemInfo::onClickCreator() if(!item) return; if(!item->getCreatorUUID().isNull()) { +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Added: RLVa-1.2.1b + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + const LLPermissions& perm = item->getPermissions(); + if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) && (perm.getOwner() != gAgent.getID())) || + (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) + { + return; + } + } +// [/RLVa:KB] LLAvatarActions::showProfile(item->getCreatorUUID()); } } @@ -714,6 +742,10 @@ void LLSidepanelItemInfo::onClickOwner() } else { +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (item->getPermissions().getOwner() != gAgent.getID()) ) + return; +// [/RLVa:KB] LLAvatarActions::showProfile(item->getPermissions().getOwner()); } } diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index ad7c939728..9b0898635d 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -64,6 +64,10 @@ #include "lltextbase.h" #include "llstring.h" #include "lltrans.h" +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) +#include "llslurl.h" +#include "rlvhandler.h" +// [/RLVa:KB] ///---------------------------------------------------------------------------- /// Class llsidepaneltaskinfo @@ -370,11 +374,18 @@ void LLSidepanelTaskInfo::refresh() // Update creator text field getChildView("Creator:")->setEnabled(TRUE); +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + BOOL creators_identical = FALSE; +// [/RLVa:KB] std::string creator_name; - LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); +// [/RLVa:KB] +// LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); - getChild("Creator Name")->setValue(creator_name); - getChildView("Creator Name")->setEnabled(TRUE); +// getChild("Creator Name")->setValue(creator_name); +// getChildView("Creator Name")->setEnabled(TRUE); +// [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row // Update owner text field getChildView("Owner:")->setEnabled(TRUE); @@ -402,8 +413,28 @@ void LLSidepanelTaskInfo::refresh() } } } +// getChild("Owner Name")->setValue(owner_name); +// getChildView("Owner Name")->setEnabled(TRUE); +// [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row + +// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + // Only anonymize the creator if all of the selection was created by the same avie who's also the owner or they're a nearby avie + if ( (creators_identical) && (mCreatorID != gAgent.getID()) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) ) + creator_name = LLSLURL("agent", mCreatorID, "rlvanonym").getSLURLString(); + + // Only anonymize the owner name if all of the selection is owned by the same avie and isn't group owned + if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (mOwnerID != gAgent.getID()) ) + owner_name = LLSLURL("agent", mOwnerID, "rlvanonym").getSLURLString(); + } + + getChild("Creator Name")->setValue(creator_name); + getChildView("Creator Name")->setEnabled(TRUE); + getChild("Owner Name")->setValue(owner_name); getChildView("Owner Name")->setEnabled(TRUE); +// [/RLVa:KB] // update group text field getChildView("Group:")->setEnabled(TRUE); diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 3a82233320..3c911cd75b 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -34,6 +34,9 @@ #include "llviewernetwork.h" #include "llfiltersd2xmlrpc.h" #include "curl/curl.h" +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) +#include "rlvhandler.h" +// [/RLVa:KB] const char* LLSLURL::SLURL_HTTP_SCHEME = "http"; const char* LLSLURL::SLURL_HTTPS_SCHEME = "https"; const char* LLSLURL::SLURL_SECONDLIFE_SCHEME = "secondlife"; @@ -382,8 +385,13 @@ std::string LLSLURL::getSLURLString() const S32 x = llround( (F32)mPosition[VX] ); S32 y = llround( (F32)mPosition[VY] ); S32 z = llround( (F32)mPosition[VZ] ); - return LLGridManager::getInstance()->getSLURLBase(mGrid) + - LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z); +// return LLGridManager::getInstance()->getSLURLBase(mGrid) + +// LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z); +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d + return LLGridManager::getInstance()->getSLURLBase(mGrid) + + ( ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) || (!RlvUtil::isNearbyRegion(mRegion))) + ? (LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z)) : RlvStrings::getString(RLV_STRING_HIDDEN_REGION) ); +// [/RLVa:KB] } case APP: { diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 156aa25274..7290a9d8c6 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -188,6 +188,10 @@ #include "llvoicechannel.h" #include "llpathfindingmanager.h" +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) +#include "rlvhandler.h" +// [/RLVa:KB] + #include "lllogin.h" #include "llevents.h" #include "llstartuplistener.h" @@ -377,6 +381,13 @@ bool idle_startup() std::string lastGPU = gSavedSettings.getString("LastGPUString"); std::string thisGPU = LLFeatureManager::getInstance()->getGPUString(); +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-0.2.1d + if ( (gSavedSettings.controlExists(RLV_SETTING_MAIN)) && (gSavedSettings.getBOOL(RLV_SETTING_MAIN)) ) + { + rlv_handler_t::setEnabled(TRUE); + } +// [/RLVa:KB] + if (LLFeatureManager::getInstance()->isSafe()) { LLNotificationsUtil::add("DisplaySetToSafe"); @@ -972,6 +983,18 @@ bool idle_startup() // their last location, or some URL "-url //sim/x/y[/z]" // All accounts have both a home and a last location, and we don't support // more locations than that. Choose the appropriate one. JC +// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d +#ifndef RLV_EXTENSION_STARTLOCATION + if (rlv_handler_t::isEnabled()) +#else + if ( (rlv_handler_t::isEnabled()) && (RlvSettings::getLoginLastLocation()) ) +#endif // RLV_EXTENSION_STARTLOCATION + { + // Force login at the last location + LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST)); + } +// [/RLVa:KB] + switch (LLStartUp::getStartSLURL().getType()) { case LLSLURL::LOCATION: @@ -1789,6 +1812,14 @@ bool idle_startup() llinfos << "Creating Inventory Views" << llendl; LLFloaterReg::getInstance("inventory"); display_startup(); + +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Added: RLVa-1.1.0f + if (rlv_handler_t::isEnabled()) + { + // Regularly process a select subset of retained commands during logon + gIdleCallbacks.addFunction(RlvHandler::onIdleStartup, new LLTimer()); + } +// [/RLVa:KB] LLStartUp::setStartupState( STATE_MISC ); display_startup(); return FALSE; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index ff69c6e9fd..e8e8bd3e88 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -86,7 +86,6 @@ // system includes #include - // // Globals // diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp index 50a088b799..8d6c6ec694 100644 --- a/indra/newview/llteleporthistory.cpp +++ b/indra/newview/llteleporthistory.cpp @@ -39,6 +39,9 @@ #include "llviewerregion.h" #include "llworldmap.h" #include "llagentui.h" +// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) +#include "rlvhandler.h" +// [/RLVa:KB] ////////////////////////////////////////////////////////////////////////////// // LLTeleportHistoryItem @@ -149,8 +152,16 @@ void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos) mItems.erase (mItems.begin() + mCurrentItem + 1, mItems.end()); // Append an empty item to the history and make it current. - mItems.push_back(LLTeleportHistoryItem("", LLVector3d())); - mCurrentItem++; +// mItems.push_back(LLTeleportHistoryItem("", LLVector3d())); +// mCurrentItem++; +// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b + // Only append a new item if the list is currently empty or if not @showloc=n restricted and the last entry wasn't zero'ed out + if ( (mItems.size() == 0) || ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!mItems.back().mGlobalPos.isExactlyZero())) ) + { + mItems.push_back(LLTeleportHistoryItem("", LLVector3d())); + mCurrentItem++; + } +// [RLVa:KB] } // Update current history item. @@ -160,11 +171,23 @@ void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos) llassert(!"Invalid current teleport history item"); return; } - LLVector3 new_pos_local = gAgent.getPosAgentFromGlobal(new_pos); - mItems[mCurrentItem].mFullTitle = getCurrentLocationTitle(true, new_pos_local); - mItems[mCurrentItem].mTitle = getCurrentLocationTitle(false, new_pos_local); - mItems[mCurrentItem].mGlobalPos = new_pos; - mItems[mCurrentItem].mRegionID = gAgent.getRegion()->getRegionID(); + +// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { +// [/RLVa:KB] + LLVector3 new_pos_local = gAgent.getPosAgentFromGlobal(new_pos); + mItems[mCurrentItem].mFullTitle = getCurrentLocationTitle(true, new_pos_local); + mItems[mCurrentItem].mTitle = getCurrentLocationTitle(false, new_pos_local); + mItems[mCurrentItem].mGlobalPos = new_pos; + mItems[mCurrentItem].mRegionID = gAgent.getRegion()->getRegionID(); +// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b + } + else + { + mItems[mCurrentItem] = LLTeleportHistoryItem(RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL), LLVector3d::zero); + } +// [/RLVa:KB] } dump(); diff --git a/indra/newview/llteleporthistory.h b/indra/newview/llteleporthistory.h index e9c29c39bf..401c340362 100644 --- a/indra/newview/llteleporthistory.h +++ b/indra/newview/llteleporthistory.h @@ -234,6 +234,10 @@ private: * Using this connection we get notified when a teleport fails. */ boost::signals2::connection mTeleportFailedConn; + +// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b + friend class RlvUIEnabler; +// [/RLVa:KB] }; #endif diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index af5a047da4..d5884c31d5 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -33,6 +33,9 @@ #include "lldir.h" #include "llteleporthistory.h" #include "llagent.h" +// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) +#include "rlvhandler.h" +// [/RLVa:KB] // Max offset for two global positions to consider them as equal const F64 MAX_GLOBAL_POS_OFFSET = 5.0f; @@ -92,6 +95,13 @@ void LLTeleportHistoryStorage::onTeleportHistoryChange() } const LLTeleportHistoryItem &item = th->getItems()[th->getCurrentItemIndex()]; +// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b + // Make sure we don't attempt to save zero'ed out teleport history items + if (item.mGlobalPos.isExactlyZero()) + { + return; + } +// [/RLVa:KB] addItem(item.mTitle, item.mGlobalPos); save(); @@ -116,6 +126,13 @@ bool LLTeleportHistoryStorage::compareByTitleAndGlobalPos(const LLTeleportHistor void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d& global_pos, const LLDate& date) { +// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return; + } +// [/RLVa:KB] + LLTeleportHistoryPersistentItem item(title, global_pos, date); slurl_list_t::iterator item_iter = std::find_if(mItems.begin(), mItems.end(), diff --git a/indra/newview/llteleporthistorystorage.h b/indra/newview/llteleporthistorystorage.h index cf4c85a991..f0131ac897 100644 --- a/indra/newview/llteleporthistorystorage.h +++ b/indra/newview/llteleporthistorystorage.h @@ -108,7 +108,11 @@ public: */ void goToItem(S32 idx); -private: +//private: +// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b +protected: + friend class RlvUIEnabler; +// [/RLVa:KB] void load(); void dump() const; diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp index c33fde99c5..e2127a9e40 100644 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -49,7 +49,10 @@ LLToastPanel::~LLToastPanel() std::string LLToastPanel::getTitle() { // *TODO: create Title and localize it. If it will be required. - return mNotification->getMessage(); +// return mNotification->getMessage(); +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a + return (mNotification->hasLabel()) ? mNotification->getLabel() : mNotification->getMessage(); +// [/SL:KB] } //virtual diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 1877460fbc..225be781c8 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -59,6 +59,10 @@ #include "llvoavatarself.h" #include "llworld.h" #include "llclipboard.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] // syntactic sugar #define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember)) @@ -1207,6 +1211,15 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, return; } + +// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0e) | Modified: RLVa-1.2.0a + // Fallback in case there's a new code path that leads here (see behaviour notes) + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT))) ) + { + return; + } +// [/RLVa:KB] + //llinfos << "Rezzing object" << llendl; make_ui_sound("UISndObjectRezIn"); LLViewerInventoryItem* item; @@ -1478,6 +1491,23 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL BOOL volume = (LL_PCODE_VOLUME == obj->getPCode()); BOOL attached = obj->isAttachment(); BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; + +// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c) | Modified: RLVa-1.0.0c + if (rlv_handler_t::isEnabled()) + { + const LLViewerObject* pObjRoot = obj->getRootEdit(); + if (gRlvAttachmentLocks.isLockedAttachment(pObjRoot)) + { + return ACCEPT_NO_LOCKED; // Disallow inventory drops on a locked attachment + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) + { + if ( (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) && (gAgentAvatarp->getRoot() == pObjRoot) ) + return ACCEPT_NO_LOCKED; // ... or on a linkset the avie is sitting on under @unsit=n/@sittp=n + } + } +// [/RLVa:KB] + if(attached && !unrestricted) { return ACCEPT_NO_LOCKED; @@ -1704,6 +1734,13 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( return ACCEPT_NO; } +// [RLVa:KB] - Checked: 2013-02-13 (RLVa-1.4.8) + bool fReplace = !(mask & MASK_CONTROL); + if ( (rlv_handler_t::isEnabled()) && (!rlvPredCanWearItem(item, (fReplace) ? RLV_WEAR_REPLACE : RLV_WEAR_ADD)) ) + { + return ACCEPT_NO_LOCKED; + } +// [/RLVa:KB] if( drop ) { @@ -1712,7 +1749,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( // LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0)); // [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-2.2) // Make this behave consistent with dad3dWearItem - LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0, !(mask & MASK_CONTROL))); + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0, fReplace)); // [/SL:KB] copy_inventory_item( gAgent.getID(), @@ -1738,6 +1775,14 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { +// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l + // RELEASE-RLVa: [SL-2.2.0] Make sure the code below is the only code path to LLToolDragAndDrop::dad3dRezFromObjectOnLand() + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT))) ) + { + return ACCEPT_NO_LOCKED; + } +// [/RLVa:KB] + if (mSource == SOURCE_WORLD) { return dad3dRezFromObjectOnLand(obj, face, mask, drop); @@ -1800,6 +1845,18 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { +// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l + // NOTE: if (mask & MASK_CONTROL) then it's a drop rather than a rez, so we let that pass through when @rez=n restricted + // (but not when @interact=n restricted unless the drop target is a HUD attachment) + // RELEASE-RLVa: [SL-2.2.0] Make sure the code below is the only code path to LLToolDragAndDrop::dad3dRezFromObjectOnObject() + if ( (rlv_handler_t::isEnabled()) && + ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && ((mask & MASK_CONTROL) == 0) ) || + ( (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (((mask & MASK_CONTROL) == 0) || (!obj->isHUDAttachment())) ) ) ) + { + return ACCEPT_NO_LOCKED; + } +// [/RLVa:KB] + // handle objects coming from object inventory if (mSource == SOURCE_WORLD) { @@ -2030,11 +2087,22 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem( return ACCEPT_NO; } +// [RLVa:KB] - Checked: 2013-02-13 (RLVa-1.4.8) + bool fReplace = (!(mask & MASK_CONTROL)) || (LLAssetType::AT_BODYPART == item->getType()); // Body parts should always replace + if ( (rlv_handler_t::isEnabled()) && (!rlvPredCanWearItem(item, (fReplace) ? RLV_WEAR_REPLACE : RLV_WEAR_ADD)) ) + { + return ACCEPT_NO_LOCKED; + } +// [/RLVa:KB] + if( drop ) { // TODO: investigate wearables may not be loaded at this point EXT-8231 - LLAppearanceMgr::instance().wearItemOnAvatar(item->getUUID(),true, !(mask & MASK_CONTROL)); +// [RLVa:KB] - Checked: 2013-02-13 (RLVa-1.4.8) + LLAppearanceMgr::instance().wearItemOnAvatar(item->getUUID(), true, fReplace); +// [/RLVa:KB] +// LLAppearanceMgr::instance().wearItemOnAvatar(item->getUUID(),true, !(mask & MASK_CONTROL)); } return ACCEPT_YES_MULTI; } diff --git a/indra/newview/lltoolface.cpp b/indra/newview/lltoolface.cpp index a00ac10698..4b02174009 100644 --- a/indra/newview/lltoolface.cpp +++ b/indra/newview/lltoolface.cpp @@ -39,6 +39,9 @@ #include "llviewerobject.h" #include "llviewerwindow.h" #include "llfloatertools.h" +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) +#include "rlvhandler.h" +// [/RLVa:KB] // // Member functions @@ -90,6 +93,15 @@ void LLToolFace::pickCallback(const LLPickInfo& pick_info) return; } +// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + if ( (rlv_handler_t::isEnabled()) && + ( (!gRlvHandler.canEdit(hit_obj)) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(hit_obj, pick_info.mObjectOffset))) ) ) + { + return; + } +// [/RLVa:KB] + // ...clicked on a world object, try to pick the appropriate face if (pick_info.mKeyMask & MASK_SHIFT) diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index 9907da0f0e..a2627cadfe 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -56,6 +56,9 @@ #include "llviewerregion.h" #include "llvoavatarself.h" #include "llworld.h" +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) +#include "rlvhandler.h" +// [/RLVa:KB] const S32 SLOP_DIST_SQ = 4; @@ -157,7 +160,11 @@ void LLToolGrab::pickCallback(const LLPickInfo& pick_info) } // if not over object, do nothing - if (!objectp) +// if (!objectp) +// [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Added: RLVa-1.1.0l + // Block initiating a drag operation on an object that can't be touched + if ( (!objectp) || ((rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(objectp, pick_info.mObjectOffset))) ) +// [/RLVa:KB] { LLToolGrab::getInstance()->setMouseCapture(TRUE); LLToolGrab::getInstance()->mMode = GRAB_NOOBJECT; @@ -418,6 +425,22 @@ BOOL LLToolGrab::handleHover(S32 x, S32 y, MASK mask) return TRUE; } +// [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l + // Block dragging an object beyond touch range when @fartouch=n restricted + if ( (rlv_handler_t::isEnabled()) && (GRAB_INACTIVE != mMode) && (GRAB_NOOBJECT != mMode) && (hasMouseCapture()) && + (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(mGrabPick.getObject(), mGrabPick.mObjectOffset)) ) + { + if (gGrabTransientTool) + { + // Prevent the grab tool from popping up as soon as we kill the drag operation + gBasicToolset->selectTool(gGrabTransientTool); + gGrabTransientTool = NULL; + } + setMouseCapture(FALSE); + return TRUE; + } +// [/RLVa:KB] + // Do the right hover based on mode switch( mMode ) { diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index a135ba70f5..78201816b7 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -55,7 +55,10 @@ #include "llviewerjoystick.h" #include "llviewermenu.h" #include "llviewerparcelmgr.h" - +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) +#include "rlvhandler.h" +#include "rlvui.h" +// [/RLVa:KB] // Used when app not active to avoid processing hover. LLTool* gToolNull = NULL; @@ -80,8 +83,12 @@ LLToolMgr::LLToolMgr() { // Not a panel, register these callbacks globally. LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this)); - LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this)); - LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this, _2)); +// LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this)); +// LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this, _2)); +// [RLVa:KB] - Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d + LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&RlvUIEnabler::isBuildEnabled)); + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this)); +// [/RLVa:KB] gToolNull = new LLTool(LLStringUtil::null); // Does nothing setCurrentTool(gToolNull); @@ -247,14 +254,17 @@ bool LLToolMgr::canEdit() return LLViewerParcelMgr::getInstance()->allowAgentBuild(); } -void LLToolMgr::toggleBuildMode(const LLSD& sdname) +//void LLToolMgr::toggleBuildMode(const LLSD& sdname) +// [RLVa:KB] - Checked: 2012-04-26 (RLVa-1.4.6) | Added: RLVa-1.4.6 +void LLToolMgr::toggleBuildMode() +// [/RLVa:KB] { - const std::string& param = sdname.asString(); - - if (param == "build" && !canEdit()) - { - return; - } +// const std::string& param = sdname.asString(); +// +// if (param == "build" && !canEdit()) +// { +// return; +// } LLFloaterReg::toggleInstanceOrBringToFront("build"); diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h index e7d1c56c83..fb76897113 100644 --- a/indra/newview/lltoolmgr.h +++ b/indra/newview/lltoolmgr.h @@ -54,7 +54,10 @@ public: bool inEdit(); bool canEdit(); - void toggleBuildMode(const LLSD& sdname); +// [RLVa:KB] - Checked: 2012-04-26 (RLVa-1.4.6) | Added: RLVa-1.4.6 + void toggleBuildMode(); +// [/RLVa:KB] +// void toggleBuildMode(const LLSD& sdname); /* Determines if we are in Build mode or not. */ bool inBuildMode(); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 462fcb4379..7cba419639 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -69,6 +69,9 @@ #include "llui.h" #include "llweb.h" #include "pipeline.h" // setHighlightObject +// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) +#include "rlvhandler.h" +// [/RLVa:KB] extern BOOL gDebugClicks; @@ -195,6 +198,15 @@ BOOL LLToolPie::handleLeftClickPick() // If it's a left-click, and we have a special action, do it. if (useClickAction(mask, object, parent)) { +// [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l + // Block left-click special actions when fartouch restricted + if ( (rlv_handler_t::isEnabled()) && + (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(object, mPick.mObjectOffset)) ) + { + return TRUE; + } +// [/RLVa:KB] + mClickAction = 0; if (object && object->getClickAction()) { @@ -316,6 +328,14 @@ BOOL LLToolPie::handleLeftClickPick() ((object->flagUsePhysics() || (parent && !parent->isAvatar() && parent->flagUsePhysics())) || touchable) ) { +// [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l + // Triggered by left-clicking on a touchable object + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object, mPick.mObjectOffset)) ) + { + return LLTool::handleMouseDown(x, y, mask); + } +// [/RLVa:KB] + gGrabTransientTool = this; mMouseButtonDown = false; LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() ); @@ -430,7 +450,11 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) { case CLICK_ACTION_SIT: { - if (isAgentAvatarValid() && !gAgentAvatarp->isSitting()) // not already sitting? +// if (isAgentAvatarValid() && !gAgentAvatarp->isSitting()) // not already sitting? +// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) | Modified: RLVa-1.2.0g + if ( (isAgentAvatarValid() && !gAgentAvatarp->isSitting()) && + ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canSit(object, LLToolPie::getInstance()->getHoverPick().mObjectOffset))) ) +// [/RLVa:KB] { cursor = UI_CURSOR_TOOLSIT; } @@ -543,6 +567,19 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE); LLViewerObject *parent = NULL; LLViewerObject *object = mHoverPick.getObject(); +// [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l + // Block all special click action cursors when: + // - @fartouch=n restricted and the object is out of range + // - @interact=n restricted and the object isn't a HUD attachment + if ( (object) && (rlv_handler_t::isEnabled()) && + ( ((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && (!gRlvHandler.canTouch(object, mHoverPick.mObjectOffset)) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (!object->isHUDAttachment())) ) ) + { + gViewerWindow->setCursor(UI_CURSOR_ARROW); + return TRUE; + } +// [/RLVa:KB] + if (object) { parent = object->getRootEdit(); @@ -596,7 +633,13 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) gViewerWindow->setCursor(cursor); lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; } - +// [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Added: RLVa-1.1.0l + else if ( (object) && (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object)) ) + { + // Block showing the "grab" or "touch" cursor if we can't touch the object (@fartouch=n is handled above) + gViewerWindow->setCursor(UI_CURSOR_ARROW); + } +// [/RLVa:KB] else if ((object && !object->isAvatar() && object->flagUsePhysics()) || (parent && !parent->isAvatar() && parent->flagUsePhysics())) { @@ -991,26 +1034,44 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l if (LLAvatarNameCache::useDisplayNames() && LLAvatarNameCache::get(hover_object->getID(), &av_name)) { - final_name = av_name.getCompleteName(); +// final_name = av_name.getCompleteName(); +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + final_name = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); +// [/RLVa:KB] } else { - final_name = full_name; +// final_name = full_name; +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + final_name = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? full_name : RlvStrings::getAnonym(full_name); +// [/RLVa:KB] } // *HACK: We may select this object, so pretend it was clicked mPick = mHoverPick; - LLInspector::Params p; - p.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); - p.message(final_name); - p.image.name("Inspector_I"); - p.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); - p.visible_time_near(6.f); - p.visible_time_far(3.f); - p.delay_time(gSavedSettings.getF32("AvatarInspectorTooltipDelay")); - p.wrap(false); - - LLToolTipMgr::instance().show(p); +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.2a) | Added: RLVa-1.2.0e + if ( (!rlv_handler_t::isEnabled()) || + ( (gRlvHandler.canTouch(hover_object, mHoverPick.mObjectOffset)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) ) + { +// [/RLVa:KB] + LLInspector::Params p; + p.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); + p.message(final_name); + p.image.name("Inspector_I"); + p.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); + p.visible_time_near(6.f); + p.visible_time_far(3.f); + p.delay_time(gSavedSettings.getF32("AvatarInspectorTooltipDelay")); + p.wrap(false); + + LLToolTipMgr::instance().show(p); +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.2a) | Added: RLVa-1.2.0e + } + else + { + LLToolTipMgr::instance().show(final_name); + } +// [/RLVa:KB] } } else @@ -1113,22 +1174,34 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l { // We may select this object, so pretend it was clicked mPick = mHoverPick; - LLInspector::Params p; - p.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); - p.message(tooltip_msg); - p.image.name("Inspector_I"); - p.click_callback(boost::bind(showObjectInspector, hover_object->getID(), mHoverPick.mObjectFace)); - p.time_based_media(is_time_based_media); - p.web_based_media(is_web_based_media); - p.media_playing(is_media_playing); - p.click_playmedia_callback(boost::bind(playCurrentMedia, mHoverPick)); - p.click_homepage_callback(boost::bind(VisitHomePage, mHoverPick)); - p.visible_time_near(6.f); - p.visible_time_far(3.f); - p.delay_time(gSavedSettings.getF32("ObjectInspectorTooltipDelay")); - p.wrap(false); - - LLToolTipMgr::instance().show(p); +// [RLVa:KB] - Checked: 2010-11-12 (RLVa-1.2.1g) | Modified: RLVa-1.2.1g + if ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) || + (gRlvHandler.canTouch(hover_object, mHoverPick.mObjectOffset)) ) + { +// [/RLVa:KB] + LLInspector::Params p; + p.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); + p.message(tooltip_msg); + p.image.name("Inspector_I"); + p.click_callback(boost::bind(showObjectInspector, hover_object->getID(), mHoverPick.mObjectFace)); + p.time_based_media(is_time_based_media); + p.web_based_media(is_web_based_media); + p.media_playing(is_media_playing); + p.click_playmedia_callback(boost::bind(playCurrentMedia, mHoverPick)); + p.click_homepage_callback(boost::bind(VisitHomePage, mHoverPick)); + p.visible_time_near(6.f); + p.visible_time_far(3.f); + p.delay_time(gSavedSettings.getF32("ObjectInspectorTooltipDelay")); + p.wrap(false); + + LLToolTipMgr::instance().show(p); +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e + } + else + { + LLToolTipMgr::instance().show(tooltip_msg); + } +// [/RLVa:KB] } } } @@ -1140,6 +1213,11 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask) { if (!LLUI::sSettingGroups["config"]->getBOOL("ShowHoverTips")) return TRUE; if (!mHoverPick.isValid()) return TRUE; +// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g +#ifdef RLV_EXTENSION_CMD_INTERACT + if (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) return TRUE; +#endif // RLV_EXTENSION_CMD_INTERACT +// [/RLVa:KB] LLViewerObject* hover_object = mHoverPick.getObject(); @@ -1664,16 +1742,29 @@ BOOL LLToolPie::handleRightClickPick() mute_msg = LLTrans::getString("MuteAvatar"); } - if (is_other_attachment) +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l + // Don't show the context menu on empty selection when fartouch restricted [see LLToolSelect::handleObjectSelection()] + if ( (!rlv_handler_t::isEnabled()) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) || + (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) ) { - gMenuAttachmentOther->getChild("Avatar Mute")->setValue(mute_msg); - gMenuAttachmentOther->show(x, y); +// [/RLVa:KB] + if (is_other_attachment) + { + gMenuAttachmentOther->getChild("Avatar Mute")->setValue(mute_msg); + gMenuAttachmentOther->show(x, y); + } + else + { + gMenuAvatarOther->getChild("Avatar Mute")->setValue(mute_msg); + gMenuAvatarOther->show(x, y); + } +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l } else { - gMenuAvatarOther->getChild("Avatar Mute")->setValue(mute_msg); - gMenuAvatarOther->show(x, y); + make_ui_sound("UISndInvalidOp"); } +// [/RLVa:KB] } else if (object->isAttachment()) { @@ -1698,10 +1789,24 @@ BOOL LLToolPie::handleRightClickPick() mute_msg = LLTrans::getString("MuteObject2"); } - gMenuHolder->getChild("Object Mute")->setValue(mute_msg); - gMenuObject->show(x, y); +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.el) | Modified: RLVa-1.1.0l + // Don't show the pie menu on empty selection when fartouch/interaction restricted + // (not entirely accurate in case of Tools / Select Only XXX [see LLToolSelect::handleObjectSelection()] + if ( (!rlv_handler_t::isEnabled()) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) || + (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) ) + { +// [/RLVa:KB] + gMenuHolder->getChild("Object Mute")->setValue(mute_msg); + gMenuObject->show(x, y); - showVisualContextMenuEffect(); + showVisualContextMenuEffect(); +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.el) | Modified: RLVa-1.1.0l + } + else + { + make_ui_sound("UISndInvalidOp"); + } +// [/RLVa:KB] } } diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index 68fe8bc4a5..213fc982a1 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -62,6 +62,9 @@ public: virtual LLTool* getOverrideTool(MASK mask); LLPickInfo& getPick() { return mPick; } +// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) | Added: RLVa-1.2.0a + LLPickInfo& getHoverPick() { return mHoverPick; } +// [/RLVa:KB] U8 getClickAction() { return mClickAction; } LLViewerObject* getClickActionObject() { return mClickActionObject; } LLObjectSelection* getLeftClickSelection() { return (LLObjectSelection*)mLeftClickSelection; } diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index 641fbc5042..c052a070c8 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -43,6 +43,9 @@ #include "llviewerwindow.h" #include "llworld.h" #include "llui.h" +// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0a) +#include "rlvhandler.h" +// [/RLVa:KB] //Headers added for functions moved from viewer.cpp #include "llvograss.h" @@ -123,6 +126,14 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, return FALSE; } +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-0.2.0f + // NOTE: don't use surface_pos_global since for prims it will be the center of the prim while we need center + offset + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (dist_vec_squared(gAgent.getPositionGlobal(), pick.mPosGlobal) > 1.5f * 1.5f) ) + { + return FALSE; + } +// [/RLVa:KB] + // Find the sim where the surface lives. LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(surface_pos_global); if (!regionp) @@ -240,7 +251,10 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) { flags |= FLAGS_USE_PHYSICS; } - if (create_selected) +// if (create_selected) +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Added: RLVa-1.0.0b + if ( (create_selected) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) ) +// [/RLVa:KB] { flags |= FLAGS_CREATE_SELECTED; } @@ -498,6 +512,13 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) { BOOL added = TRUE; +// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT))) ) + { + return TRUE; // Callers seem to expect a "did you handle it?" so we return TRUE rather than FALSE + } +// [/RLVa:KB] + if (gSavedSettings.getBOOL("CreateToolCopySelection")) { added = addDuplicate(x, y); diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 7c604a04bf..37d0a03f44 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -45,6 +45,10 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llworld.h" +// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) +#include "rlvhandler.h" +#include "llfloaterreg.h" +// [/RLVa:KB] // Globals //extern BOOL gAllowSelectAvatar; @@ -78,6 +82,35 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi { object = object->getRootEdit(); } + +// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + if ( (object) && (rlv_handler_t::isEnabled()) ) + { + if (!gRlvHandler.canEdit(object)) + { + if (!temp_select) + return LLSelectMgr::getInstance()->getSelection(); + else if (LLToolMgr::instance().inBuildMode()) + LLToolMgr::instance().toggleBuildMode(); + } + + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) && + (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion()) > 1.5f * 1.5f) ) + { + // NOTE: see behaviour notes for a rather lengthy explanation of why we're doing things this way + //if (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion() + pick.mObjectOffset) > 1.5f * 1.5f) + if (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f) + { + if ( (LLFloaterReg::instanceVisible("build")) && (pick.mKeyMask != MASK_SHIFT) && (pick.mKeyMask != MASK_CONTROL) ) + LLSelectMgr::getInstance()->deselectAll(); + return LLSelectMgr::getInstance()->getSelection(); + } + else if (LLToolMgr::instance().inBuildMode()) + LLToolMgr::instance().toggleBuildMode(); + } + } +// [/RLVa:KB] + BOOL select_owned = gSavedSettings.getBOOL("SelectOwnedOnly"); BOOL select_movable = gSavedSettings.getBOOL("SelectMovableOnly"); diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index cbd16e873d..58921cd0f5 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -63,6 +63,10 @@ #include "llworldmapview.h" #include "llviewercontrol.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const F32 DESTINATION_REACHED_RADIUS = 3.0f; const F32 DESTINATION_VISITED_RADIUS = 6.0f; diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index b5aa0ac92a..e08244d03e 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -41,6 +41,9 @@ #include "llworld.h" #include "lltoolmgr.h" #include "llviewerjoystick.h" +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) +#include "rlvhandler.h" +// [/RLVa:KB] // Linden library includes #include "lldrawable.h" @@ -349,7 +352,10 @@ void LLViewerCamera::setPerspective(BOOL for_selection, if (limit_select_distance) { // ...select distance from control - z_far = gSavedSettings.getF32("MaxSelectDistance"); +// z_far = gSavedSettings.getF32("MaxSelectDistance"); +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e + z_far = (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) ? gSavedSettings.getF32("MaxSelectDistance") : 1.5; +// [/RLVa:KB] } else { diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 07882c0ecf..f84cbcfdf2 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -77,6 +77,10 @@ #include "llwlparammanager.h" #include "llwaterparammanager.h" #include "llpostprocess.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] extern LLPointer gStartTexture; extern bool gShiftFrame; @@ -1020,7 +1024,11 @@ void render_hud_attachments() glh::matrix4f current_mod = glh_get_current_modelview(); // clamp target zoom level to reasonable values - gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f); +// gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f); +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Modified: RLVa-1.0.0c + gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, (!gRlvAttachmentLocks.hasLockedHUD()) ? 0.1f : 0.85f, 1.f); +// [/RLVa:KB] + // smoothly interpolate current zoom level gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f)); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 1f7cf0cdd4..c2bc815c65 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -140,7 +140,9 @@ #include "llnearbychatbar.h" // *NOTE: Please add files in alphabetical order to keep merges easy. - +// [RLVa:KB] - Checked: 2010-03-11 +#include "rlvfloaters.h" +// [/RLVa:KB] // handle secondlife:///app/openfloater/{NAME} URLs class LLFloaterOpenHandler : public LLCommandHandler { @@ -290,6 +292,10 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("reset_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("region_debug_console", "floater_region_debug_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("region_info", "floater_region_info.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); +// [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0a + LLFloaterReg::add("rlv_behaviours", "floater_rlv_behaviours.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("rlv_locks", "floater_rlv_locks.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); +// [/RLVa:KB] LLFloaterReg::add("script_debug", "floater_script_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("script_debug_output", "floater_script_debug_panel.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index f6e840adcd..98e9986ea5 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -326,8 +326,11 @@ void LLViewerJoystick::handleRun(F32 inc) if (1 == mJoystickRun) { ++mJoystickRun; - gAgent.setRunning(); - gAgent.sendWalkRun(gAgent.getRunning()); +// gAgent.setRunning(); +// gAgent.sendWalkRun(gAgent.getRunning()); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + gAgent.setTempRun(); +// [/RLVa:KB] } else if (0 == mJoystickRun) { @@ -342,8 +345,11 @@ void LLViewerJoystick::handleRun(F32 inc) --mJoystickRun; if (0 == mJoystickRun) { - gAgent.clearRunning(); - gAgent.sendWalkRun(gAgent.getRunning()); +// gAgent.clearRunning(); +// gAgent.sendWalkRun(gAgent.getRunning()); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + gAgent.clearTempRun(); +// [/RLVa:KB] } } } diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 1aa9fd8a45..6f4f449e46 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -41,6 +41,9 @@ #include "llvoavatarself.h" #include "llfloatercamera.h" #include "llinitparam.h" +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i +#include "rlvhandler.h" +// [/RLVa:KB] // // Constants @@ -91,14 +94,18 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m { if (KEYSTATE_UP == s) { - if (gAgent.mDoubleTapRunMode == mode && - gAgent.getRunning() && - !gAgent.getAlwaysRun()) - { - // Turn off temporary running. - gAgent.clearRunning(); - gAgent.sendWalkRun(gAgent.getRunning()); - } +// if (gAgent.mDoubleTapRunMode == mode && +// gAgent.getRunning() && +// !gAgent.getAlwaysRun()) +// { +// // Turn off temporary running. +// gAgent.clearRunning(); +// gAgent.sendWalkRun(gAgent.getRunning()); +// } +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + if ( (gAgent.mDoubleTapRunMode == mode) && (gAgent.getTempRun()) ) + gAgent.clearTempRun(); +// [/RLVa:KB] } else if (gSavedSettings.getBOOL("AllowTapTapHoldRun") && KEYSTATE_DOWN == s && @@ -109,8 +116,11 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m { // Same walk-key was pushed again quickly; this is a // double-tap so engage temporary running. - gAgent.setRunning(); - gAgent.sendWalkRun(gAgent.getRunning()); +// gAgent.setRunning(); +// gAgent.sendWalkRun(gAgent.getRunning()); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + gAgent.setTempRun(); +// [/RLVa:KB] } // Pressing any walk-key resets the double-tap timer diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a367abcb66..57f20129a0 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -122,6 +122,10 @@ #include "llwindow.h" #include "llpathfindingmanager.h" #include "boost/unordered_map.hpp" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] using namespace LLAvatarAppearanceDefines; @@ -1175,7 +1179,10 @@ class LLAdvancedToggleWireframe : public view_listener_t { bool handleEvent(const LLSD& userdata) { - gUseWireframe = !(gUseWireframe); +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + gUseWireframe = (!gUseWireframe) && (!gRlvAttachmentLocks.hasLockedHUD()); +// [/RLVa:KB] +// gUseWireframe = !(gUseWireframe); gWindowResized = TRUE; LLPipeline::updateRenderDeferred(); gPipeline.resetVertexBuffers(); @@ -2517,6 +2524,15 @@ void handle_object_touch() LLPickInfo pick = LLToolPie::getInstance()->getPick(); +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l + // NOTE: fallback code since we really shouldn't be getting an active selection if we can't touch this + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object, pick.mObjectOffset)) ) + { + RLV_ASSERT(false); + return; + } +// [/RLVa:KB] + // *NOTE: Hope the packets arrive safely and in order or else // there will be some problems. // *TODO: Just fix this bad assumption. @@ -2559,6 +2575,13 @@ bool enable_object_touch(LLUICtrl* ctrl) LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); bool new_value = obj && obj->flagHandleTouch(); +// [RLVa:KB] - Checked: 2010-11-12 (RLVa-1.2.1g) | Added: RLVa-1.2.1g + if ( (rlv_handler_t::isEnabled()) && (new_value) ) + { + // RELEASE-RLVa: [RLVa-1.2.1] Make sure this stays in sync with handle_object_touch() + new_value = gRlvHandler.canTouch(obj, LLToolPie::getInstance()->getPick().mObjectOffset); + } +// [/RLVa:KB] std::string item_name = ctrl->getName(); init_default_item_label(item_name); @@ -2592,7 +2615,11 @@ bool enable_object_touch(LLUICtrl* ctrl) void handle_object_open() { - LLFloaterReg::showInstance("openobject"); +// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e + if (enable_object_open()) + LLFloaterReg::showInstance("openobject"); +// [/RLVa:KB] +// LLFloaterReg::showInstance("openobject"); } bool enable_object_open() @@ -2819,7 +2846,17 @@ bool enable_object_edit() } else if (LLSelectMgr::getInstance()->selectGetAllValidAndObjectsFound()) { - enable = true; +// enable = true; +// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + bool fRlvCanEdit = (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ)); + if (!fRlvCanEdit) + { + LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection(); + RlvSelectIsEditable f; + fRlvCanEdit = (hSel.notNull()) && ((hSel->getFirstRootNode(&f, TRUE)) == NULL); + } + enable = fRlvCanEdit; +// [/RLVa:KB] } return enable; @@ -2862,7 +2899,10 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t { LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; - if (attachment->getNumObjects() > 0) +// if (attachment->getNumObjects() > 0) +// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.0a) | Added: RLVa-1.2.0a + if ( (attachment->getNumObjects() > 0) && ((!rlv_handler_t::isEnabled()) || (gRlvAttachmentLocks.canDetach(attachment))) ) +// [/RLVa:KB] { new_value = true; break; @@ -2905,7 +2945,10 @@ bool enable_object_mute() bool is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); bool is_self = avatar->isSelf(); - return !is_linden && !is_self; +// return !is_linden && !is_self; +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b + return !is_linden && !is_self && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); +// [/RLVa:KB] } else { @@ -2951,6 +2994,10 @@ class LLObjectMute : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(object); if (avatar) { +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.0.0e + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + return true; +// [/RLVa:KB] id = avatar->getID(); LLNameValue *firstname = avatar->getNVPair("FirstName"); @@ -3104,7 +3151,10 @@ void handle_avatar_freeze(const LLSD& avatar_id) if (!fullname.empty()) { LLSD args; - args["AVATAR_NAME"] = fullname; +// args["AVATAR_NAME"] = fullname; +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e + args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); +// [/RLVa:KB] LLNotificationsUtil::add("FreezeAvatarFullname", args, payload, @@ -3233,7 +3283,10 @@ void handle_avatar_eject(const LLSD& avatar_id) if (!fullname.empty()) { LLSD args; - args["AVATAR_NAME"] = fullname; +// args["AVATAR_NAME"] = fullname; +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e + args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); +// [/RLVa:KB] LLNotificationsUtil::add("EjectAvatarFullname", args, payload, @@ -3253,7 +3306,10 @@ void handle_avatar_eject(const LLSD& avatar_id) if (!fullname.empty()) { LLSD args; - args["AVATAR_NAME"] = fullname; +// args["AVATAR_NAME"] = fullname; +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e + args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); +// [/RLVa:KB] LLNotificationsUtil::add("EjectAvatarFullnameNoBan", args, payload, @@ -3493,7 +3549,10 @@ class LLSelfStandUp : public view_listener_t bool enable_standup_self() { - return isAgentAvatarValid() && gAgentAvatarp->isSitting(); +// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.0g + return isAgentAvatarValid() && gAgentAvatarp->isSitting() && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT); +// [/RLVa:KB] +// return isAgentAvatarValid() && gAgentAvatarp->isSitting(); } class LLSelfSitDown : public view_listener_t @@ -3507,7 +3566,10 @@ class LLSelfSitDown : public view_listener_t bool enable_sitdown_self() { - return isAgentAvatarValid() && !gAgentAvatarp->isSitting() && !gAgent.getFlying(); +// [RLVa:KB] - Checked: 2010-08-28 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + return isAgentAvatarValid() && !gAgentAvatarp->isSitting() && !gAgent.getFlying() && !gRlvHandler.hasBehaviour(RLV_BHVR_SIT); +// [/RLVa:KB] +// return isAgentAvatarValid() && !gAgentAvatarp->isSitting() && !gAgent.getFlying(); } class LLCheckPanelPeopleTab : public view_listener_t @@ -3750,7 +3812,10 @@ class LLAvatarEnableAddFriend : public view_listener_t bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); - bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()); +// bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()); +// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f + bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] return new_value; } }; @@ -3784,7 +3849,10 @@ class LLEditEnableCustomizeAvatar : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = gAgentWearables.areWearablesLoaded(); +// bool new_value = gAgentWearables.areWearablesLoaded(); +// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.0g + bool new_value = gAgentWearables.areWearablesLoaded() && ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canStand())); +// [/RLVa:KB] return new_value; } }; @@ -3808,6 +3876,16 @@ class LLEnableEditPhysics : public view_listener_t bool is_object_sittable() { +// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) | Added: RLVa-1.1.0j + // RELEASE-RLVa: [SL-2.2.0] Make sure we're examining the same object that handle_sit_or_stand() will request a sit for + if (rlv_handler_t::isEnabled()) + { + const LLPickInfo& pick = LLToolPie::getInstance()->getPick(); + if ( (pick.mObjectID.notNull()) && (!gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset)) ) + return false; + } +// [/RLVa:KB] + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (object && object->getPCode() == LL_PCODE_VOLUME) @@ -3839,8 +3917,23 @@ void handle_object_sit_or_stand() // get object selection offset - if (object && object->getPCode() == LL_PCODE_VOLUME) +// if (object && object->getPCode() == LL_PCODE_VOLUME) +// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) | Modified: RLVa-1.2.0c + if ( (object && object->getPCode() == LL_PCODE_VOLUME) && + ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canSit(object, pick.mObjectOffset))) ) +// [/RLVa:KB] { +// [RLVa:KB] - Checked: 2010-08-29 (RLVa-1.2.1c) | Added: RLVa-1.2.1c + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_STANDTP)) && (isAgentAvatarValid()) ) + { + if (gAgentAvatarp->isSitting()) + { + gAgent.standUp(); + return; + } + gRlvHandler.setSitSource(gAgent.getPositionGlobal()); + } +// [/RLVa:KB] gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); gMessageSystem->nextBlockFast(_PREHASH_AgentData); @@ -3870,6 +3963,11 @@ class LLLandSit : public view_listener_t { bool handleEvent(const LLSD& userdata) { +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f + if ( (rlv_handler_t::isEnabled()) && ((!gRlvHandler.canStand()) || (gRlvHandler.hasBehaviour(RLV_BHVR_SIT))) ) + return true; +// [/RLVa:KB] + gAgent.standUp(); LLViewerParcelMgr::getInstance()->deselectLand(); @@ -4408,6 +4506,17 @@ void handle_take_copy() { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return; +// [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c) | Modified: RLVa-1.2.0a + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStand()) ) + { + // Allow only if the avie isn't sitting on any of the selected objects + LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection(); + RlvSelectIsSittingOn f(gAgentAvatarp); + if ( (hSel.notNull()) && (hSel->getFirstRootNode(&f, TRUE) != NULL) ) + return; + } +// [/RLVa:KB] + const LLUUID category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT); derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); } @@ -4422,7 +4531,10 @@ private: bool handleEvent(const LLSD& userdata) { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; - +// [RLVa:KB] - Checked: 2010-03-24 (RLVa-1.4.0a) | Modified: RLVa-1.0.0b + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) return true; +// [/RLVa:KB] + mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); // Save selected objects, so that we still know what to return after the confirmation dialog resets selection. @@ -4469,6 +4581,12 @@ class LLObjectEnableReturn : public view_listener_t // Do not enable if nothing selected return false; } +// [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) + { + return false; + } +// [/RLVa:KB] #ifdef HACKED_GODLIKE_VIEWER bool new_value = true; #else @@ -4497,11 +4615,14 @@ void handle_take() { // we want to use the folder this was derezzed from if it's // available. Otherwise, derez to the normal place. - if(LLSelectMgr::getInstance()->getSelection()->isEmpty()) +// if(LLSelectMgr::getInstance()->getSelection()->isEmpty()) +// [RLVa:KB] - Checked: 2010-03-24 (RLVa-1.2.0e) | Modified: RLVa-1.0.0b + if ( (LLSelectMgr::getInstance()->getSelection()->isEmpty()) || ((rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn())) ) +// [/RLVa:KB] { return; } - + BOOL you_own_everything = TRUE; BOOL locked_but_takeable_object = FALSE; LLUUID category_id; @@ -4644,7 +4765,10 @@ bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelect // one item selected can be copied to inventory. BOOL enable_take() { - if (sitting_on_selection()) +// if (sitting_on_selection()) +// [RLVa:KB] - Checked: 2010-03-24 (RLVa-1.2.0e) | Modified: RLVa-1.0.0b + if ( (sitting_on_selection()) || ((rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn())) ) +// [/RLVa:KB] { return FALSE; } @@ -5110,8 +5234,12 @@ class LLToolsReleaseKeys : public view_listener_t { bool handleEvent(const LLSD& userdata) { - gAgent.forceReleaseControls(); +// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.0.5a + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_REMOVE)) ) + return true; +// [/RLVa:KB] + gAgent.forceReleaseControls(); return true; } }; @@ -5120,7 +5248,11 @@ class LLToolsEnableReleaseKeys : public view_listener_t { bool handleEvent(const LLSD& userdata) { - return gAgent.anyControlGrabbed(); +// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.0.5a + return (gAgent.anyControlGrabbed()) && + ( (!rlv_handler_t::isEnabled()) || (!gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_REMOVE)) ); +// [/RLVa:KB] +// return gAgent.anyControlGrabbed(); } }; @@ -5517,6 +5649,11 @@ void show_debug_menus() gMenuBarView->setItemVisible("Advanced", debug); // gMenuBarView->setItemEnabled("Advanced", debug); // Don't disable Advanced keyboard shortcuts when hidden + +// [RLVa:KB] - Checked: 2011-08-16 (RLVa-1.4.0b) | Modified: RLVa-1.4.0b + // NOTE: this is supposed to execute whether RLVa is enabled or not + rlvMenuToggleVisible(); +// [/RLVa:KB] gMenuBarView->setItemVisible("Debug", qamode); gMenuBarView->setItemEnabled("Debug", qamode); @@ -5623,16 +5760,16 @@ class LLWorldAlwaysRun : public view_listener_t if (gAgent.getAlwaysRun()) { gAgent.clearAlwaysRun(); - gAgent.clearRunning(); +// gAgent.clearRunning(); } else { gAgent.setAlwaysRun(); - gAgent.setRunning(); +// gAgent.setRunning(); } // tell the simulator. - gAgent.sendWalkRun(gAgent.getAlwaysRun()); +// gAgent.sendWalkRun(gAgent.getAlwaysRun()); // Update Movement Controls according to AlwaysRun mode LLFloaterMove::setAlwaysRunMode(gAgent.getAlwaysRun()); @@ -5687,6 +5824,11 @@ class LLWorldCreateLandmark : public view_listener_t { bool handleEvent(const LLSD& userdata) { +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.4.5) | Added: RLVa-1.0.0 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + return true; +// [/RLVa:KB] + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); return true; @@ -5697,12 +5839,24 @@ class LLWorldPlaceProfile : public view_listener_t { bool handleEvent(const LLSD& userdata) { +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + return true; +// [/RLVa:KB] + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); return true; } }; +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 +bool enable_place_profile() +{ + return LLFloaterSidePanelContainer::canShowPanel("places", LLSD().with("type", "agent")); +} +// [/RLVa:KB] + void handle_look_at_selection(const LLSD& param) { const F32 PADDING_FACTOR = 1.75f; @@ -5772,7 +5926,10 @@ class LLAvatarInviteToGroup : public view_listener_t bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); - if(avatar) +// if(avatar) +// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d + if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [/RLVa:KB] { LLAvatarActions::inviteToGroup(avatar->getID()); } @@ -5785,7 +5942,10 @@ class LLAvatarAddFriend : public view_listener_t bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); - if(avatar && !LLAvatarActions::isFriend(avatar->getID())) +// if(avatar && !LLAvatarActions::isFriend(avatar->getID())) +// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f + if ( (avatar && !LLAvatarActions::isFriend(avatar->getID())) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [/RLVa:KB] { request_friendship(avatar->getID()); } @@ -5826,7 +5986,10 @@ class LLAvatarAddContact : public view_listener_t bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); - if(avatar) +// if(avatar) +// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f + if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [/RLVa:KB] { create_inventory_callingcard(avatar->getID()); } @@ -5890,7 +6053,10 @@ bool enable_pay_avatar() { LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); LLVOAvatar* avatar = find_avatar_from_object(obj); - return (avatar != NULL); +// return (avatar != NULL); +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b + return (avatar != NULL) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] } bool enable_pay_object() @@ -5910,7 +6076,10 @@ bool enable_pay_object() bool enable_object_stand_up() { // 'Object Stand Up' menu item is enabled when agent is sitting on selection - return sitting_on_selection(); +// return sitting_on_selection(); +// [RLVa:KB] - Checked: 2010-07-24 (RLVa-1.2.0g) | Added: RLVa-1.2.0g + return sitting_on_selection() && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canStand()) ); +// [/RLVa:KB] } bool enable_object_sit(LLUICtrl* ctrl) @@ -5935,6 +6104,17 @@ bool enable_object_sit(LLUICtrl* ctrl) gMenuHolder->childSetText(item_name, get_default_item_label(item_name)); } } + +// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.2.0c + // RELEASE-RLVA: [SL-2.2.0] Make this match what happens in handle_object_sit_or_stand() + if (rlv_handler_t::isEnabled()) + { + const LLPickInfo& pick = LLToolPie::getInstance()->getPick(); + if (pick.mObjectID.notNull()) + sitting_on_sel = !gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset); + } +// [/RLVa:KB] + return !sitting_on_sel && is_object_sittable(); } @@ -6184,7 +6364,10 @@ class LLShowAgentProfile : public view_listener_t } LLVOAvatar* avatar = find_avatar_from_object(agent_id); - if (avatar) +// if (avatar) +// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d + if ( (avatar) && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (gAgent.getID() == agent_id)) ) +// [/RLVa:KB] { LLAvatarActions::showProfile(avatar->getID()); } @@ -6306,6 +6489,19 @@ private: LLViewerJointAttachment* attachment_point = NULL; if (index > 0) attachment_point = get_if_there(gAgentAvatarp->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); + +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f + // RELEASE-RLVa: [SL-2.2.0] If 'index != 0' then the object will be "add attached" [see LLSelectMgr::sendAttach()] + if ( (rlv_handler_t::isEnabled()) && + ( ((!index) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY))) || // Can't wear on default + ((index) && ((RLV_WEAR_ADD & gRlvAttachmentLocks.canAttach(attachment_point)) == 0)) || // or non-attachable attachpt + (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on object == "Take" + { + setObjectSelection(NULL); // Clear the selection or it'll get stuck + return true; + } +// [/RLVa:KB] + confirmReplaceAttachment(0, attachment_point); } return true; @@ -6450,6 +6646,24 @@ class LLAttachmentDrop : public view_listener_t { bool handleEvent(const LLSD& userdata) { +// [RLVa:KB] - Checked: 2010-03-15 (RLVa-1.2.0e) | Modified: RLVa-1.0.5 + if (rlv_handler_t::isEnabled()) + { + if (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_REMOVE)) + { + // NOTE: copy/paste of the code in enable_detach() + LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach f; + if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&f, FALSE) != NULL) ) + return true; + } + if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) + { + return true; + } + } +// [/RLVa:KB] + LLSD payload; LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); @@ -6475,14 +6689,21 @@ class LLAttachmentDetachFromPoint : public view_listener_t { uuid_vec_t ids_to_remove; const LLViewerJointAttachment *attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, user_data.asInteger(), (LLViewerJointAttachment*)NULL); - if (attachment->getNumObjects() > 0) +// if (attachment->getNumObjects() > 0) +// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.0a) | Added: RLVa-1.2.0a + if ( (attachment->getNumObjects() > 0) && ((!rlv_handler_t::isEnabled()) || (gRlvAttachmentLocks.canDetach(attachment))) ) +// [/RLVa:KB] { for (LLViewerJointAttachment::attachedobjs_vec_t::const_iterator iter = attachment->mAttachedObjects.begin(); iter != attachment->mAttachedObjects.end(); iter++) { LLViewerObject *attached_object = (*iter); +// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.0a) | Added: RLVa-1.2.0a + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(attached_object)) ) + continue; ids_to_remove.push_back(attached_object->getAttachmentItemID()); +// [/RLVa:KB] } } if (!ids_to_remove.empty()) @@ -6495,6 +6716,10 @@ class LLAttachmentDetachFromPoint : public view_listener_t static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data) { +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f + // RELEASE-RLVa: [SL-2.2.0] When attaching to a specific point the object will be "add attached" [see LLSelectMgr::sendAttach()] + bool fRlvEnable = true; +// [/RLVa:KB] std::string label; LLMenuItemGL* menu = dynamic_cast(ctrl); if (menu) @@ -6519,9 +6744,18 @@ static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data) } } } + +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f + if (rlv_handler_t::isEnabled()) + fRlvEnable = (!gRlvAttachmentLocks.isLockedAttachmentPoint(attachment, RLV_LOCK_ADD)); +// [/RLVa:KB] + menu->setLabel(label); } - return true; +// return true; +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Added: RLVa-1.2.0a + return fRlvEnable; +// [/RLVa:KB] } class LLAttachmentDetach : public view_listener_t @@ -6560,6 +6794,17 @@ class LLAttachmentDetach : public view_listener_t return true; } +// [RLVa:KB] - Checked: 2010-03-15 (RLVa-1.2.0a) | Modified: RLVa-1.0.5 + // NOTE: copy/paste of the code in enable_detach() + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_REMOVE)) ) + { + LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach f; + if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&f, FALSE) != NULL) ) + return true; + } +// [/RLVa:KB] + LLAppearanceMgr::instance().removeItemFromAvatar(object->getAttachmentItemID()); return true; @@ -6636,7 +6881,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() && can_build && item; +// bool new_value = enable_detach() && can_build && item; +// [RLVa:KB] - Checked: 2010-03-24 (RLVa-1.0.0b) | Modified: RLVa-1.0.0b + bool new_value = enable_detach() && can_build && item && (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)); +// [/RLVa:KB] return new_value; } @@ -6661,6 +6909,20 @@ BOOL enable_detach(const LLSD&) // ...if it's you, good to detach if (avatar->getID() == gAgent.getID()) { +// [RLVa:KB] - Checked: 2010-03-15 (RLVa-1.2.0a) | Modified: RLVa-1.0.5 + // NOTE: this code is reused as-is in LLAttachmentDetach::handleEvent() and LLAttachmentDrop::handleEvent() + // so any changes here should be reflected there as well + + // RELEASE-RLVa: [SL-2.2.0] 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()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_REMOVE)) ) + { + LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach f; + if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&f, FALSE) != NULL) ) + return FALSE; + } +// [/RLVa:KB] return TRUE; } @@ -6680,8 +6942,33 @@ 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() +//BOOL object_selected_and_point_valid() +// [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.2.0a) | Added: RLVa-1.2.0a +BOOL object_selected_and_point_valid(const LLSD& sdParam) +// [/RLVa:KB] { +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f + if (rlv_handler_t::isEnabled()) + { + if (!isAgentAvatarValid()) + return FALSE; + + // RELEASE-RLVa: [SL-2.2.0] Look at the caller graph for this function on every new release + // - object_is_wearable() => dead code [sdParam == 0 => default attach point => OK!] + // - enabler set up in LLVOAvatarSelf::buildMenus() => Rezzed prim / Put On / "Attach To" [sdParam == idxAttachPt] + // - "Object.EnableWear" enable => Rezzed prim / Put On / "Wear" or "Add" [sdParam blank] + // RELEASE-RLVa: [SL-2.2.0] If 'idxAttachPt != 0' then the object will be "add attached" [see LLSelectMgr::sendAttach()] + const LLViewerJointAttachment* pAttachPt = + get_if_there(gAgentAvatarp->mAttachmentPoints, sdParam.asInteger(), (LLViewerJointAttachment*)NULL); + if ( ((!pAttachPt) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY))) || // Can't wear on default attach point + ((pAttachPt) && ((RLV_WEAR_ADD & gRlvAttachmentLocks.canAttach(pAttachPt)) == 0)) || // or non-attachable attach point + (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attach on object == "Take" + { + return FALSE; + } + } +// [/RLVa:KB] + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); for (LLObjectSelection::root_iterator iter = selection->root_begin(); iter != selection->root_end(); iter++) @@ -6710,9 +6997,12 @@ BOOL object_selected_and_point_valid() } +// [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.2.0a) | Added: RLVa-1.2.0a +/* BOOL object_is_wearable() { - if (!object_selected_and_point_valid()) +// if (!object_selected_and_point_valid()) + if (!object_selected_and_point_valid(LLSD(0))) { return FALSE; } @@ -6732,7 +7022,8 @@ BOOL object_is_wearable() } return FALSE; } - +*/ +// [/RLVa:KB] class LLAttachmentPointFilled : public view_listener_t { @@ -6742,7 +7033,12 @@ class LLAttachmentPointFilled : public view_listener_t LLVOAvatar::attachment_map_t::iterator found_it = gAgentAvatarp->mAttachmentPoints.find(user_data.asInteger()); if (found_it != gAgentAvatarp->mAttachmentPoints.end()) { - enable = found_it->second->getNumObjects() > 0; +// enable = found_it->second->getNumObjects() > 0; +// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.0a) | Added: RLVa-1.2.0a + // Enable the option if there is at least one attachment on this attachment point that can be detached + enable = (found_it->second->getNumObjects() > 0) && + ((!rlv_handler_t::isEnabled()) || (gRlvAttachmentLocks.canDetach(found_it->second))); +// [/RLVa:KB] } return enable; } @@ -6753,7 +7049,10 @@ class LLAvatarSendIM : public view_listener_t bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); - if(avatar) +// if(avatar) +// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d + if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [/RLVa:KB] { LLAvatarActions::startIM(avatar->getID()); } @@ -6766,7 +7065,10 @@ class LLAvatarCall : public view_listener_t bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); - if(avatar) +// if(avatar) +// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d + if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [/RLVa:KB] { LLAvatarActions::startCall(avatar->getID()); } @@ -6774,6 +7076,13 @@ class LLAvatarCall : public view_listener_t } }; +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b +bool enable_avatar_call() +{ + return (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (LLAvatarActions::canCall()); +} +// [/RLVa:KB] + namespace { struct QueueObjects : public LLSelectedObjectFunctor @@ -6836,6 +7145,17 @@ class LLToolsSelectedScriptAction : public view_listener_t { bool handleEvent(const LLSD& userdata) { +// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.0.5a + // We'll allow resetting the scripts of objects on a non-attachable attach point since they wouldn't be able to circumvent anything + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_REMOVE)) ) + { + LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach f; + if ( (hSel->isAttachment()) && (hSel->getFirstNode(&f) != NULL) ) + return true; + } +// [/RLVa:KB] + std::string action = userdata.asString(); bool mono = false; std::string msg, name; @@ -6943,12 +7263,30 @@ void handle_selected_texture_info(void*) void handle_test_male(void*) { +// [RLVa:KB] - Checked: 2010-03-19 (RLVa-1.2.0c) | Modified: RLVa-1.2.0a + // TODO-RLVa: [RLVa-1.2.1] Is there any reason to still block this? + if ( (rlv_handler_t::isEnabled()) && + ((gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) || (gRlvWearableLocks.hasLockedWearableType(RLV_LOCK_ANY))) ) + { + return; + } +// [/RLVa:KB] + LLAppearanceMgr::instance().wearOutfitByName("Male Shape & Outfit"); //gGestureList.requestResetFromServer( TRUE ); } void handle_test_female(void*) { +// [RLVa:KB] - Checked: 2010-03-19 (RLVa-1.2.0c) | Modified: RLVa-1.2.0a + // TODO-RLVa: [RLVa-1.2.1] Is there any reason to still block this? + if ( (rlv_handler_t::isEnabled()) && + ((gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) || (gRlvWearableLocks.hasLockedWearableType(RLV_LOCK_ANY))) ) + { + return; + } +// [/RLVa:KB] + LLAppearanceMgr::instance().wearOutfitByName("Female Shape & Outfit"); //gGestureList.requestResetFromServer( FALSE ); } @@ -7097,6 +7435,22 @@ class LLSomethingSelectedNoHUD : public view_listener_t static bool is_editable_selected() { +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a + // RELEASE-RLVa: [SL-2.2.0] Check that this still isn't called by anything but script actions in the Build menu + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_REMOVE)) ) + { + LLObjectSelectionHandle hSelection = 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 f; + if ( (hSelection->isAttachment()) && (hSelection->getFirstRootNode(&f)) ) + { + return false; + } + } +// [/RLVa:KB] + return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); } @@ -7141,7 +7495,11 @@ bool enable_object_take_copy() { virtual bool apply(LLViewerObject* obj) { - return (!obj->permCopy() || obj->isAttachment()); +// return (!obj->permCopy() || obj->isAttachment()); +// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.0g + return (!obj->permCopy() || obj->isAttachment()) || + ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (isAgentAvatarValid()) && (gAgentAvatarp->getRoot() == obj) ); +// [/RLVa:KB] } } func; const bool firstonly = true; @@ -7246,7 +7604,10 @@ class LLWorldEnableCreateLandmark : public view_listener_t { bool handleEvent(const LLSD& userdata) { - return !LLLandmarkActions::landmarkAlreadyExists(); +// return !LLLandmarkActions::landmarkAlreadyExists(); +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.4.5) | Added: RLVa-1.2.1 + return (!LLLandmarkActions::landmarkAlreadyExists()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); +// [/RLVa:KB] } }; @@ -7267,6 +7628,10 @@ class LLWorldEnableTeleportHome : public view_listener_t LLViewerRegion* regionp = gAgent.getRegion(); bool agent_on_prelude = (regionp && regionp->isPrelude()); bool enable_teleport_home = gAgent.isGodlike() || !agent_on_prelude; +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f + enable_teleport_home &= + (!rlv_handler_t::isEnabled()) || ((!gRlvHandler.hasBehaviour(RLV_BHVR_TPLM)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC))); +// [/RLVa:KB] return enable_teleport_home; } }; @@ -7703,7 +8068,10 @@ class LLViewHighlightTransparent : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; +// LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; +// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + LLDrawPoolAlpha::sShowDebugAlpha = (!LLDrawPoolAlpha::sShowDebugAlpha) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)); +// [/RLVa:KB] return true; } }; @@ -7899,6 +8267,11 @@ class LLViewShowHUDAttachments : public view_listener_t { bool handleEvent(const LLSD& userdata) { +// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.1a) | Modified: RLVa-1.0.0c + if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedHUD()) && (LLPipeline::sShowHUDAttachments) ) + return true; +// [/RLVa:KB] + LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; return true; } @@ -7919,8 +8292,15 @@ class LLEditEnableTakeOff : public view_listener_t { std::string clothing = userdata.asString(); LLWearableType::EType type = LLWearableType::typeNameToType(clothing); - if (type >= LLWearableType::WT_SHAPE && type < LLWearableType::WT_COUNT) +// if (type >= LLWearableType::WT_SHAPE && type < LLWearableType::WT_COUNT) +// [RLVa:KB] - Checked: 2010-03-20 (RLVa-1.2.0c) | Modified: RLVa-1.2.0a + // NOTE: see below - enable if there is at least one wearable on this type that can be removed + if ( (type >= LLWearableType::WT_SHAPE && type < LLWearableType::WT_COUNT) && + ((!rlv_handler_t::isEnabled()) || (gRlvWearableLocks.canRemove(type))) ) +// [/RLVa:KB] + { return LLAgentWearables::selfHasWearable(type); + } return false; } }; @@ -7941,6 +8321,22 @@ class LLEditTakeOff : public view_listener_t { // MULTI-WEARABLES: assuming user wanted to remove top shirt. U32 wearable_index = gAgentWearables.getWearableCount(type) - 1; + +// [RLVa:KB] - Checked: 2010-06-09 (RLVa-1.2.0g) | Added: RLVa-1.2.0g + if ( (rlv_handler_t::isEnabled()) && (gRlvWearableLocks.hasLockedWearable(type)) ) + { + // We'll use the first wearable we come across that can be removed (moving from top to bottom) + for (; wearable_index >= 0; wearable_index--) + { + const LLViewerWearable* pWearable = gAgentWearables.getViewerWearable(type, wearable_index); + if (!gRlvWearableLocks.isLockedWearable(pWearable)) + break; + } + if (wearable_index < 0) + return true; // No wearable found that can be removed + } +// [/RLVa:KB] + LLUUID item_id = gAgentWearables.getWearableItemID(type,wearable_index); LLAppearanceMgr::instance().removeItemFromAvatar(item_id); } @@ -7984,6 +8380,11 @@ class LLWorldEnvSettings : public view_listener_t { bool handleEvent(const LLSD& userdata) { +// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-1.0.0g + if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) + return true; +// [/RLVa:KB] + std::string tod = userdata.asString(); if (tod == "editor") @@ -8008,6 +8409,12 @@ class LLWorldEnvSettings : public view_listener_t { LLEnvManagerNew::instance().setUseSkyPreset("Midnight"); } +// [RLVa:KB] - Checked: 2011-09-03 (RLVa-1.4.1a) | Added: RLVa-1.4.1a + else if ("default" == tod) + { + LLEnvManagerNew::instance().setUseRegionSettings(true); + } +// [/RLVa:KB] else { LLEnvManagerNew &envmgr = LLEnvManagerNew::instance(); @@ -8204,6 +8611,9 @@ void show_topinfobar_context_menu(LLView* ctrl, S32 x, S32 y) { landmark_item->setLabel(LLTrans::getString("EditLandmarkNavBarMenu")); } +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + landmark_item->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); +// [/RLVa:KB] if(gMenuHolder->hasVisibleMenu()) { @@ -8346,6 +8756,9 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldSetBusy(), "World.SetBusy"); view_listener_t::addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark"); +// [RLVa:KB] + enable.add("World.EnablePlaceProfile", boost::bind(&enable_place_profile)); +// [/RLVa:KB] view_listener_t::addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation"); view_listener_t::addMenu(new LLWorldEnableTeleportHome(), "World.EnableTeleportHome"); view_listener_t::addMenu(new LLWorldEnableBuyLand(), "World.EnableBuyLand"); @@ -8604,7 +9017,10 @@ void initialize_menus() commit.add("Avatar.ShowInspector", boost::bind(&handle_avatar_show_inspector)); view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call"); - enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall)); +// enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall)); +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b + enable.add("Avatar.EnableCall", boost::bind(&enable_avatar_call)); +// [/RLVa:KB] view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile"); enable.add("Avatar.IsMyProfileOpen", boost::bind(&my_profile_visible)); @@ -8637,7 +9053,10 @@ void initialize_menus() enable.add("Object.EnableOpen", boost::bind(&enable_object_open)); enable.add("Object.EnableTouch", boost::bind(&enable_object_touch, _1)); enable.add("Object.EnableDelete", boost::bind(&enable_object_delete)); - enable.add("Object.EnableWear", boost::bind(&object_selected_and_point_valid)); +// enable.add("Object.EnableWear", boost::bind(&object_selected_and_point_valid)); +// [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.2.0a) | Added: RLVa-1.2.0a + enable.add("Object.EnableWear", boost::bind(&object_selected_and_point_valid, _2)); +// [/RLVa:KB] enable.add("Object.EnableStandUp", boost::bind(&enable_object_stand_up)); enable.add("Object.EnableSit", boost::bind(&enable_object_sit, _1)); @@ -8702,4 +9121,13 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected"); view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); + +// [RLVa:KB] - Checked: 2010-04-23 (RLVa-1.2.0g) | Added: RLVa-1.2.0 + commit.add("RLV.ToggleEnabled", boost::bind(&rlvMenuToggleEnabled)); + enable.add("RLV.CheckEnabled", boost::bind(&rlvMenuCheckEnabled)); + if (rlv_handler_t::isEnabled()) + { + enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2)); + } +// [/RLVa:KB] } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 5631e971cd..71dcc4fd58 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -109,6 +109,11 @@ #include "llpanelblockedlist.h" #include "llpanelplaceprofile.h" #include "llviewerregion.h" +// [RLVa:KB] - Checked: 2010-03-09 (RLVa-1.2.0a) +#include "rlvhandler.h" +#include "rlvinventory.h" +#include "rlvui.h" +// [/RLVa:KB] #include // #include @@ -1441,7 +1446,15 @@ void LLOfferInfo::send_auto_receive_response(void) if(IM_INVENTORY_OFFERED == mIM) { // add buddy to recent people list - LLRecentPeople::instance().add(mFromID); +// LLRecentPeople::instance().add(mFromID); +// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0f + // RELEASE-RLVa: [RLVa-1.2.2] Make sure this stays in sync with the condition in inventory_offer_handler() + if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (!RlvUtil::isNearbyAgent(mFromID)) || + (RlvUIEnabler::hasOpenIM(mFromID)) || ((RlvUIEnabler::hasOpenProfile(mFromID))) ) + { + LLRecentPeople::instance().add(mFromID); + } +// [/RLVa:KB] } } @@ -1512,6 +1525,19 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // This is an offer from an agent. In this case, the back // end has already copied the items into your inventory, // so we can fetch it out of our inventory. +// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.2.0e) | Modified: RLVa-1.2.0e + if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getForbidGiveToRLV()) && (LLAssetType::AT_CATEGORY == mType) && + (RlvInventory::instance().getSharedRoot()) && (mDesc.find(RLV_PUTINV_PREFIX) == 0) ) + { + RlvGiveToRLVAgentOffer* pOfferObserver = new RlvGiveToRLVAgentOffer(mObjectID); + pOfferObserver->startFetch(); + if (pOfferObserver->isFinished()) + pOfferObserver->done(); + else + gInventory.addObserver(pOfferObserver); + } +// [/RLVa:KB] + if (gSavedSettings.getBOOL("ShowOfferedInventory")) { LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(mObjectID, from_string); @@ -1681,6 +1707,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const } else { +/* std::string full_name; if (gCacheName->getFullName(mFromID, full_name)) { @@ -1694,6 +1721,20 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const + mFromName + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedByUnknownUser"); chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownUser"); } +*/ +// [SL:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + std::string name_slurl = LLSLURL("agent", mFromID, "about").getSLURLString(); + +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + // RELEASE-RLVa: [RLVa-1.2.2] Make sure this stays in sync with the condition in inventory_offer_handler() + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(mFromID)) ) + name_slurl = LLSLURL("agent", mFromID, "rlvanonym").getSLURLString(); +// [/RLVa:KB] + + from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName + + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + name_slurl; + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + name_slurl; +// [/SL:KB] } } else @@ -1703,12 +1744,40 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const bool busy = gAgent.getBusy(); +// [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1e) | Added: RLVa-1.2.1e + bool fRlvNotifyAccepted = false; +// [/RLVa:KB] switch(button) { case IOR_ACCEPT: // ACCEPT. The math for the dialog works, because the accept // for inventory_offered, task_inventory_offer or // group_notice_inventory is 1 greater than the offer integer value. + +// [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1e) | Modified: RLVa-1.2.1e + // Only change the inventory offer's destination folder to the shared root if: + // - the user has enabled the feature + // - the inventory offer came from a script (and specifies a folder) + // - the name starts with the prefix - mDesc format: '[OBJECTNAME]' ( http://slurl.com/... ) + if ( (rlv_handler_t::isEnabled()) && + (IM_TASK_INVENTORY_OFFERED == mIM) && (LLAssetType::AT_CATEGORY == mType) && (mDesc.find(RLV_PUTINV_PREFIX) == 1) ) + { + fRlvNotifyAccepted = true; + if (!RlvSettings::getForbidGiveToRLV()) + { + const LLViewerInventoryCategory* pRlvRoot = RlvInventory::instance().getSharedRoot(); + if (pRlvRoot) + { + fRlvNotifyAccepted = false; // "accepted_in_rlv" is sent from RlvGiveToRLVTaskOffer *after* we have the folder + mFolderID = pRlvRoot->getUUID(); + + RlvGiveToRLVTaskOffer* pOfferObserver = new RlvGiveToRLVTaskOffer(mTransactionID); + gInventory.addObserver(pOfferObserver); + } + } + } +// [/RLVa:KB] + // Generates IM_INVENTORY_ACCEPTED, IM_TASK_INVENTORY_ACCEPTED, // or IM_GROUP_NOTICE_INVENTORY_ACCEPTED msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 1)); @@ -1717,6 +1786,15 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const // send the message msg->sendReliable(mHost); +// [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1e) | Added: RLVa-1.2.1e + if (fRlvNotifyAccepted) + { + std::string::size_type idxToken = mDesc.find("' ( http://"); + if (std::string::npos != idxToken) + RlvBehaviourNotifyHandler::sendNotification("accepted_in_inv inv_offer " + mDesc.substr(1, idxToken - 1)); + } +// [/RLVa:KB] + //don't spam them if they are getting flooded if (check_offer_throttle(mFromName, true)) { @@ -1761,6 +1839,16 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const msg->addBinaryDataFast(_PREHASH_BinaryBucket, EMPTY_BINARY_BUCKET, EMPTY_BINARY_BUCKET_SIZE); // send the message msg->sendReliable(mHost); + +// [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1e) | Added: RLVa-1.2.1e + if ( (rlv_handler_t::isEnabled()) && + (IM_TASK_INVENTORY_OFFERED == mIM) && (LLAssetType::AT_CATEGORY == mType) && (mDesc.find(RLV_PUTINV_PREFIX) == 1) ) + { + std::string::size_type idxToken = mDesc.find("' ( http://"); + if (std::string::npos != idxToken) + RlvBehaviourNotifyHandler::sendNotification("declined inv_offer " + mDesc.substr(1, idxToken - 1)); + } +// [/RLVa:KB] if (gSavedSettings.getBOOL("LogInventoryDecline")) { @@ -1769,6 +1857,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const log_message_args["NAME"] = mFromName; log_message = LLTrans::getString("InvOfferDecline", log_message_args); + LLSD args; args["MESSAGE"] = log_message; LLNotificationsUtil::add("SystemMessageTip", args); @@ -1896,6 +1985,9 @@ void inventory_offer_handler(LLOfferInfo* info) } else { +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a + args["NAME_LABEL"] = LLSLURL("agent", info->mFromID, "completename").getSLURLString(); +// [/SL:KB] args["NAME_SLURL"] = LLSLURL("agent", info->mFromID, "about").getSLURLString(); } std::string verb = "select?name=" + LLURI::escape(msg); @@ -1906,6 +1998,15 @@ void inventory_offer_handler(LLOfferInfo* info) // Object -> Agent Inventory Offer if (info->mFromObject) { +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + // Only filter if the object owner is a nearby agent + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) ) + { + payload["rlv_shownames"] = TRUE; + args["NAME_SLURL"] = LLSLURL("agent", info->mFromID, "rlvanonym").getSLURLString(); + } +// [/RLVa:KB] + // Inventory Slurls don't currently work for non agent transfers, so only display the object name. args["ITEM_SLURL"] = msg; // Note: sets inventory_task_offer_callback as the callback @@ -1920,6 +2021,17 @@ void inventory_offer_handler(LLOfferInfo* info) } else // Agent -> Agent Inventory Offer { +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + // Only filter if the offer is from a nearby agent and if there's no open IM session (doesn't necessarily have to be focused) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) && + (!RlvUIEnabler::hasOpenIM(info->mFromID)) ) + { + payload["rlv_shownames"] = TRUE; + args["NAME"] = RlvStrings::getAnonym(info->mFromName); + args["NAME_SLURL"] = LLSLURL("agent", info->mFromID, "rlvanonym").getSLURLString(); + } +// [/RLVa:KB] + p.responder = info; // Note: sets inventory_offer_callback as the callback // *TODO fix memory leak @@ -2346,7 +2458,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // do nothing -- don't distract newbies in // Prelude with global IMs } - else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) +// [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a + else if ( (rlv_handler_t::isEnabled()) && (offline == IM_ONLINE) && ("@version" == message) && + (!is_muted) && ((!accept_im_from_only_friend) || (is_friend)) ) + { + RlvUtil::sendBusyMessage(from_id, RlvStrings::getVersion(), session_id); + } +// [/RLVa:KB] +// else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) +// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) && (gRlvHandler.canReceiveIM(from_id)) ) +// [/RLVa:KB] { // return a standard "busy" message, but only do it to online IM // (i.e. not other auto responses and not store-and-forward IM) @@ -2405,6 +2527,22 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) else { // standard message, not from system + bool mute_im = is_muted; + if(accept_im_from_only_friend&&!is_friend) + { + mute_im = true; + } + +// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + // Don't block offline IMs, or IMs from Lindens + if ( (rlv_handler_t::isEnabled()) && (offline != IM_OFFLINE) && (!is_linden) && (!gRlvHandler.canReceiveIM(from_id)) ) + { + if (!mute_im) + RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM_REMOTE), session_id); + message = RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM); + } +// [/RLVa:KB] + std::string saved; if(offline == IM_OFFLINE) { @@ -2416,6 +2554,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; +/* bool mute_im = is_muted; if (accept_im_from_only_friend && !is_friend) { @@ -2428,6 +2567,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) mute_im = true; } +*/ if (!mute_im || is_linden) { gIMMgr->addMessage( @@ -2714,7 +2854,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_INVENTORY_ACCEPTED: { - args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();; +// args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();; +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + // Only anonymize the name if the agent is nearby, there isn't an open IM session to them and their profile isn't open + bool fRlvFilterName = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(from_id)) && + (!RlvUIEnabler::hasOpenProfile(from_id)) && (!RlvUIEnabler::hasOpenIM(from_id)); + args["NAME"] = LLSLURL("agent", from_id, (!fRlvFilterName) ? "completename" : "rlvanonym").getSLURLString();; +// [/RLVa:KB] LLSD payload; payload["from_id"] = from_id; // Passing the "SESSION_NAME" to use it for IM notification logging @@ -2725,7 +2871,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } case IM_INVENTORY_DECLINED: { - args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();; +// args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();; +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + // Only anonymize the name if the agent is nearby, there isn't an open IM session to them and their profile isn't open + bool fRlvFilterName = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(from_id)) && + (!RlvUIEnabler::hasOpenProfile(from_id)) && (!RlvUIEnabler::hasOpenIM(from_id)); + args["NAME"] = LLSLURL("agent", from_id, (!fRlvFilterName) ? "completename" : "rlvanonym").getSLURLString();; +// [/RLVa:KB] LLSD payload; payload["from_id"] = from_id; LLNotificationsUtil::add("InventoryDeclined", args, payload); @@ -2753,11 +2905,36 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Only show messages if we have a session open (which // should happen after you get an "invitation" - if ( !gIMMgr->hasSession(session_id) ) +// if ( !gIMMgr->hasSession(session_id) ) +// { +// return; +// } +// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + LLIMModel::LLIMSession* pIMSession = LLIMModel::instance().findIMSession(session_id); + if (!pIMSession) { return; } + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIMFROM)) ) + { + switch (pIMSession->mSessionType) + { + case LLIMModel::LLIMSession::GROUP_SESSION: // Group chat + if ( (from_id != gAgent.getID()) && (!gRlvHandler.canReceiveIM(session_id)) ) + return; + break; + case LLIMModel::LLIMSession::ADHOC_SESSION: // Conference chat + if ( (from_id != gAgent.getID()) && (!gRlvHandler.canReceiveIM(from_id)) ) + message = RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM); + break; + default: + RLV_ASSERT(false); + return; + } + } +// [/RLVa:KB] + // standard message, not from system std::string saved; if(offline == IM_OFFLINE) @@ -2821,6 +2998,25 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLSD query_string; query_string["owner"] = from_id; +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + if (rlv_handler_t::isEnabled()) + { + // NOTE: the chat message itself will be filtered in LLNearbyChatHandler::processChat() + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) ) + { + query_string["rlv_shownames"] = TRUE; + + RlvUtil::filterNames(name); + chat.mFromName = name; + } + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + std::string::size_type idxPos = location.find('/'); + if ( (std::string::npos != idxPos) && (RlvUtil::isNearbyRegion(location.substr(0, idxPos))) ) + location = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); + } + } +// [/RLVa:KB] query_string["slurl"] = location; query_string["name"] = name; if (from_group) @@ -2828,7 +3024,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) query_string["groupowned"] = "true"; } - chat.mURL = LLSLURL("objectim", session_id, "").getSLURLString(); +// chat.mURL = LLSLURL("objectim", session_id, "").getSLURLString(); +// [SL:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + chat.mURL = LLSLURL("objectim", session_id, LLURI::mapToQueryString(query_string)).getSLURLString(); +// [/SL:KB] chat.mText = message; // Note: lie to Nearby Chat, pretending that this is NOT an IM, because @@ -2906,11 +3105,22 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_LURE_USER: { - if (is_muted) +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c + // If the lure sender is a specific @accepttp exception they will override muted and busy status + bool fRlvSummon = (rlv_handler_t::isEnabled()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id)); +// [/RLVa:KB] + +// if (is_muted) +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c + if ( (is_muted) && (!fRlvSummon) ) +// [/RLVa:KB] { return; } - else if (is_busy) +// else if (is_busy) +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c + else if ( (is_busy) && (!fRlvSummon) ) +// [/RLVa:KB] { busy_message(msg,from_id); } @@ -2968,8 +3178,30 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } } +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c + if (rlv_handler_t::isEnabled()) + { + if (!gRlvHandler.canTeleportViaLure(from_id)) + { + RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_TPLURE_REMOTE)); + if (is_busy) + busy_message(msg,from_id); + return; + } + + // Censor lure message if: 1) restricted from receiving IMs from the sender, or 2) @showloc=n restricted + if ( (!gRlvHandler.canReceiveIM(from_id)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + message = RlvStrings::getString(RLV_STRING_HIDDEN); + } + } +// [/RLVa:KB] + LLSD args; // *TODO: Translate -> [FIRST] [LAST] (maybe) +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a + args["NAME_LABEL"] = LLSLURL("agent", from_id, "completename").getSLURLString(); +// [/SL:KB] args["NAME_SLURL"] = LLSLURL("agent", from_id, "about").getSLURLString(); args["MESSAGE"] = message; args["MATURITY_STR"] = region_access_str; @@ -2999,11 +3231,25 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { - LLNotification::Params params("TeleportOffered"); - params.substitutions = args; - params.payload = payload; - LLPostponedNotification::add( params, from_id, false); - } + LLNotification::Params params("TeleportOffered"); + params.substitutions = args; + params.payload = payload; + +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP)) || (fRlvSummon)) ) + { + gRlvHandler.setCanCancelTp(false); + if (is_busy) + busy_message(msg,from_id); + LLNotifications::instance().forceResponse(LLNotification::Params("TeleportOffered").payload(payload), 0); + } + else + { + LLPostponedNotification::add( params, from_id, false); + } +// [/RLVa:KB] +// LLPostponedNotification::add( params, from_id, false); + } } } @@ -3144,6 +3390,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { +// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a + args["NAME_LABEL"] = LLSLURL("agent", from_id, "completename").getSLURLString(); +// [/SL:KB] args["NAME_SLURL"] = LLSLURL("agent", from_id, "about").getSLURLString(); if(message.empty()) { @@ -3439,9 +3688,14 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) chat.mPosAgent = chatter->getPositionAgent(); // Make swirly things only for talking objects. (not script debug messages, though) - if (chat.mSourceType == CHAT_SOURCE_OBJECT - && chat.mChatType != CHAT_TYPE_DEBUG_MSG - && gSavedSettings.getBOOL("EffectScriptChatParticles") ) +// if (chat.mSourceType == CHAT_SOURCE_OBJECT +// && chat.mChatType != CHAT_TYPE_DEBUG_MSG +// && gSavedSettings.getBOOL("EffectScriptChatParticles") ) +// [RLVa:KB] - Checked: 2010-03-09 (RLVa-1.2.0b) | Modified: RLVa-1.0.0g + if ( ((chat.mSourceType == CHAT_SOURCE_OBJECT) && (chat.mChatType != CHAT_TYPE_DEBUG_MSG)) && + (gSavedSettings.getBOOL("EffectScriptChatParticles")) && + ((!rlv_handler_t::isEnabled()) || (CHAT_TYPE_OWNER != chat.mChatType)) ) +// [/RLVa:KB] { LLPointer psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); psc->setSourceObject(chatter); @@ -3471,6 +3725,75 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) color.setVec(1.f,1.f,1.f,1.f); msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); +// [RLVa:KB] - Checked: 2010-04-23 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f + if ( (rlv_handler_t::isEnabled()) && (CHAT_TYPE_START != chat.mChatType) && (CHAT_TYPE_STOP != chat.mChatType) ) + { + // NOTE: chatter can be NULL (may not have rezzed yet, or could be another avie's HUD attachment) + BOOL is_attachment = (chatter) ? chatter->isAttachment() : FALSE; + BOOL is_owned_by_me = (chatter) ? chatter->permYouOwner() : FALSE; + + // Filtering "rules": + // avatar => filter all avie text (unless it's this avie or they're an exemption) + // objects => filter everything except attachments this avie owns (never filter llOwnerSay chat) + if ( ( (CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID()) ) || + ( (CHAT_SOURCE_OBJECT == chat.mSourceType) && ((!is_owned_by_me) || (!is_attachment)) && + (CHAT_TYPE_OWNER != chat.mChatType) ) ) + { + bool fIsEmote = RlvUtil::isEmote(mesg); + if ((!fIsEmote) && + (((gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id))) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHATFROM)) && (gRlvHandler.isException(RLV_BHVR_RECVCHATFROM, from_id))) )) + { + if ( (gRlvHandler.filterChat(mesg, false)) && (!gSavedSettings.getBOOL("RestrainedLoveShowEllipsis")) ) + return; + } + else if ((fIsEmote) && + (((gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id))) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTEFROM)) && (gRlvHandler.isException(RLV_BHVR_RECVEMOTEFROM, from_id))) )) + { + if (!gSavedSettings.getBOOL("RestrainedLoveShowEllipsis")) + return; + mesg = "/me ..."; + } + } + + // Filtering "rules": + // avatar => filter only their name (unless it's this avie) + // other => filter everything + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + if (CHAT_SOURCE_AGENT != chat.mSourceType) + { + RlvUtil::filterNames(chat.mFromName); + } + else if (chat.mFromID != gAgent.getID()) + { + chat.mFromName = RlvStrings::getAnonym(chat.mFromName); + chat.mRlvNamesFiltered = TRUE; + } + } + + // Create an "objectim" URL for objects if we're either @shownames or @showloc restricted + // (we need to do this now because we won't be have enough information to do it later on) + if ( (CHAT_SOURCE_OBJECT == chat.mSourceType) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))) ) + { + LLSD sdQuery; + sdQuery["name"] = chat.mFromName; + sdQuery["owner"] = owner_id; + + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!is_owned_by_me) ) + sdQuery["rlv_shownames"] = true; + + const LLViewerRegion* pRegion = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent); + if (pRegion) + sdQuery["slurl"] = LLSLURL(pRegion->getName(), chat.mPosAgent).getLocationString(); + + chat.mURL = LLSLURL("objectim", from_id, LLURI::mapToQueryString(sdQuery)).getSLURLString(); + } + } +// [/RLVa:KB] + BOOL ircstyle = FALSE; // Look for IRC-style emotes here so chatbubbles work @@ -3521,8 +3844,99 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) case CHAT_TYPE_WHISPER: chat.mText = LLTrans::getString("whisper") + " "; break; - case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_OWNER: +// [RLVa:KB] - Checked: 2010-02-XX (RLVa-1.2.0a) | Modified: RLVa-1.1.0f + // TODO-RLVa: [RLVa-1.2.0] consider rewriting this before a RLVa-1.2.0 release + if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) && (CHAT_TYPE_OWNER == chat.mChatType) ) + { + mesg.erase(0, 1); + LLStringUtil::toLower(mesg); + + std::string strExecuted, strFailed, strRetained, *pstr; + + boost_tokenizer tokens(mesg, boost::char_separator(",", "", boost::drop_empty_tokens)); + for (boost_tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) + { + std::string strCmd = *itToken; + + ERlvCmdRet eRet = gRlvHandler.processCommand(from_id, strCmd, true); + if ( (RlvSettings::getDebug()) && + ( (!RlvSettings::getDebugHideUnsetDup()) || + ((RLV_RET_SUCCESS_UNSET != eRet) && (RLV_RET_SUCCESS_DUPLICATE != eRet)) ) ) + { + if ( RLV_RET_SUCCESS == (eRet & RLV_RET_SUCCESS) ) + pstr = &strExecuted; + else if ( RLV_RET_FAILED == (eRet & RLV_RET_FAILED) ) + pstr = &strFailed; + else if (RLV_RET_RETAINED == eRet) + pstr = &strRetained; + else + { + RLV_ASSERT(false); + pstr = &strFailed; + } + + const char* pstrSuffix = RlvStrings::getStringFromReturnCode(eRet); + if (pstrSuffix) + strCmd.append(" (").append(pstrSuffix).append(")"); + + if (!pstr->empty()) + pstr->push_back(','); + pstr->append(strCmd); + } + } + + if (RlvForceWear::instanceExists()) + RlvForceWear::instance().done(); + + if ( (!RlvSettings::getDebug()) || ((strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty())) ) + return; + + // Silly people want comprehensive debug messages, blah :p + if ( (!strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty()) ) + { + chat.mText = " executes: @"; + mesg = strExecuted; + } + else if ( (strExecuted.empty()) && (!strFailed.empty()) && (strRetained.empty()) ) + { + chat.mText = " failed: @"; + mesg = strFailed; + } + else if ( (strExecuted.empty()) && (strFailed.empty()) && (!strRetained.empty()) ) + { + chat.mText = " retained: @"; + mesg = strRetained; + } + else + { + chat.mText = ": @"; + if (!strExecuted.empty()) + mesg += "\n - executed: @" + strExecuted; + if (!strFailed.empty()) + mesg += "\n - failed: @" + strFailed; + if (!strRetained.empty()) + mesg += "\n - retained: @" + strRetained; + } + + break; + } +// [/RLVa:KB] +// [RLVa:KB] - Checked: 2010-03-09 (RLVa-1.2.0b) | Modified: RLVa-1.0.0g + // Copy/paste from above + if ( (rlv_handler_t::isEnabled()) && (chatter) && (chat.mSourceType == CHAT_SOURCE_OBJECT) && + (gSavedSettings.getBOOL("EffectScriptChatParticles")) ) + { + LLPointer psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); + psc->setSourceObject(chatter); + psc->setColor(color); + //We set the particles to be owned by the object's owner, + //just in case they should be muted by the mute list + psc->setOwnerUUID(owner_id); + LLViewerPartSim::getInstance()->addPartSource(psc); + } +// [/RLVa:KB] + case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_NORMAL: case CHAT_TYPE_DIRECT: break; @@ -3621,7 +4035,10 @@ void process_teleport_start(LLMessageSystem *msg, void**) // *NOTE: The server sends two StartTeleport packets when you are teleporting to a LM LLViewerMessage::getInstance()->mTeleportStartedSignal(); - if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) +// if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) +// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Added: RLVa-0.2.0b + if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) ) +// [/RLVa:KB] { gViewerWindow->setProgressCancelButtonVisible(FALSE); } @@ -3663,7 +4080,10 @@ void process_teleport_progress(LLMessageSystem* msg, void**) } U32 teleport_flags = 0x0; msg->getU32("Info", "TeleportFlags", teleport_flags); - if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) +// if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) +// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Added: RLVa-0.2.0b + if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) ) +// [/RLVa:KB] { gViewerWindow->setProgressCancelButtonVisible(FALSE); } @@ -4102,7 +4522,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) } // send walk-vs-run status - gAgent.sendWalkRun(gAgent.getRunning() || gAgent.getAlwaysRun()); +// gAgent.sendWalkRun(gAgent.getRunning() || gAgent.getAlwaysRun()); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + gAgent.sendWalkRun(); +// [/RLVa:KB] // If the server version has changed, display an info box and offer // to display the release notes, unless this is the initial log in. @@ -5989,6 +6412,15 @@ void process_alert_core(const std::string& message, BOOL modal) else { std::string new_msg =LLNotifications::instance().getGlobalString(text); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (new_msg == text) && (rlv_handler_t::isEnabled()) ) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + RlvUtil::filterLocation(new_msg); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + RlvUtil::filterNames(new_msg); + } +// [/RLVa:KB] args["MESSAGE"] = new_msg; LLNotificationsUtil::add("SystemMessage", args); } @@ -5997,6 +6429,15 @@ void process_alert_core(const std::string& message, BOOL modal) { LLSD args; std::string new_msg =LLNotifications::instance().getGlobalString(message); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (new_msg == message) && (rlv_handler_t::isEnabled()) ) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + RlvUtil::filterLocation(new_msg); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + RlvUtil::filterNames(new_msg); + } +// [/RLVa:KB] args["ERROR_MESSAGE"] = new_msg; LLNotificationsUtil::add("ErrorMessage", args); } @@ -6012,6 +6453,16 @@ void process_alert_core(const std::string& message, BOOL modal) std::string localized_msg; bool is_message_localized = LLTrans::findString(localized_msg, new_msg); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (new_msg == message) && (rlv_handler_t::isEnabled()) ) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + RlvUtil::filterLocation(new_msg); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + RlvUtil::filterNames(new_msg); + } +// [/RLVa:KB] + args["MESSAGE"] = is_message_localized ? localized_msg : new_msg; LLNotificationsUtil::add("SystemMessageTip", args); } @@ -6167,7 +6618,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp if (viewregion) { // got the region, so include the region and 3d coordinates of the object - notice.setArg("[REGIONNAME]", viewregion->getName()); + notice.setArg("[REGIONNAME]", viewregion->getName()); std::string formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]); notice.setArg("[REGIONPOS]", formatpos); @@ -6175,7 +6626,15 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp } } - if (!foundpos) +// [RLVa:KB] - Checked: 2010-04-23 (RLVa-1.2.0g) | Modified: RLVa-1.0.0a + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + notice.setArg("[REGIONNAME]", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); + notice.setArg("[REGIONPOS]", RlvStrings::getString(RLV_STRING_HIDDEN)); + } + else if (!foundpos) +// [/RLVa:KB] +// if (!foundpos) { // unable to determine location of the object notice.setArg("[REGIONNAME]", "(unknown region)"); @@ -6189,7 +6648,11 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp std::string perms; for (S32 i = 0; i < SCRIPT_PERMISSION_EOF; i++) { - if ((orig_questions & LSCRIPTRunTimePermissionBits[i]) && SCRIPT_QUESTION_IS_CAUTION[i]) +// if ((orig_questions & LSCRIPTRunTimePermissionBits[i]) && SCRIPT_QUESTION_IS_CAUTION[i]) +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + if ( (orig_questions & LSCRIPTRunTimePermissionBits[i]) && + ((SCRIPT_QUESTION_IS_CAUTION[i]) || (notification["payload"]["rlv_notify"].asBoolean())) ) +// [/RLVa:KB] { count++; caution = TRUE; @@ -6209,11 +6672,25 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp // log a chat message as long as at least one requested permission // is a caution permission +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) if (caution) { - LLChat chat(notice.getString()); - // LLFloaterChat::addChat(chat, FALSE, FALSE); + LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); + if(nearby_chat) + { + LLChat chat_msg(notice.getString()); + chat_msg.mFromName = SYSTEM_FROM; + chat_msg.mFromID = LLUUID::null; + chat_msg.mSourceType = CHAT_SOURCE_SYSTEM; + nearby_chat->addMessage(chat_msg); + } } +// [/RLVa:KB] +// if (caution) +// { +// LLChat chat(notice.getString()); +// // LLFloaterChat::addChat(chat, FALSE, FALSE); +// } } } @@ -6259,12 +6736,22 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) msg->sendReliable(LLHost(notification["payload"]["sender"].asString())); // only log a chat message if caution prompts are enabled - if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) +// if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + if ( (gSavedSettings.getBOOL("PermissionsCautionEnabled")) || (notification["payload"]["rlv_notify"].asBoolean()) ) +// [/RLVa:KB] { // log a chat message, if appropriate notify_cautioned_script_question(notification, response, orig, allowed); } +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + if ( (allowed) && (notification["payload"].has("rlv_blocked")) ) + { + RlvUtil::notifyBlocked(notification["payload"]["rlv_blocked"], LLSD().with("OBJECT", notification["payload"]["object_name"])); + } +// [/RLVa:KB] + if ( response["Mute"] ) // mute { LLMuteList::getInstance()->add(LLMute(item_id, notification["payload"]["object_name"].asString(), LLMute::OBJECT)); @@ -6387,8 +6874,39 @@ void process_script_question(LLMessageSystem *msg, void **user_data) payload["object_name"] = object_name; payload["owner_name"] = owner_name; +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + if (rlv_handler_t::isEnabled()) + { + RlvUtil::filterScriptQuestions(questions, payload); + + if ( (questions) && (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTPERMISSION)) ) + { + const LLViewerObject* pObj = gObjectList.findObject(taskid); + if (pObj) + { + if ( (pObj->permYouOwner()) && (!pObj->isAttachment()) ) + { + questions &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS] | + LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]); + } + else + { + questions &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS]); + } + payload["rlv_notify"] = !pObj->permYouOwner(); + } + } + } + + if ( (!caution) && (!questions) ) + { + LLNotifications::instance().forceResponse( + LLNotification::Params("ScriptQuestion").substitutions(args).payload(payload), 0/*YES*/); + } + else if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) +// [/RLVa:KB] // check whether cautions are even enabled or not - if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) +// if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) { if (caution) { @@ -6765,6 +7283,22 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response) if(0 == option) { +// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIMTO)) ) + { + // Filter the lure message if one of the recipients of the lure can't be sent an IM to + for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray(); + it != notification["payload"]["ids"].endArray(); ++it) + { + if (!gRlvHandler.canSendIM(it->asUUID())) + { + text = RlvStrings::getString(RLV_STRING_HIDDEN); + break; + } + } + } +// [/RLVa:KB] + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_StartLure); msg->nextBlockFast(_PREHASH_AgentData); @@ -6821,13 +7355,29 @@ void handle_lure(const uuid_vec_t& ids) if (!gAgent.getRegion()) return; LLSD edit_args; - edit_args["REGION"] = gAgent.getRegion()->getName(); +// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0a + edit_args["REGION"] = + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN); +// [/RLVa:KB] +// edit_args["REGION"] = gAgent.getRegion()->getName(); LLSD payload; for (LLDynamicArray::const_iterator it = ids.begin(); it != ids.end(); ++it) { +// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0a + // Only allow offering teleports if everyone is a @tplure exception or able to map this avie under @showloc=n + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(*it); + if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it, RLV_CHECK_PERMISSIVE)) && + ((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) ) + { + return; + } + } +// [/RLVa:KB] payload["ids"].append(*it); } if (gAgent.isGodlike()) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index c4b370a4b4..98ec71f1dc 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -100,6 +100,10 @@ #include "lltrans.h" #include "llsdutil.h" #include "llmediaentry.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] //#define DEBUG_UPDATE_TYPE @@ -525,6 +529,12 @@ bool LLViewerObject::isReturnable() return false; } +// [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Added: RLVa-1.4.0a + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn(this)) ) + { + return false; + } +// [/RLVa:KB] std::vector boxes; boxes.push_back(LLBBox(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f).getAxisAligned()); for (child_list_t::iterator iter = mChildList.begin(); @@ -742,7 +752,10 @@ void LLViewerObject::addThisAndNonJointChildren(std::vector& ob } } -BOOL LLViewerObject::isChild(LLViewerObject *childp) const +//BOOL LLViewerObject::isChild(LLViewerObject *childp) const +// [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Added: RLVa-1.4.0a +BOOL LLViewerObject::isChild(const LLViewerObject *childp) const +// [/RLVa:KB] { for (child_list_t::const_iterator iter = mChildList.begin(); iter != mChildList.end(); iter++) @@ -1231,6 +1244,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, coloru.mV[3] = 255 - coloru.mV[3]; mText->setColor(LLColor4(coloru)); mText->setString(temp_string); +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f + if (rlv_handler_t::isEnabled()) + { + mText->setObjectText(temp_string); + } +// [/RLVa:KB] setChanged(MOVED | SILHOUETTE); } @@ -1609,6 +1628,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, coloru.mV[3] = 255 - coloru.mV[3]; mText->setColor(LLColor4(coloru)); mText->setString(temp_string); +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f + if (rlv_handler_t::isEnabled()) + { + mText->setObjectText(temp_string); + } +// [/RLVa:KB] setChanged(TEXTURE); } @@ -1779,6 +1804,25 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, gObjectList.killObject(this); return retval; } +// [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.1.0k) | Added: RLVa-1.1.0k + if ( (rlv_handler_t::isEnabled()) && (sent_parentp->isAvatar()) && (sent_parentp->getID() == gAgent.getID()) ) + { + // Rezzed object that's being worn as an attachment (we're assuming this will be due to llAttachToAvatar()) + S32 idxAttachPt = ATTACHMENT_ID_FROM_STATE(getState()); + if (gRlvAttachmentLocks.isLockedAttachmentPoint(idxAttachPt, RLV_LOCK_ADD)) + { + // If this will end up on an "add locked" attachment point then treat the attach as a user action + LLNameValue* nvItem = getNVPair("AttachItemID"); + if (nvItem) + { + LLUUID idItem(nvItem->getString()); + // URGENT-RLVa: [RLVa-1.2.0] At the moment llAttachToAvatar always seems to *add* + if (idItem.notNull()) + RlvAttachmentLockWatchdog::instance().onWearAttachment(idItem, RLV_WEAR_ADD); + } + } + } +// [/RLVa:KB] sent_parentp->addChild(this); // make sure this object gets a non-damped update if (sent_parentp->mDrawable.notNull()) @@ -5202,7 +5246,10 @@ BOOL LLViewerObject::permTransfer() const // given you modify rights to. JC BOOL LLViewerObject::allowOpen() const { - return !flagInventoryEmpty() && (permYouOwner() || permModify()); +// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + return !flagInventoryEmpty() && (permYouOwner() || permModify()) && ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canEdit(this))); +// [/RLVa:KB] +// return !flagInventoryEmpty() && (permYouOwner() || permModify()); } LLViewerObject::LLInventoryCallbackInfo::~LLInventoryCallbackInfo() diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 728d279c39..e77beb5658 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -252,7 +252,10 @@ public: S32 numChildren() const { return mChildList.size(); } void addThisAndAllChildren(std::vector& objects); void addThisAndNonJointChildren(std::vector& objects); - BOOL isChild(LLViewerObject *childp) const; +// BOOL isChild(LLViewerObject *childp) const; +// [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Added: RLVa-1.4.0a + BOOL isChild(const LLViewerObject *childp) const; +// [/RLVa:KB] BOOL isSeat() const; @@ -346,7 +349,10 @@ public: void sendShapeUpdate(); - U8 getState() { return mState; } +// U8 getState() { return mState; } +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Added: RLVa-1.2.0a + U8 getState() const { return mState; } +// [/RLVa:KB] F32 getAppAngle() const { return mAppAngle; } F32 getPixelArea() const { return mPixelArea; } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index a98e9ce511..67f312869e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -203,6 +203,10 @@ #include "llviewerwindowlistener.h" #include "llpaneltopinfobar.h" +// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c) +#include "rlvhandler.h" +// [/RLVa:KB] + #if LL_WINDOWS #include // For Unicode conversion methods #endif @@ -3504,6 +3508,15 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, { moveable_object_selected = TRUE; this_object_movable = TRUE; + +// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c) | Modified: RLVa-0.2.0g + if ( (rlv_handler_t::isEnabled()) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) ) + { + if ((isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) && (gAgentAvatarp->getRoot() == object->getRootEdit())) + moveable_object_selected = this_object_movable = FALSE; + } +// [/RLVa:KB] } all_selected_objects_move = all_selected_objects_move && this_object_movable; all_selected_objects_modify = all_selected_objects_modify && object->permModify(); @@ -3776,6 +3789,13 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de found = gPipeline.lineSegmentIntersectInHUD(mouse_hud_start, mouse_hud_end, pick_transparent, face_hit, intersection, uv, normal, binormal); +// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c) | Modified: RLVa-1.2.0c + if ( (rlv_handler_t::isEnabled()) && (found) && + (LLToolCamera::getInstance()->hasMouseCapture()) && (gKeyboard->currentMask(TRUE) & MASK_ALT) ) + { + found = NULL; + } +// [/RLVa:KB] if (!found) // if not found in HUD, look in world: { found = gPipeline.lineSegmentIntersectInWorld(mouse_world_start, mouse_world_end, pick_transparent, @@ -3785,6 +3805,25 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de gDebugRaycastIntersection = *intersection; } } + +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l +#ifdef RLV_EXTENSION_CMD_INTERACT + if ( (rlv_handler_t::isEnabled()) && (found) && (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) ) + { + // Allow picking if: + // - the drag-and-drop tool is active (allows inventory offers) + // - the camera tool is active + // - the pie tool is active *and* we picked our own avie (allows "mouse steering" and the self pie menu) + LLTool* pCurTool = LLToolMgr::getInstance()->getCurrentTool(); + if ( (LLToolDragAndDrop::getInstance() != pCurTool) && + (!LLToolCamera::getInstance()->hasMouseCapture()) && + ((LLToolPie::getInstance() != pCurTool) || (gAgent.getID() != found->getID())) ) + { + found = NULL; + } +#endif // RLV_EXTENSION_CMD_INTERACT +// [/RLVa:KB] + } } return found; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 41c0d41d9f..6ed85d7041 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -92,6 +92,9 @@ #include "llanimstatelabels.h" #include "lltrans.h" #include "llappearancemgr.h" +// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) +#include "rlvhandler.h" +// [/RLVa:KB] #include "llgesturemgr.h" //needed to trigger the voice gesticulations #include "llvoiceclient.h" @@ -2437,12 +2440,18 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) const F32 time_visible = mTimeVisible.getElapsedTimeF32(); const F32 NAME_SHOW_TIME = gSavedSettings.getF32("RenderNameShowTime"); // seconds const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds +// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b + bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); +// [/RLVa:KB] BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping); BOOL render_name = visible_chat || - (visible_avatar && - ((sRenderName == RENDER_NAME_ALWAYS) || - (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); + (visible_avatar && +// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-1.0.0h + ( (!fRlvShowNames) || (RlvSettings::getShowNameTags()) ) && +// [/RLVa:KB] + ((sRenderName == RENDER_NAME_ALWAYS) || + (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); // If it's your own avatar, don't draw in mouselook, and don't // draw if we're specifically hiding our own name. if (isSelf()) @@ -2472,7 +2481,18 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) new_name = TRUE; } - if (sRenderGroupTitles != mRenderGroupTitles) +// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b + if (fRlvShowNames) + { + if (mRenderGroupTitles) + { + mRenderGroupTitles = FALSE; + new_name = TRUE; + } + } + else if (sRenderGroupTitles != mRenderGroupTitles) +// [/RLVa] +// if (sRenderGroupTitles != mRenderGroupTitles) { mRenderGroupTitles = sRenderGroupTitles; new_name = TRUE; @@ -2540,6 +2560,9 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) // Avatars must have a first and last name if (!firstname || !lastname) return; +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); +// [/RLVa:KB] bool is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end(); bool is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end(); bool is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); @@ -2552,7 +2575,10 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) { is_muted = LLMuteList::getInstance()->isMuted(getID()); } - bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); +// bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + bool is_friend = (!fRlvShowNames) && (LLAvatarTracker::instance().isBuddy(getID())); +// [/RLVa:KB] bool is_cloud = getIsCloud(); if (is_appearance != mNameAppearance) @@ -2617,7 +2643,10 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) LLFontGL::getFontSansSerifSmall()); } - if (sRenderGroupTitles +// if (sRenderGroupTitles +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + if (sRenderGroupTitles && !fRlvShowNames +// [/RLVa:KB] && title && title->getString() && title->getString()[0] != '\0') { std::string title_str = title->getString(); @@ -2640,26 +2669,43 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) boost::bind(&LLVOAvatar::clearNameTag, this)); } - // Might be blank if name not available yet, that's OK - if (show_display_names) +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + if ( (!fRlvShowNames) || (isSelf()) ) { - addNameTagLine(av_name.mDisplayName, name_tag_color, LLFontGL::NORMAL, +// [/RLVa:KB] + // Might be blank if name not available yet, that's OK + if (show_display_names) + { + addNameTagLine(av_name.mDisplayName, name_tag_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerif()); } - // Suppress SLID display if display name matches exactly (ugh) - if (show_usernames && !av_name.mIsDisplayNameDefault) + // Suppress SLID display if display name matches exactly (ugh) + if (show_usernames && !av_name.mIsDisplayNameDefault) { - // *HACK: Desaturate the color - LLColor4 username_color = name_tag_color * 0.83f; - addNameTagLine(av_name.mUsername, username_color, LLFontGL::NORMAL, + // *HACK: Desaturate the color + LLColor4 username_color = name_tag_color * 0.83f; + addNameTagLine(av_name.mUsername, username_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall()); + } +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a } + else + { + addNameTagLine(RlvStrings::getAnonym(av_name), name_tag_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerif()); + } +// [/RLVa:KB] } else { const LLFontGL* font = LLFontGL::getFontSansSerif(); std::string full_name = LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); +// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + if ( (fRlvShowNames) && (!isSelf()) ) + { + full_name = RlvStrings::getAnonym(full_name); + } +// [/RLVa:KB] addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, font); } @@ -5636,6 +5682,13 @@ void LLVOAvatar::sitDown(BOOL bSitting) { // Update Movement Controls according to own Sitting mode LLFloaterMove::setSittingMode(bSitting); + +// [RLVa:KB] - Checked: 2010-08-29 (RLVa-1.2.1c) | Modified: RLVa-1.2.1c + if (rlv_handler_t::isEnabled()) + { + gRlvHandler.onSitOrStand(bSitting); + } +// [/RLVa:KB] } } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index c069488a37..5b5136f381 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -63,6 +63,10 @@ #include "llsdutil.h" #include "llstartup.h" #include "llsdserialize.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] #if LL_MSVC // disable boost::lexical_cast warning @@ -156,6 +160,9 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) : LLVOAvatar(id, pcode, regionp), +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + mAttachmentSignal(NULL), +// [/RLVa:KB] mScreenp(NULL), mLastRegionHandle(0), mRegionCrossingCount(0), @@ -224,6 +231,10 @@ void LLVOAvatarSelf::initInstance() mInitialBakeIDs[i] = LLUUID::null; } +// [RLVa:KB] - Checked: 2010-12-12 (RLVa-1.2.2c) | Added: RLVa-1.2.2c + RlvAttachPtLookup::initLookupTable(); +// [/RLVa:KB] + status &= buildMenus(); if (!status) { @@ -385,6 +396,7 @@ BOOL LLVOAvatarSelf::buildMenus() item_params.name =(item_params.label ); item_params.on_click.function_name = "Object.AttachToAvatar"; item_params.on_click.parameter = iter->first; + // [RLVa:KB] - No changes, but we do need the parameter to always be idxAttachPt for object_selected_and_point_valid() item_params.on_enable.function_name = "Object.EnableWear"; item_params.on_enable.parameter = iter->first; LLMenuItemCallGL* item = LLUICtrlFactory::create(item_params); @@ -456,6 +468,7 @@ BOOL LLVOAvatarSelf::buildMenus() item_params.name =(item_params.label ); item_params.on_click.function_name = "Object.AttachToAvatar"; item_params.on_click.parameter = iter->first; + // [RLVa:KB] - No changes, but we do need the parameter to always be idxAttachPt for object_selected_and_point_valid() item_params.on_enable.function_name = "Object.EnableWear"; item_params.on_enable.parameter = iter->first; LLMenuItemCallGL* item = LLUICtrlFactory::create(item_params); @@ -499,6 +512,7 @@ BOOL LLVOAvatarSelf::buildMenus() item_params.name =(item_params.label ); item_params.on_click.function_name = "Object.AttachToAvatar"; item_params.on_click.parameter = iter->first; + // [RLVa:KB] - No changes, but we do need the parameter to always be idxAttachPt for object_selected_and_point_valid() item_params.on_enable.function_name = "Object.EnableWear"; item_params.on_enable.parameter = iter->first; //* TODO: Skinning: @@ -565,6 +579,7 @@ BOOL LLVOAvatarSelf::buildMenus() item_params.label = LLTrans::getString(attachment->getName()); item_params.on_click.function_name = "Object.AttachToAvatar"; item_params.on_click.parameter = attach_index; + // [RLVa:KB] - No changes, but we do need the parameter to always be idxAttachPt for object_selected_and_point_valid() item_params.on_enable.function_name = "Object.EnableWear"; item_params.on_enable.parameter = attach_index; @@ -594,6 +609,10 @@ void LLVOAvatarSelf::cleanup() LLVOAvatarSelf::~LLVOAvatarSelf() { cleanup(); + +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + delete mAttachmentSignal; +// [/RLVa:KB] } /** @@ -1156,6 +1175,28 @@ LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id) return NULL; } +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) +boost::signals2::connection LLVOAvatarSelf::setAttachmentCallback(const attachment_signal_t::slot_type& cb) +{ + if (!mAttachmentSignal) + mAttachmentSignal = new attachment_signal_t(); + return mAttachmentSignal->connect(cb); +} +// [/RLVa:KB] +// [RLVa:KB] - Checked: 2010-03-14 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a +LLViewerJointAttachment* LLVOAvatarSelf::getWornAttachmentPoint(const LLUUID& idItem) const +{ + const LLUUID& idItemBase = gInventory.getLinkedItemID(idItem); + for (attachment_map_t::const_iterator itAttachPt = mAttachmentPoints.begin(); itAttachPt != mAttachmentPoints.end(); ++itAttachPt) + { + LLViewerJointAttachment* pAttachPt = itAttachPt->second; + if (pAttachPt->getAttachedObject(idItemBase)) + return pAttachPt; + } + return NULL; +} +// [/RLVa:KB] + const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id) const { const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id); @@ -1194,6 +1235,22 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view // Clear any pending requests once the attachment arrives. removeAttachmentRequest(attachment_id); updateLODRiggedAttachments(); + +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a + // NOTE: RLVa event handlers should be invoked *after* LLVOAvatar::attachObject() calls LLViewerJointAttachment::addObject() + if (mAttachmentSignal) + { + (*mAttachmentSignal)(viewer_object, attachment, ACTION_ATTACH); + } + if (rlv_handler_t::isEnabled()) + { + RlvAttachmentLockWatchdog::instance().onAttach(viewer_object, attachment); + gRlvHandler.onAttach(viewer_object, attachment); + + if ( (attachment->getIsHUDAttachment()) && (!gRlvAttachmentLocks.hasLockedHUD()) ) + gRlvAttachmentLocks.updateLockedHUD(); + } +// [/RLVa:KB] } return attachment; @@ -1203,6 +1260,27 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) { const LLUUID attachment_id = viewer_object->getAttachmentItemID(); + +// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0a) | Added: RLVa-1.2.0a + // NOTE: RLVa event handlers should be invoked *before* LLVOAvatar::detachObject() calls LLViewerJointAttachment::removeObject() + if (rlv_handler_t::isEnabled()) + { + for (attachment_map_t::const_iterator itAttachPt = mAttachmentPoints.begin(); itAttachPt != mAttachmentPoints.end(); ++itAttachPt) + { + const LLViewerJointAttachment* pAttachPt = itAttachPt->second; + if (pAttachPt->isObjectAttached(viewer_object)) + { + RlvAttachmentLockWatchdog::instance().onDetach(viewer_object, pAttachPt); + gRlvHandler.onDetach(viewer_object, pAttachPt); + } + if (mAttachmentSignal) + { + (*mAttachmentSignal)(viewer_object, pAttachPt, ACTION_DETACH); + } + } + } +// [/RLVa:KB] + if ( LLVOAvatar::detachObject(viewer_object) ) { LLVOAvatar::cleanupAttachedMesh( viewer_object ); @@ -1237,6 +1315,11 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) LLAppearanceMgr::instance().unregisterAttachment(attachment_id); } +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + if ( (rlv_handler_t::isEnabled()) && (viewer_object->isHUDAttachment()) && (gRlvAttachmentLocks.hasLockedHUD()) ) + gRlvAttachmentLocks.updateLockedHUD(); +// [/RLVa:KB] + return TRUE; } return FALSE; @@ -1246,7 +1329,10 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) { LLInventoryItem* item = gInventory.getItem(item_id); - if (item) +// if (item) +// [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1c) | Added: RLVa-1.2.1c + if ( (item) && ((!rlv_handler_t::isEnabled()) || (gRlvAttachmentLocks.canDetach(item))) ) +// [/RLVa:KB] { gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); gMessageSystem->nextBlockFast(_PREHASH_ObjectData); @@ -3081,3 +3167,10 @@ void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile) } apr_file_printf( file, "\n\n" ); } + +// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) +F32 LLVOAvatarSelf::getAvatarOffset() /*const*/ +{ + return (isUsingServerBakes()) ? LLAvatarAppearance::getAvatarOffset() : RlvSettings::getAvatarOffsetZ(); +} +// [/RLVa:KB] diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 78728cff20..26470f8202 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -314,14 +314,25 @@ public: void addAttachmentRequest(const LLUUID& inv_item_id); void removeAttachmentRequest(const LLUUID& inv_item_id); LLViewerObject* getWornAttachment(const LLUUID& inv_item_id); +// [RLVa:KB] - Checked: 2009-12-18 (RLVa-1.1.0i) | Added: RLVa-1.1.0i + LLViewerJointAttachment* getWornAttachmentPoint(const LLUUID& inv_item_id) const; +// [/RLVa:KB] const std::string getAttachedPointName(const LLUUID& inv_item_id) const; /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); /*virtual*/ BOOL detachObject(LLViewerObject *viewer_object); static BOOL detachAttachmentIntoInventory(const LLUUID& item_id); +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + enum EAttachAction { ACTION_ATTACH, ACTION_DETACH }; + typedef boost::signals2::signal attachment_signal_t; + boost::signals2::connection setAttachmentCallback(const attachment_signal_t::slot_type& cb); +// [/RLVa:KB] private: // Track attachments that have been requested but have not arrived yet. mutable std::map mAttachmentRequests; +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + attachment_signal_t* mAttachmentSignal; +// [/RLVa:KB] //-------------------------------------------------------------------- // HUDs @@ -348,6 +359,11 @@ public: public: bool sendAppearanceMessage(LLMessageSystem *mesgsys) const; +// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) +protected: + /*virtual*/ F32 getAvatarOffset() /*const*/; +// [/RLVa:KB] + /** Appearance ** ** *******************************************************************************/ diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 0e65df939a..c9d4693fc1 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -76,6 +76,10 @@ #include "llviewershadermgr.h" #include "llvoavatar.h" #include "llvocache.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; @@ -3995,7 +3999,14 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, { LLFastTimer t(FTM_REGISTER_FACE); - if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) +// if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) +// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c + const LLViewerObject* pObj = facep->getViewerObject(); + if ( (pObj->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) && + ( (!rlv_handler_t::isEnabled()) || + ( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) && + (gRlvHandler.canEdit(pObj)) ) ) ) +// [/RVLa:KB] { return; } diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index c196d70617..75ca6dcae7 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -38,6 +38,10 @@ #include "lltransutil.h" #include "llviewerattachmenu.h" #include "llvoavatarself.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] class LLFindOutfitItems : public LLInventoryCollectFunctor { @@ -839,6 +843,13 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu bool can_be_worn = true; +// [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + // We'll enable a menu option if at least one item in the selection is wearable/removable + bool rlvCanWearReplace = !rlv_handler_t::isEnabled(); + bool rlvCanWearAdd = !rlv_handler_t::isEnabled(); + bool rlvCanRemove = !rlv_handler_t::isEnabled(); +// [/RLVa:KB] + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { LLUUID id = *it; @@ -879,6 +890,29 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu { can_be_worn = get_can_item_be_worn(item->getLinkedUUID()); } + +// [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + if (rlv_handler_t::isEnabled()) + { + ERlvWearMask eWearMask = RLV_WEAR_LOCKED; + switch (item->getType()) + { + case LLAssetType::AT_BODYPART: + case LLAssetType::AT_CLOTHING: + eWearMask = gRlvWearableLocks.canWear(item); + rlvCanRemove |= (is_worn) ? gRlvWearableLocks.canRemove(item) : false; + break; + case LLAssetType::AT_OBJECT: + eWearMask = gRlvAttachmentLocks.canAttach(item); + rlvCanRemove |= (is_worn) ? gRlvAttachmentLocks.canDetach(item) : false; + break; + default: + break; + } + rlvCanWearReplace |= ((eWearMask & RLV_WEAR_REPLACE) == RLV_WEAR_REPLACE); + rlvCanWearAdd |= ((eWearMask & RLV_WEAR_ADD) == RLV_WEAR_ADD); + } +// [/RLVa:KB] } // for bool standalone = mParent ? mParent->isStandalone() : false; @@ -886,10 +920,15 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu // *TODO: eliminate multiple traversals over the menu items setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && can_be_worn); - setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); +// setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); setMenuItemVisible(menu, "wear_add", wear_add_visible); - setMenuItemEnabled(menu, "wear_add", canAddWearables(ids)); +// setMenuItemEnabled(menu, "wear_add", canAddWearables(ids)); setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && can_be_worn); +// [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && rlvCanWearReplace); + setMenuItemEnabled(menu, "wear_add", canAddWearables(ids) && rlvCanWearAdd); + setMenuItemEnabled(menu, "wear_replace", rlvCanWearReplace); +// [/RLVa:KB] //visible only when one item selected and this item is worn setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1); setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1); @@ -900,7 +939,12 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu setMenuItemVisible(menu, "take_off", mask == MASK_CLOTHING && n_worn == n_items); setMenuItemVisible(menu, "detach", mask == MASK_ATTACHMENT && n_worn == n_items); setMenuItemVisible(menu, "take_off_or_detach", mask == (MASK_ATTACHMENT|MASK_CLOTHING)); - setMenuItemEnabled(menu, "take_off_or_detach", n_worn == n_items); +// setMenuItemEnabled(menu, "take_off_or_detach", n_worn == n_items); +// [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + setMenuItemEnabled(menu, "take_off", rlvCanRemove); + setMenuItemEnabled(menu, "detach", rlvCanRemove); + setMenuItemEnabled(menu, "take_off_or_detach", (n_worn == n_items) && (rlvCanRemove)); +// [/RLVa:KB] setMenuItemVisible(menu, "object_profile", !standalone); setMenuItemEnabled(menu, "object_profile", n_items == 1); setMenuItemVisible(menu, "--no options--", FALSE); diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index 6077208799..4e210a105d 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -61,6 +61,10 @@ #include "curl/curl.h" #include "llstreamtools.h" +// [RLVa:KB] - Checked: 2011-09-04 (RLVa-1.4.1a) | Added: RLVa-1.4.1a +#include +// [/RLVa:KB] + LLWLParamManager::LLWLParamManager() : //set the defaults for the controls @@ -644,6 +648,19 @@ void LLWLParamManager::getPresetNames(preset_name_list_t& region, preset_name_li } } +// [RLVa:KB] - Checked: 2011-09-04 (RLVa-1.4.1a) | Added: RLVa-1.4.1a +const std::string& LLWLParamManager::findPreset(const std::string& strPresetName, LLEnvKey::EScope eScope) +{ + for (std::map::const_iterator itList = mParamList.begin(); itList != mParamList.end(); itList++) + { + const LLWLParamKey& wlKey = itList->first; + if ( (wlKey.scope == eScope) && (boost::iequals(wlKey.name, strPresetName)) ) + return wlKey.name; + } + return LLStringUtil::null; +} +// [/RLVa:KB] + void LLWLParamManager::getUserPresetNames(preset_name_list_t& user) const { preset_name_list_t region, sys; // unused diff --git a/indra/newview/llwlparammanager.h b/indra/newview/llwlparammanager.h index 72422500fc..5d700bb355 100644 --- a/indra/newview/llwlparammanager.h +++ b/indra/newview/llwlparammanager.h @@ -287,6 +287,10 @@ public: /// @return user and system preset names as a single list void getPresetNames(preset_name_list_t& region, preset_name_list_t& user, preset_name_list_t& sys) const; +// [RLVa:KB] - Checked: 2011-09-04 (RLVa-1.4.1a) | Added: RLVa-1.4.1a + const std::string& findPreset(const std::string& strPresetName, LLEnvKey::EScope eScope); +// [/RLVa:KB] + /// @return user preset names void getUserPresetNames(preset_name_list_t& user) const; diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 1940cf541e..91375efa0e 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -55,6 +55,9 @@ #include "llviewerregion.h" #include "llviewerwindow.h" #include "lltrans.h" +// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) +#include "rlvhandler.h" +// [/RLVa:KB] #include "llglheaders.h" @@ -460,7 +463,10 @@ void LLWorldMapView::draw() { mesg = info->getName(); } - if (!mesg.empty()) +// if (!mesg.empty()) +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (!mesg.empty()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) +// [/RLVa:KB] { font->renderUTF8( mesg, 0, @@ -994,7 +1000,10 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& text_x = llclamp(text_x, half_text_width + TEXT_PADDING, getRect().getWidth() - half_text_width - TEXT_PADDING); text_y = llclamp(text_y + vert_offset, TEXT_PADDING + vert_offset, getRect().getHeight() - font->getLineHeight() - TEXT_PADDING - vert_offset); - if (label != "") +// if (label != "") +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.4.5) | Added: RLVa-1.0.0 + if ( (label != "") && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) +// [/RLVa:KB] { font->renderUTF8( label, 0, @@ -1054,7 +1063,12 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, MASK mask ) { LLViewerRegion *region = gAgent.getRegion(); - std::string message = llformat("%s (%s)", info->getName().c_str(), info->getAccessString().c_str()); +// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.4.5) | Modified: RLVa-1.4.5 + std::string message = llformat("%s (%s)", + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? info->getName().c_str() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), + info->getAccessString().c_str()); +// [/RLVa:KB] +// std::string message = llformat("%s (%s)", info->getName().c_str(), info->getAccessString().c_str()); if (!info->isDown()) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 530a369b6f..dec4cbc69b 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -112,6 +112,10 @@ #include "llfloaterpathfindingconsole.h" #include "llfloaterpathfindingcharacters.h" #include "llpathfindingpathtool.h" +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvhandler.h" +#include "rlvlocks.h" +// [/RLVa:KB] #ifdef _DEBUG // Debug indices is disabled for now for debug performance - djs 4/24/02 @@ -3276,8 +3280,15 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) if (LLSelectMgr::getInstance()->mHideSelectedObjects) { - if (drawablep->getVObj().notNull() && - drawablep->getVObj()->isSelected()) +// if (drawablep->getVObj().notNull() && +// drawablep->getVObj()->isSelected()) +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f + const LLViewerObject* pObj = drawablep->getVObj(); + if ( (pObj) && (pObj->isSelected()) && + ( (!rlv_handler_t::isEnabled()) || + ( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) && + (gRlvHandler.canEdit(pObj)) ) ) ) +// [/RVLa:KB] { return; } diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp new file mode 100644 index 0000000000..e50a7be623 --- /dev/null +++ b/indra/newview/rlvcommon.cpp @@ -0,0 +1,677 @@ +/** + * + * Copyright (c) 2009-2011, Kitty Barnett + * + * The source code in this file is provided to you under the terms of the + * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt + * + * By copying, modifying or distributing this software, you acknowledge that + * you have read and understood your obligations described above, and agree to + * abide by those obligations. + * + */ + +#include "llviewerprecompiledheaders.h" +#include "llagent.h" +#include "llagentui.h" +#include "llavatarnamecache.h" +#include "llinstantmessage.h" +#include "llnotificationsutil.h" +#include "lluictrlfactory.h" +#include "llversionviewer.h" +#include "llviewerparcelmgr.h" +#include "llviewermenu.h" +#include "llviewerregion.h" +#include "llviewerstats.h" +#include "llworld.h" + +#include "rlvcommon.h" +#include "rlvhelper.h" +#include "rlvhandler.h" +#include "rlvlocks.h" + +#include "lscript_byteformat.h" +#include + +// ============================================================================ +// RlvNotifications +// + +// Checked: 2009-11-13 (RLVa-1.1.0b) | Modified: RLVa-1.1.0b +/* +void RlvNotifications::warnGiveToRLV() +{ + if ( (gSavedSettings.getWarning(RLV_SETTING_FIRSTUSE_GIVETORLV)) && (RlvSettings::getForbidGiveToRLV()) ) + LLNotifications::instance().add(RLV_SETTING_FIRSTUSE_GIVETORLV, LLSD(), LLSD(), &RlvNotifications::onGiveToRLVConfirmation); +} +*/ + +// Checked: 2009-11-13 (RLVa-1.1.0b) | Modified: RLVa-1.1.0b +/* +void RlvNotifications::onGiveToRLVConfirmation(const LLSD& notification, const LLSD& response) +{ + gSavedSettings.setWarning(RLV_SETTING_FIRSTUSE_GIVETORLV, FALSE); + + S32 idxOption = LLNotification::getSelectedOption(notification, response); + if ( (0 == idxOption) || (1 == idxOption) ) + gSavedSettings.setBOOL(RLV_SETTING_FORBIDGIVETORLV, (idxOption == 1)); +} +*/ + +// ========================================================================= +// RlvSettings +// + +#ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS +bool RlvSettings::fCompositeFolders = false; +#endif // RLV_EXPERIMENTAL_COMPOSITEFOLDERS +bool RlvSettings::fCanOOC = true; +bool RlvSettings::fLegacyNaming = true; +bool RlvSettings::fNoSetEnv = false; +bool RlvSettings::fShowNameTags = false; + +// Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-1.1.0i +void RlvSettings::initClass() +{ + static bool fInitialized = false; + if (!fInitialized) + { + #ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS + fCompositeFolders = rlvGetSetting(RLV_SETTING_ENABLECOMPOSITES, false); + if (gSavedSettings.controlExists(RLV_SETTING_ENABLECOMPOSITES)) + gSavedSettings.getControl(RLV_SETTING_ENABLECOMPOSITES)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fCompositeFolders)); + #endif // RLV_EXPERIMENTAL_COMPOSITEFOLDERS + + fLegacyNaming = rlvGetSetting(RLV_SETTING_ENABLELEGACYNAMING, true); + if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) + gSavedSettings.getControl(RLV_SETTING_ENABLELEGACYNAMING)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fLegacyNaming)); + + fCanOOC = rlvGetSetting(RLV_SETTING_CANOOC, true); + fNoSetEnv = rlvGetSetting(RLV_SETTING_NOSETENV, false); + + fShowNameTags = rlvGetSetting(RLV_SETTING_SHOWNAMETAGS, false); + if (gSavedSettings.controlExists(RLV_SETTING_SHOWNAMETAGS)) + gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fShowNameTags)); + +#ifdef RLV_EXTENSION_STARTLOCATION + // Don't allow toggling RLVaLoginLastLocation from the debug settings floater + if (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) + gSavedPerAccountSettings.getControl(RLV_SETTING_LOGINLASTLOCATION)->setHiddenFromSettingsEditor(true); +#endif // RLV_EXTENSION_STARTLOCATION + + if (gSavedSettings.controlExists(RLV_SETTING_AVATAROFFSET_Z)) + gSavedSettings.getControl(RLV_SETTING_AVATAROFFSET_Z)->getSignal()->connect(boost::bind(&onChangedAvatarOffset, _2)); + + if (gSavedSettings.controlExists(RLV_SETTING_TOPLEVELMENU)) + gSavedSettings.getControl(RLV_SETTING_TOPLEVELMENU)->getSignal()->connect(boost::bind(&onChangedMenuLevel)); + + fInitialized = true; + } +} + +#ifdef RLV_EXTENSION_STARTLOCATION + // Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d + void RlvSettings::updateLoginLastLocation() + { + if ( (!LLApp::isQuitting()) && (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) ) + { + BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || (!gRlvHandler.canStand()); + if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue) + { + gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue); + gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); + } + } + } +#endif // RLV_EXTENSION_STARTLOCATION + +// Checked: 2010-10-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e +bool RlvSettings::onChangedAvatarOffset(const LLSD& sdValue) +{ + gAgent.sendAgentSetAppearance(); + return true; +} + +// Checked: 2011-08-16 (RLVa-1.4.0b) | Added: RLVa-1.4.0b +bool RlvSettings::onChangedMenuLevel() +{ + rlvMenuToggleVisible(); + return true; +} + +// Checked: 2010-02-27 (RLVa-1.2.0a) | Added: RLVa-1.1.0i +bool RlvSettings::onChangedSettingBOOL(const LLSD& sdValue, bool* pfSetting) +{ + if (pfSetting) + *pfSetting = sdValue.asBoolean(); + return true; +} + +// ============================================================================ +// RlvStrings +// + +std::vector RlvStrings::m_Anonyms; +std::map RlvStrings::m_StringMap; + +// Checked: 2010-03-09 (RLVa-1.2.0a) | Added: RLVa-1.1.0h +void RlvStrings::initClass() +{ + static bool fInitialized = false; + if (!fInitialized) + { + LLXMLNodePtr xmlRoot; + if ( (!LLUICtrlFactory::getLayeredXMLNode("rlva_strings.xml", xmlRoot)) || (xmlRoot.isNull()) || (!xmlRoot->hasName("rlva_strings")) ) + { + RLV_ERRS << "Problem reading RLVa string XML file" << RLV_ENDL; + return; + } + + for (LLXMLNode* pNode = xmlRoot->getFirstChild(); pNode != NULL; pNode = pNode->getNextSibling()) + { + if (pNode->hasName("strings")) + { + std::string strName; + for (LLXMLNode* pStringNode = pNode->getFirstChild(); pStringNode != NULL; pStringNode = pStringNode->getNextSibling()) + { + if ( (!pStringNode->hasName("string")) || (!pStringNode->getAttributeString("name", strName)) ) + continue; + m_StringMap[strName] = pStringNode->getTextContents(); + } + } + else if (pNode->hasName("anonyms")) + { + for (LLXMLNode* pAnonymNode = pNode->getFirstChild(); pAnonymNode != NULL; pAnonymNode = pAnonymNode->getNextSibling()) + { + if (!pAnonymNode->hasName("anonym")) + continue; + m_Anonyms.push_back(pAnonymNode->getTextContents()); + } + } + } + + if ( (m_StringMap.empty()) || (m_Anonyms.empty()) ) + { + RLV_ERRS << "Problem parsing RLVa string XML file" << RLV_ENDL; + return; + } + + fInitialized = true; + } +} + +// Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a +const std::string& RlvStrings::getAnonym(const std::string& strName) +{ + const char* pszName = strName.c_str(); U32 nHash = 0; + + // Test with 11,264 SL names showed a 3.33% - 3.82% occurance for each so we *should* get a very even spread + for (int idx = 0, cnt = strName.length(); idx < cnt; idx++) + nHash += pszName[idx]; + + return m_Anonyms[nHash % m_Anonyms.size()]; +} + +// Checked: 2009-11-11 (RLVa-1.1.0a) | Added: RLVa-1.1.0a +const std::string& RlvStrings::getString(const std::string& strStringName) +{ + static const std::string strMissing = "(Missing RLVa string)"; + std::map::const_iterator itString = m_StringMap.find(strStringName); + return (itString != m_StringMap.end()) ? itString->second : strMissing; +} + +// Checked: 2009-11-25 (RLVa-1.1.0f) | Added: RLVa-1.1.0f +const char* RlvStrings::getStringFromReturnCode(ERlvCmdRet eRet) +{ + // TODO-RLVa: [2009-11-25] clean this up along with the calling code in process_chat_from_simulator() once we're happy with the output + switch (eRet) + { + case RLV_RET_SUCCESS_UNSET: + return "unset"; + case RLV_RET_SUCCESS_DUPLICATE: + return "duplicate"; + case RLV_RET_SUCCESS_DELAYED: + return "delayed"; + case RLV_RET_FAILED_SYNTAX: + return "thingy error"; + case RLV_RET_FAILED_OPTION: + return "invalid option"; + case RLV_RET_FAILED_PARAM: + return "invalid param"; + case RLV_RET_FAILED_LOCK: + return "locked command"; + case RLV_RET_FAILED_DISABLED: + return "disabled command"; + case RLV_RET_FAILED_UNKNOWN: + return "unknown command"; + case RLV_RET_FAILED_NOSHAREDROOT: + return "missing #RLV"; + // The following are identified by the chat verb + case RLV_RET_RETAINED: + case RLV_RET_SUCCESS: + case RLV_RET_FAILED: + break; + // The following shouldn't occur + case RLV_RET_UNKNOWN: + default: + RLV_ASSERT(false); + break; + }; + return NULL; +} + +// Checked: 2012-02-25 (RLVa-1.4.5) | Modified: RLVa-1.4.5 +std::string RlvStrings::getVersion(bool fLegacy) +{ + return llformat("%s viewer v%d.%d.%d (RLVa %d.%d.%d)", + ( (!fLegacy) ? "RestrainedLove" : "RestrainedLife" ), + RLV_VERSION_MAJOR, RLV_VERSION_MINOR, RLV_VERSION_PATCH, + RLVa_VERSION_MAJOR, RLVa_VERSION_MINOR, RLVa_VERSION_PATCH); +} + +// Checked: 2010-04-18 (RLVa-1.4.0a) | Added: RLVa-1.2.0e +std::string RlvStrings::getVersionAbout() +{ + return llformat("RLV v%d.%d.%d / RLVa v%d.%d.%d%c" , + RLV_VERSION_MAJOR, RLV_VERSION_MINOR, RLV_VERSION_PATCH, + RLVa_VERSION_MAJOR, RLVa_VERSION_MINOR, RLVa_VERSION_PATCH, 'a' + RLVa_VERSION_BUILD); +} + +// Checked: 2010-03-27 (RLVa-1.4.0a) | Modified: RLVa-1.1.0a +std::string RlvStrings::getVersionNum() +{ + return llformat("%d%02d%02d%02d", RLV_VERSION_MAJOR, RLV_VERSION_MINOR, RLV_VERSION_PATCH, RLV_VERSION_BUILD); +} + +// Checked: 2010-05-26 (RLVa-1.2.0h) | Added: RLVa-1.2.0g +bool RlvStrings::hasString(const std::string& strStringName) +{ + return m_StringMap.find(strStringName) != m_StringMap.end(); +} + +// ============================================================================ +// RlvUtil +// + +bool RlvUtil::m_fForceTp = false; + +// Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-1.0.0a +void RlvUtil::filterLocation(std::string& strUTF8Text) +{ + // Filter any mention of the surrounding region names + LLWorld::region_list_t regions = LLWorld::getInstance()->getRegionList(); + const std::string& strHiddenRegion = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); + for (LLWorld::region_list_t::const_iterator itRegion = regions.begin(); itRegion != regions.end(); ++itRegion) + boost::ireplace_all(strUTF8Text, (*itRegion)->getName(), strHiddenRegion); + + // Filter any mention of the parcel name + LLViewerParcelMgr* pParcelMgr = LLViewerParcelMgr::getInstance(); + if (pParcelMgr) + boost::ireplace_all(strUTF8Text, pParcelMgr->getAgentParcelName(), RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL)); +} + +// Checked: 2010-12-08 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c +void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy) +{ + uuid_vec_t idAgents; + LLWorld::getInstance()->getAvatars(&idAgents, NULL); + for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++) + { + LLAvatarName avName; + if (LLAvatarNameCache::get(idAgents[idxAgent], &avName)) + { + const std::string& strAnonym = RlvStrings::getAnonym(avName.mDisplayName); + + // NOTE: if the legacy first and last name are empty we get a legacy name of " " which would replace all spaces in the string + std::string strLegacyName; + if ( (fFilterLegacy) && (!avName.mLegacyFirstName.empty()) && + ((!avName.mIsDisplayNameDefault) || (LLCacheName::getDefaultLastName() == avName.mLegacyLastName)) ) + { + strLegacyName = avName.getLegacyName(); + } + + // If the display name is a subset of the legacy name we need to filter that first, otherwise it's the other way around + if (boost::icontains(strLegacyName, avName.mDisplayName)) + { + if (!strLegacyName.empty()) + boost::ireplace_all(strUTF8Text, strLegacyName, strAnonym); + boost::ireplace_all(strUTF8Text, avName.mDisplayName, strAnonym); + } + else + { + boost::ireplace_all(strUTF8Text, avName.mDisplayName, strAnonym); + if (!strLegacyName.empty()) + boost::ireplace_all(strUTF8Text, strLegacyName, strAnonym); + } + } + } +} + +// Checked: 2012-08-19 (RLVa-1.4.7) +void RlvUtil::filterScriptQuestions(S32& nQuestions, LLSD& sdPayload) +{ + // Check SCRIPT_PERMISSION_ATTACH + if ( (!gRlvAttachmentLocks.canAttach()) && (LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH] & nQuestions) ) + { + // Notify the user that we blocked it since they're not allowed to wear any new attachments + sdPayload["rlv_blocked"] = RLV_STRING_BLOCKED_PERMATTACH; + nQuestions &= ~LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]; + } + + // Check SCRIPT_PERMISSION_TELEPORT + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) && (LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TELEPORT] & nQuestions) ) + { + // Notify the user that we blocked it since they're not allowed to teleport + sdPayload["rlv_blocked"] = RLV_STRING_BLOCKED_PERMTELEPORT; + nQuestions &= ~LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TELEPORT]; + } + + sdPayload["questions"] = nQuestions; +} + +// Checked: 2010-08-29 (RLVa-1.2.1c) | Added: RLVa-1.2.1c +void RlvUtil::forceTp(const LLVector3d& posDest) +{ + m_fForceTp = true; + gAgent.teleportViaLocationLookAt(posDest); + m_fForceTp = false; +} + +// Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f +bool RlvUtil::isNearbyAgent(const LLUUID& idAgent) +{ + // Sanity check since we call this with notification payloads as well and those strings tend to change from one release to another + RLV_ASSERT(idAgent.notNull()); + if ( (idAgent.notNull()) && (gAgent.getID() != idAgent) ) + { + std::vector idAgents; + LLWorld::getInstance()->getAvatars(&idAgents, NULL); + + for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++) + if (idAgents[idxAgent] == idAgent) + return true; + } + return false; +} + +// Checked: 2010-04-05 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d +bool RlvUtil::isNearbyRegion(const std::string& strRegion) +{ + LLWorld::region_list_t regions = LLWorld::getInstance()->getRegionList(); + for (LLWorld::region_list_t::const_iterator itRegion = regions.begin(); itRegion != regions.end(); ++itRegion) + if ((*itRegion)->getName() == strRegion) + return true; + return false; +} + +// Checked: 2011-04-11 (RLVa-1.3.0h) | Modified: RLVa-1.3.0h +void RlvUtil::notifyBlocked(const std::string& strNotifcation, const LLSD& sdArgs) +{ + std::string strMsg = RlvStrings::getString(strNotifcation); + LLStringUtil::format(strMsg, sdArgs); + + LLSD sdNotify; + sdNotify["MESSAGE"] = strMsg; + LLNotificationsUtil::add("SystemMessageTip", sdNotify); +} + +// Checked: 2010-11-11 (RLVa-1.2.1g) | Added: RLVa-1.2.1g +void RlvUtil::notifyFailedAssertion(const std::string& strAssert, const std::string& strFile, int nLine) +{ + // Don't show the same assertion over and over, or if the user opted out + static std::string strAssertPrev, strFilePrev; static int nLinePrev; + if ( ((strAssertPrev == strAssert) && (strFile == strFilePrev) && (nLine == nLinePrev)) || + (!rlvGetSetting(RLV_SETTING_SHOWASSERTIONFAIL, true)) ) + { + return; + } + + strAssertPrev = strAssert; + strFilePrev = strFile; + nLinePrev = nLine; + + LLSD argsNotify; + argsNotify["MESSAGE"] = llformat("RLVa assertion failure: %s (%s - %d)", strAssert.c_str(), strFile.c_str(), nLine); + LLNotificationsUtil::add("SystemMessageTip", argsNotify); +} + +// Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0b +void RlvUtil::sendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLUUID& idSession) +{ + // [See process_improved_im()] + std::string strFullName; + LLAgentUI::buildFullname(strFullName); + + pack_instant_message(gMessageSystem, gAgent.getID(), FALSE, gAgent.getSessionID(), idTo, strFullName, + strMsg, IM_ONLINE, IM_BUSY_AUTO_RESPONSE, idSession); + gAgent.sendReliableMessage(); +} + +// Checked: 2010-03-09 (RLVa-1.2.0a) | Modified: RLVa-1.0.1e +bool RlvUtil::sendChatReply(S32 nChannel, const std::string& strUTF8Text) +{ + if (!isValidReplyChannel(nChannel)) + return false; + + // Copy/paste from send_chat_from_viewer() + gMessageSystem->newMessageFast(_PREHASH_ChatFromViewer); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gMessageSystem->nextBlockFast(_PREHASH_ChatData); + gMessageSystem->addStringFast(_PREHASH_Message, utf8str_truncate(strUTF8Text, MAX_MSG_STR_LEN)); + gMessageSystem->addU8Fast(_PREHASH_Type, CHAT_TYPE_SHOUT); + gMessageSystem->addS32("Channel", nChannel); + gAgent.sendReliableMessage(); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT); + + return true; +} + +// ============================================================================ +// Generic menu enablers +// + +// Checked: 2010-04-23 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g +bool rlvMenuCheckEnabled() +{ + return rlv_handler_t::isEnabled(); +} + +// Checked: 2010-04-23 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g +bool rlvMenuToggleEnabled() +{ + gSavedSettings.setBOOL(RLV_SETTING_MAIN, !rlv_handler_t::isEnabled()); + + LLSD args; + args["MESSAGE"] = + llformat("RestrainedLove Support will be %s after you restart", (rlv_handler_t::isEnabled()) ? "disabled" : "enabled" ); + LLNotificationsUtil::add("GenericAlert", args); + + return true; +} + +// Checked: 2011-08-16 (RLVa-1.4.0b) | Added: RLVa-1.4.0b +void rlvMenuToggleVisible() +{ + bool fTopLevel = rlvGetSetting(RLV_SETTING_TOPLEVELMENU, true); + bool fRlvEnabled = rlv_handler_t::isEnabled(); + + LLMenuGL* pRLVaMenuMain = gMenuBarView->findChildMenuByName("RLVa Main", FALSE); + LLMenuGL* pAdvancedMenu = gMenuBarView->findChildMenuByName("Advanced", FALSE); + LLMenuGL* pRLVaMenuEmbed = pAdvancedMenu->findChildMenuByName("RLVa Embedded", FALSE); + + gMenuBarView->setItemVisible("RLVa Main", (fRlvEnabled) && (fTopLevel)); + pAdvancedMenu->setItemVisible("RLVa Embedded", (fRlvEnabled) && (!fTopLevel)); + + if ( (rlv_handler_t::isEnabled()) && (pRLVaMenuMain) && (pRLVaMenuEmbed) && + ( ((fTopLevel) && (1 == pRLVaMenuMain->getItemCount())) || ((!fTopLevel) && (1 == pRLVaMenuEmbed->getItemCount())) ) ) + { + LLMenuGL* pMenuFrom = (fTopLevel) ? pRLVaMenuEmbed : pRLVaMenuMain; + LLMenuGL* pMenuTo = (fTopLevel) ? pRLVaMenuMain : pRLVaMenuEmbed; + while (LLMenuItemGL* pItem = pMenuFrom->getItem(1)) + { + pMenuFrom->removeChild(pItem); + pMenuTo->addChild(pItem); + pItem->updateBranchParent(pMenuTo); + } + } +} + +// Checked: 2010-04-23 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g +bool rlvMenuEnableIfNot(const LLSD& sdParam) +{ + bool fEnable = true; + if (rlv_handler_t::isEnabled()) + { + ERlvBehaviour eBhvr = RlvCommand::getBehaviourFromString(sdParam.asString()); + fEnable = (eBhvr != RLV_BHVR_UNKNOWN) ? !gRlvHandler.hasBehaviour(eBhvr) : true; + } + return fEnable; +} + +// ============================================================================ +// Selection functors +// + +// Checked: 2011-05-28 (RLVa-1.4.6) | Modified: RLVa-1.4.0 +bool rlvCanDeleteOrReturn(const LLViewerObject* pObj) +{ + // Block if: @rez=n restricted and owned by us or a group *or* @unsit=n restricted and being sat on by us + return + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || ((!pObj->permYouOwner()) && (!pObj->permGroupOwner())) ) && + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (!isAgentAvatarValid()) || (!pObj->getRootEdit()->isChild(gAgentAvatarp)) ); +} + +// Checked: 2011-05-28 (RLVa-1.4.6) | Modified: RLVa-1.4.0 +bool rlvCanDeleteOrReturn() +{ + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) ) + { + struct RlvCanDeleteOrReturn : public LLSelectedObjectFunctor + { + /*virtual*/ bool apply(LLViewerObject* pObj) { return rlvCanDeleteOrReturn(pObj); } + } f; + LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection(); + return (hSel.notNull()) && (0 != hSel->getRootObjectCount()) && (hSel->applyToRootObjects(&f, false)); + } + return true; +} + +// Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-0.2.0f +bool RlvSelectHasLockedAttach::apply(LLSelectNode* pNode) +{ + return (pNode->getObject()) ? gRlvAttachmentLocks.isLockedAttachment(pNode->getObject()->getRootEdit()) : false; +} + +// Checked: 2010-11-29 (RLVa-1.3.0c) | Added: RLVa-1.3.0c +bool RlvSelectIsEditable::apply(LLSelectNode* pNode) +{ + const LLViewerObject* pObj = pNode->getObject(); + return (pObj) && (!gRlvHandler.canEdit(pObj)); +} + +// Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a +bool RlvSelectIsSittingOn::apply(LLSelectNode* pNode) +{ + return (pNode->getObject()) && (pNode->getObject()->getRootEdit()->isChild(m_pAvatar)); +} + +// ============================================================================ +// Predicates +// + +// Checked: 2010-11-11 (RLVa-1.2.1g) | Modified: RLVa-1.2.1g +bool rlvPredCanWearItem(const LLViewerInventoryItem* pItem, ERlvWearMask eWearMask) +{ + if ( (pItem) && (RlvForceWear::isWearableItem(pItem)) ) + { + if (RlvForceWear::isWearingItem(pItem)) + return true; // Special exception for currently worn items + switch (pItem->getType()) + { + case LLAssetType::AT_BODYPART: + // NOTE: only one body part of each type is allowed so the only way to wear one is if we can replace the current one + return (RLV_WEAR_LOCKED != (gRlvWearableLocks.canWear(pItem) & RLV_WEAR_REPLACE & eWearMask)); + case LLAssetType::AT_CLOTHING: + return (RLV_WEAR_LOCKED != (gRlvWearableLocks.canWear(pItem) & eWearMask)); + case LLAssetType::AT_OBJECT: + return (RLV_WEAR_LOCKED != (gRlvAttachmentLocks.canAttach(pItem) & eWearMask)); + case LLAssetType::AT_GESTURE: + return true; + default: + RLV_ASSERT(false); + } + } + return false; +} + +// Checked: 2010-03-22 (RLVa-1.2.0c) | Added: RLVa-1.2.0a +bool rlvPredCanNotWearItem(const LLViewerInventoryItem* pItem, ERlvWearMask eWearMask) +{ + return !rlvPredCanWearItem(pItem, eWearMask); +} + +// Checked: 2010-03-22 (RLVa-1.2.0c) | Added: RLVa-1.2.0a +bool rlvPredCanRemoveItem(const LLInventoryItem* pItem) +{ + if ( (pItem) && (RlvForceWear::isWearableItem(pItem)) ) + { + switch (pItem->getType()) + { + case LLAssetType::AT_BODYPART: + case LLAssetType::AT_CLOTHING: + return gRlvWearableLocks.canRemove(pItem); + case LLAssetType::AT_OBJECT: + return gRlvAttachmentLocks.canDetach(pItem); + case LLAssetType::AT_GESTURE: + return true; + default: + RLV_ASSERT(false); + } + } + return false; +} + +// Checked: 2010-03-22 (RLVa-1.2.0c) | Added: RLVa-1.2.0a +bool rlvPredCanNotRemoveItem(const LLInventoryItem* pItem) +{ + return !rlvPredCanRemoveItem(pItem); +} + +// Checked: 2010-04-24 (RLVa-1.2.0f) | Added: RLVa-1.2.0f +RlvPredIsEqualOrLinkedItem::RlvPredIsEqualOrLinkedItem(const LLUUID& idItem) +{ + m_pItem = gInventory.getItem(idItem); +} + +// Checked: 2010-04-24 (RLVa-1.2.0f) | Added: RLVa-1.2.0f +bool RlvPredIsEqualOrLinkedItem::operator()(const LLViewerInventoryItem* pItem) const +{ + return (m_pItem) && (pItem) && (m_pItem->getLinkedUUID() == pItem->getLinkedUUID()); +} + +// ============================================================================ +// Various public helper functions +// + +// Checked: 2009-11-15 (RLVa-1.1.0c) | Added: RLVa-1.1.0c +/* +BOOL rlvEnableSharedWearEnabler(void* pParam) +{ + return false; + // Visually disable the "Enable Shared Wear" option when at least one attachment is non-detachable + return (!gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)); +} +*/ + +// Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a +const std::string& rlvGetAnonym(const LLAvatarName& avName) +{ + return RlvStrings::getAnonym(avName); +} + +// ============================================================================ diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h new file mode 100644 index 0000000000..70f6dd5747 --- /dev/null +++ b/indra/newview/rlvcommon.h @@ -0,0 +1,300 @@ +/** + * + * Copyright (c) 2009-2011, Kitty Barnett + * + * The source code in this file is provided to you under the terms of the + * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt + * + * By copying, modifying or distributing this software, you acknowledge that + * you have read and understood your obligations described above, and agree to + * abide by those obligations. + * + */ + +#ifndef RLV_COMMON_H +#define RLV_COMMON_H + +#include "llavatarname.h" +#include "llselectmgr.h" +#include "llviewercontrol.h" + +#include "rlvdefines.h" + +#ifdef LL_WINDOWS + #pragma warning (push) + #pragma warning (disable : 4702) // warning C4702: unreachable code +#endif +#include +#ifdef LL_WINDOWS + #pragma warning (pop) +#endif + +// ============================================================================ +// Forward declarations +// + +// +// General viewer source +// +class LLInventoryItem; +class LLViewerInventoryCategory; +class LLViewerInventoryItem; +class LLViewerJointAttachment; +class LLViewerWearable; +class LLWearable; + +// +// RLVa-specific +// +class RlvCommand; +typedef std::list rlv_command_list_t; +class RlvObject; + +struct RlvException; +typedef boost::variant RlvExceptionOption; + +class RlvGCTimer; + +// ============================================================================ +// RlvSettings +// + +template inline T rlvGetSetting(const std::string& strSetting, const T& defaultValue) +{ + RLV_ASSERT_DBG(gSavedSettings.controlExists(strSetting)); + return (gSavedSettings.controlExists(strSetting)) ? gSavedSettings.get(strSetting) : defaultValue; +} + +template inline T rlvGetPerUserSetting(const std::string& strSetting, const T& defaultValue) +{ + RLV_ASSERT_DBG(gSavedPerAccountSettings.controlExists(strSetting)); + return (gSavedPerAccountSettings.controlExists(strSetting)) ? gSavedPerAccountSettings.get(strSetting) : defaultValue; +} + +class RlvSettings +{ +public: + static F32 getAvatarOffsetZ() { return rlvGetSetting(RLV_SETTING_AVATAROFFSET_Z, 0.0); } + static bool getDebug() { return rlvGetSetting(RLV_SETTING_DEBUG, false); } + static bool getCanOOC() { return fCanOOC; } + static bool getForbidGiveToRLV() { return rlvGetSetting(RLV_SETTING_FORBIDGIVETORLV, true); } + static bool getNoSetEnv() { return fNoSetEnv; } + + static std::string getWearAddPrefix() { return rlvGetSetting(RLV_SETTING_WEARADDPREFIX, LLStringUtil::null); } + static std::string getWearReplacePrefix() { return rlvGetSetting(RLV_SETTING_WEARREPLACEPREFIX, LLStringUtil::null); } + + static bool getDebugHideUnsetDup() { return rlvGetSetting(RLV_SETTING_DEBUGHIDEUNSETDUP, false); } + #ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS + static BOOL getEnableComposites() { return fCompositeFolders; } + #endif // RLV_EXPERIMENTAL_COMPOSITEFOLDERS + static bool getEnableLegacyNaming() { return fLegacyNaming; } + static bool getEnableSharedWear() { return rlvGetSetting(RLV_SETTING_ENABLESHAREDWEAR, false); } + static bool getHideLockedLayers() { return rlvGetSetting(RLV_SETTING_HIDELOCKEDLAYER, false); } + static bool getHideLockedAttach() { return rlvGetSetting(RLV_SETTING_HIDELOCKEDATTACH, false); } + static bool getHideLockedInventory() { return rlvGetSetting(RLV_SETTING_HIDELOCKEDINVENTORY, false); } + static bool getSharedInvAutoRename() { return rlvGetSetting(RLV_SETTING_SHAREDINVAUTORENAME, true); } + static bool getShowNameTags() { return fShowNameTags; } + + #ifdef RLV_EXTENSION_STARTLOCATION + static bool getLoginLastLocation() { return rlvGetPerUserSetting(RLV_SETTING_LOGINLASTLOCATION, true); } + static void updateLoginLastLocation(); + #endif // RLV_EXTENSION_STARTLOCATION + + static void initClass(); +protected: + static bool onChangedAvatarOffset(const LLSD& sdValue); + static bool onChangedMenuLevel(); + static bool onChangedSettingBOOL(const LLSD& sdValue, bool* pfSetting); + + #ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS + static BOOL fCompositeFolders; + #endif // RLV_EXPERIMENTAL_COMPOSITEFOLDERS + static bool fCanOOC; + static bool fLegacyNaming; + static bool fNoSetEnv; + static bool fShowNameTags; +}; + +// ============================================================================ +// RlvStrings +// + +class RlvStrings +{ +public: + static void initClass(); + + static const std::string& getAnonym(const LLAvatarName& avName); // @shownames + static const std::string& getAnonym(const std::string& strName); // @shownames + static const std::string& getBehaviourNotificationString(ERlvBehaviour eBhvr, ERlvParamType eType); + static const std::string& getString(const std::string& strStringName); + static const char* getStringFromReturnCode(ERlvCmdRet eRet); + static std::string getVersion(bool fLegacy = false); // @version + static std::string getVersionAbout(); // Shown in Help / About + static std::string getVersionNum(); // @versionnum + static bool hasString(const std::string& strStringName); + +protected: + static std::vector m_Anonyms; + static std::map m_StringMap; +}; + +// ============================================================================ +// RlvUtil - Collection of (static) helper functions +// + +class RlvUtil +{ +public: + static bool isEmote(const std::string& strUTF8Text); + static bool isNearbyAgent(const LLUUID& idAgent); // @shownames + static bool isNearbyRegion(const std::string& strRegion); // @showloc + + static void filterLocation(std::string& strUTF8Text); // @showloc + static void filterNames(std::string& strUTF8Text, bool fFilterLegacy = true); // @shownames + static void filterScriptQuestions(S32& nQuestions, LLSD& sdPayload); + + static bool isForceTp() { return m_fForceTp; } + static void forceTp(const LLVector3d& posDest); // Ignores restrictions that might otherwise prevent tp'ing + + static void notifyBlocked(const std::string& strNotifcation, const LLSD& sdArgs = LLSD()); + static void notifyBlockedGeneric() { notifyBlocked(RLV_STRING_BLOCKED_GENERIC); } + static void notifyBlockedViewXXX(LLAssetType::EType assetType) { notifyBlocked(RLV_STRING_BLOCKED_VIEWXXX, LLSD().with("[TYPE]", LLAssetType::lookup(assetType))); } + static void notifyFailedAssertion(const std::string& strAssert, const std::string& strFile, int nLine); + + static void sendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLUUID& idSession = LLUUID::null); + static bool isValidReplyChannel(S32 nChannel); + static bool sendChatReply(S32 nChannel, const std::string& strUTF8Text); + static bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text); + +protected: + static bool m_fForceTp; // @standtp +}; + +// ============================================================================ +// Extensibility classes +// + +class RlvCommandHandler +{ +public: + virtual ~RlvCommandHandler() {} + virtual bool onAddRemCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; } + virtual bool onClearCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; } + virtual bool onReplyCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; } + virtual bool onForceCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; } +}; +typedef bool (RlvCommandHandler::*rlvCommandHandler)(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet); + +// ============================================================================ +// Generic menu enablers +// + +bool rlvMenuCheckEnabled(); +bool rlvMenuToggleEnabled(); +void rlvMenuToggleVisible(); +bool rlvMenuEnableIfNot(const LLSD& sdParam); + +// ============================================================================ +// Selection functors +// + +bool rlvCanDeleteOrReturn(); +bool rlvCanDeleteOrReturn(const LLViewerObject* pObj); + +struct RlvSelectHasLockedAttach : public LLSelectedNodeFunctor +{ + RlvSelectHasLockedAttach() {} + virtual bool apply(LLSelectNode* pNode); +}; + +// Filters out selected objects that can't be editable (i.e. getFirstNode() will return NULL if the selection is fully editable) +struct RlvSelectIsEditable : public LLSelectedNodeFunctor +{ + RlvSelectIsEditable() {} + /*virtual*/ bool apply(LLSelectNode* pNode); +}; + +struct RlvSelectIsSittingOn : public LLSelectedNodeFunctor +{ + RlvSelectIsSittingOn(const LLVOAvatar* pAvatar) : m_pAvatar(pAvatar) {} + /*virtual*/ bool apply(LLSelectNode* pNode); +protected: + const LLVOAvatar* m_pAvatar; +}; + +// ============================================================================ +// Predicates +// + +bool rlvPredCanWearItem(const LLViewerInventoryItem* pItem, ERlvWearMask eWearMask); +bool rlvPredCanNotWearItem(const LLViewerInventoryItem* pItem, ERlvWearMask eWearMask); +bool rlvPredCanRemoveItem(const LLInventoryItem* pItem); +bool rlvPredCanNotRemoveItem(const LLInventoryItem* pItem); + +struct RlvPredCanWearItem +{ + RlvPredCanWearItem(ERlvWearMask eWearMask) : m_eWearMask(eWearMask) {} + bool operator()(const LLViewerInventoryItem* pItem) { return rlvPredCanWearItem(pItem, m_eWearMask); } +protected: + ERlvWearMask m_eWearMask; +}; + +struct RlvPredCanNotWearItem +{ + RlvPredCanNotWearItem(ERlvWearMask eWearMask) : m_eWearMask(eWearMask) {} + bool operator()(const LLViewerInventoryItem* pItem) { return rlvPredCanNotWearItem(pItem, m_eWearMask); } +protected: + ERlvWearMask m_eWearMask; +}; + +struct RlvPredIsEqualOrLinkedItem +{ + RlvPredIsEqualOrLinkedItem(const LLViewerInventoryItem* pItem) : m_pItem(pItem) {} + RlvPredIsEqualOrLinkedItem(const LLUUID& idItem); + bool operator()(const LLViewerInventoryItem* pItem) const; +protected: + const LLViewerInventoryItem* m_pItem; +}; + +template struct RlvPredValuesEqual +{ + bool operator()(const T* pT2) const { return (pT1) && (pT2) && (*pT1 == *pT2); } + const T* pT1; +}; + +// ============================================================================ +// Inlined class member functions +// + +// Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a +inline const std::string& RlvStrings::getAnonym(const LLAvatarName& avName) +{ + return getAnonym(avName.mDisplayName); +} + +// Checked: 2010-03-26 (RLVa-1.2.0b) | Modified: RLVa-1.0.2a +inline bool RlvUtil::isEmote(const std::string& strUTF8Text) +{ + return (strUTF8Text.length() > 4) && ( (strUTF8Text.compare(0, 4, "/me ") == 0) || (strUTF8Text.compare(0, 4, "/me'") == 0) ); +} + +// Checked: 2010-03-09 (RLVa-1.2.0b) | Added: RLVa-1.0.2a +inline bool RlvUtil::isValidReplyChannel(S32 nChannel) +{ + return (nChannel > 0) && (CHAT_CHANNEL_DEBUG != nChannel); +} + +// Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e +inline bool RlvUtil::sendChatReply(const std::string& strChannel, const std::string& strUTF8Text) +{ + S32 nChannel; + return (LLStringUtil::convertToS32(strChannel, nChannel)) ? sendChatReply(nChannel, strUTF8Text) : false; +} + +// ============================================================================ + +#endif // RLV_COMMON_H diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h new file mode 100644 index 0000000000..2d583e9a4d --- /dev/null +++ b/indra/newview/rlvdefines.h @@ -0,0 +1,343 @@ +/** + * + * Copyright (c) 2009-2011, Kitty Barnett + * + * The source code in this file is provided to you under the terms of the + * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt + * + * By copying, modifying or distributing this software, you acknowledge that + * you have read and understood your obligations described above, and agree to + * abide by those obligations. + * + */ + +#ifndef RLV_DEFINES_H +#define RLV_DEFINES_H + +// ============================================================================ +// Extensions +// + +// Extensions +#define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx +#define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders: