diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index 92bf429031..577e486705 100755 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -469,6 +469,9 @@ public: // *WORKAROUND: two methods to overload appropriate Params due to localization issue: // no_items_msg & no_filtered_items_msg attributes are not defined as translatable in VLT. See EXT-5931 +// [RLVa:KB] - Checked: RLVa-2.0.3 + const std::string& getNoItemsMsg() const { return mNoItemsMsg; } +// [/RLVa:KB] void setNoItemsMsg(const std::string& msg) { mNoItemsMsg = msg; } void setNoFilteredItemsMsg(const std::string& msg) { mNoFilteredItemsMsg = msg; } diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index c039e6bd80..5bbc96f086 100755 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -204,6 +204,10 @@ void LLAvatarList::draw() void LLAvatarList::clear() { getIDs().clear(); +// [RLVa:KB] - Checked: RLVa-2.0.3 + // We need to be able to call this *somehow* and it actually makes moderate sense to call this in here + updateNoItemsMessage(mNameFilter); +// [/RLVa:KB] setDirty(true); LLFlatListViewEx::clear(); } diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 350ba753d4..c35a86fc86 100755 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -246,7 +246,7 @@ void LLHUDText::setString(const std::string &text_utf8) { mTextSegments.clear(); // addLine(text_utf8, mColor); -// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.4.0a) | Modified: RLVa-1.0.0f +// [RLVa:KB] - Checked: RLVa-2.0.3 // NOTE: setString() is called for debug and map beacons as well if (RlvActions::isRlvEnabled()) { @@ -255,8 +255,10 @@ void LLHUDText::setString(const std::string &text_utf8) { if (!RlvActions::canShowLocation()) RlvUtil::filterLocation(text); - if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) - RlvUtil::filterNames(text); + + bool fCanShowNearby = RlvActions::canShowNearbyAgents(); + if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) || (!fCanShowNearby) ) + RlvUtil::filterNames(text, true, !fCanShowNearby); } else { @@ -658,14 +660,16 @@ F32 LLHUDText::LLHUDTextSegment::getWidth(const LLFontGL* font) } } -// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f -void LLHUDText::refreshAllObjectText() +// [RLVa:KB] - Checked: RLVa-2.0.3 +void LLHUDText::refreshAllObjectText(EObjectTextFilter eObjFilter) { - for (TextObjectIterator itText = sTextObjects.begin(); itText != sTextObjects.end(); ++itText) + for (LLHUDText* pText : sTextObjects) { - LLHUDText* pText = *itText; - if ( (pText) && (!pText->mObjText.empty()) && (pText->mSourceObject) && (LL_PCODE_VOLUME == pText->mSourceObject->getPCode()) ) + if ((pText) && (!pText->mObjText.empty()) && (pText->mSourceObject) && (LL_PCODE_VOLUME == pText->mSourceObject->getPCode()) && + ((OTF_NONE == eObjFilter) || ((OTF_HUD_ATTACHMENTS == eObjFilter) && (pText->mSourceObject->isHUDAttachment())))) + { pText->setString(pText->mObjText); + } } } // [/RLVa:KB] diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index d5d81e1336..0be9eb4f2e 100755 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -124,10 +124,12 @@ 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 +// [RLVa:KB] - Checked: RLVa-2.0.3 const std::string& getObjectText() const { return mObjText; } void setObjectText(const std::string &utf8string) { mObjText = utf8string; } - static void refreshAllObjectText(); + + enum EObjectTextFilter { OTF_NONE, OTF_HUD_ATTACHMENTS }; + static void refreshAllObjectText(EObjectTextFilter eObjFilter = OTF_NONE); // [/RLVa:KB] protected: LLHUDText(const U8 type); @@ -166,7 +168,7 @@ private: ETextAlignment mTextAlignment; EVertAlignment mVertAlignment; BOOL mHidden; -// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f +// [RLVa:KB] - Checked: RLVa-1.0.0 std::string mObjText; // [/RLVa:KB] diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 05ceaffd82..90eaa37088 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -834,7 +834,18 @@ void LLPanelPeople::updateNearbyList() std::vector positions; - LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); +// [RLVa:KB] - Checked: RLVa-2.0.3 + if (RlvActions::canShowNearbyAgents()) + { +// [/RLVa:KB] + LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); +// [RLVa:KB] - Checked: RLVa-2.0.3 + } + else + { + mNearbyList->getIDs().clear(); + } +// [/RLVa:KB] mNearbyList->setDirty(); DISTANCE_COMPARATOR.updateAvatarsPositions(positions, mNearbyList->getIDs()); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index b746ee3e77..49901bb51f 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -61,6 +61,7 @@ public: // [RLVa:KB] - Checked: RLVa-1.2.0 LLAvatarList* getNearbyList() { return mNearbyList; } + void updateNearbyList(); // [/RLVa:KB] // internals @@ -82,7 +83,7 @@ private: void updateFriendListHelpText(); void updateFriendList(); bool updateSuggestedFriendList(); - void updateNearbyList(); +// void updateNearbyList(); void updateRecentList(); void updateFacebookList(bool visible); diff --git a/indra/newview/rlvactions.cpp b/indra/newview/rlvactions.cpp index b98de3cbf2..913ded899c 100644 --- a/indra/newview/rlvactions.cpp +++ b/indra/newview/rlvactions.cpp @@ -211,9 +211,14 @@ bool RlvActions::canShowName(EShowNamesContext eContext, const LLUUID& idAgent) return false; } +bool RlvActions::canShowNearbyAgents() +{ + return !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNEARBY); +} + // ============================================================================ // Movement -// +// bool RlvActions::canAcceptTpOffer(const LLUUID& idSender) { diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index 14f0c3b85b..c034e829a1 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -113,6 +113,11 @@ public: static bool canShowName(EShowNamesContext eContext, const LLUUID& idAgent = LLUUID::null); static void setShowName(EShowNamesContext eContext, bool fCanShowName) { if ( (eContext < SNC_COUNT) && (isRlvEnabled()) ) { s_BlockNamesContexts[eContext] = !fCanShowName; } } + /* + * Returns true if the user is allowed to see the presence of nearby avatars in UI elements (anonymized or otherwise) + */ + static bool canShowNearbyAgents(); + protected: // Backwards logic so that we can initialize to 0 and it won't block when we forget to/don't check if RLVa is disabled static bool s_BlockNamesContexts[SNC_COUNT]; diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index 319441d9c7..536c8d2598 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -450,20 +450,21 @@ void RlvUtil::filterLocation(std::string& strUTF8Text) } // Checked: 2010-12-08 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c -void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy) +void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy, bool fClearMatches) { 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)) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgents[idxAgent])) ) + // NOTE: if we're agressively culling nearby names then ignore exceptions + if ( (LLAvatarNameCache::get(idAgents[idxAgent], &avName)) && ((fClearMatches) || (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgents[idxAgent]))) ) { const std::string& strDisplayName = avName.getDisplayName(); bool fFilterDisplay = (strDisplayName.length() > 2); const std::string& strLegacyName = avName.getLegacyName(); fFilterLegacy &= (strLegacyName.length() > 2); - const std::string& strAnonym = RlvStrings::getAnonym(avName); + const std::string& strAnonym = (!fClearMatches) ? RlvStrings::getAnonym(avName) : LLStringUtil::null; // 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, strDisplayName)) diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 96cde804f4..5f38118734 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -169,7 +169,7 @@ public: 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 filterNames(std::string& strUTF8Text, bool fFilterLegacy = true, bool fClearMatches = false); // @shownames static void filterScriptQuestions(S32& nQuestions, LLSD& sdPayload); static bool isForceTp() { return m_fForceTp; } diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 02ab5b8985..9c150b9136 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -128,6 +128,7 @@ enum ERlvBehaviour { RLV_BHVR_SHOWLOC, // "showloc" RLV_BHVR_SHOWNAMES, // "shownames" RLV_BHVR_SHOWNAMETAGS, // "shownametags" + RLV_BHVR_SHOWNEARBY, RLV_BHVR_SHOWHOVERTEXT, // "showhovertext" RLV_BHVR_SHOWHOVERTEXTHUD, // "showhovertexthud" RLV_BHVR_SHOWHOVERTEXTWORLD, // "showhovertextworld" diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 6ec5f73ddd..3500252033 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -2101,6 +2101,33 @@ ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvComman return eRet; } +// Handles: @shownearby=n|y toggles +template<> template<> +void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr) +{ + if (LLApp::isQuitting()) + return; // Nothing to do if the viewer is shutting down + + // Refresh the nearby people list + LLPanelPeople* pPeoplePanel = LLFloaterSidePanelContainer::getPanel("people", "panel_people"); + LLAvatarList* pNearbyList = (pPeoplePanel) ? pPeoplePanel->getNearbyList() : NULL; + RLV_ASSERT( (pPeoplePanel) && (pNearbyList) ); + if (pNearbyList) + { + static std::string s_strNoItemsMsg = pNearbyList->getNoItemsMsg(); + pNearbyList->setNoItemsMsg( (fHasBhvr) ? RlvStrings::getString("blocked_nearby") : s_strNoItemsMsg ); + pNearbyList->clear(); + + if (pNearbyList->isInVisibleChain()) + pPeoplePanel->onCommit(); + if (!fHasBhvr) + pPeoplePanel->updateNearbyList(); + } + + // Refresh that avatar's name tag and all HUD text + LLHUDText::refreshAllObjectText(); +} + // Handles: @showself=n|y and @showselfhead=n|y toggles template<> template<> void RlvBehaviourShowSelfToggleHandler::onCommandToggle(ERlvBehaviour eBvhr, bool fHasBhvr) diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 63c447e703..2f0ac47776 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -119,7 +119,7 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvBehaviourInfo("remoutfit", RLV_BHVR_REMOUTFIT, RLV_TYPE_ADDREM)); addEntry(new RlvBehaviourGenericProcessor("rez", RLV_BHVR_REZ)); addEntry(new RlvBehaviourProcessor("sendchannel", RlvBehaviourInfo::BHVR_STRICT)); - addEntry(new RlvBehaviourProcessor("sendchannel_except", RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourProcessor("sendchannel_except", RlvBehaviourInfo::BHVR_STRICT | RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addEntry(new RlvBehaviourGenericProcessor("sendchat", RLV_BHVR_SENDCHAT)); addEntry(new RlvBehaviourToggleProcessor("sendim", RlvBehaviourInfo::BHVR_STRICT)); addModifier(RLV_BHVR_SENDIM, RLV_MODIFIER_SENDIMDISTMIN, new RlvBehaviourModifier("SendIM Distance (Min)", F32_MAX, true, new RlvBehaviourModifier_CompMax)); @@ -140,8 +140,9 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvBehaviourGenericProcessor("showminimap", RLV_BHVR_SHOWMINIMAP)); addEntry(new RlvBehaviourToggleProcessor("shownames", RlvBehaviourInfo::BHVR_STRICT)); addEntry(new RlvBehaviourToggleProcessor("shownametags", RlvBehaviourInfo::BHVR_STRICT )); - addEntry(new RlvBehaviourGenericToggleProcessor("showself", RlvBehaviourInfo::BHVR_EXTENDED)); - addEntry(new RlvBehaviourGenericToggleProcessor("showselfhead", RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourGenericToggleProcessor("shownearby", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvBehaviourGenericToggleProcessor("showself", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvBehaviourGenericToggleProcessor("showselfhead", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addEntry(new RlvBehaviourGenericProcessor("showworldmap", RLV_BHVR_SHOWWORLDMAP)); addEntry(new RlvBehaviourGenericProcessor("sit", RLV_BHVR_SIT)); addEntry(new RlvBehaviourGenericProcessor("sittp", RLV_BHVR_SITTP)); @@ -163,7 +164,7 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvBehaviourGenericProcessor("touchworld", RLV_BHVR_TOUCHWORLD)); addEntry(new RlvBehaviourGenericProcessor("tplm", RLV_BHVR_TPLM)); addEntry(new RlvBehaviourGenericProcessor("tploc", RLV_BHVR_TPLOC)); - addEntry(new RlvBehaviourGenericProcessor("tplocal", RLV_BHVR_TPLOCAL)); + addEntry(new RlvBehaviourGenericProcessor("tplocal", RLV_BHVR_TPLOCAL, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addModifier(RLV_BHVR_TPLOCAL, RLV_MODIFIER_TPLOCALDIST, new RlvBehaviourModifier("Local Teleport Distance", RLV_MODIFIER_TPLOCAL_DEFAULT, true, new RlvBehaviourModifier_CompMin)); addEntry(new RlvBehaviourGenericProcessor("tplure", RLV_BHVR_TPLURE, RlvBehaviourInfo::BHVR_STRICT)); addEntry(new RlvBehaviourGenericProcessor("tprequest", RLV_BHVR_TPREQUEST, RlvBehaviourInfo::BHVR_STRICT | RlvBehaviourInfo::BHVR_EXTENDED)); @@ -175,13 +176,13 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvBehaviourGenericProcessor("viewtexture", RLV_BHVR_VIEWTEXTURE)); // Camera addEntry(new RlvBehaviourGenericToggleProcessor("setcam")); - addEntry(new RlvBehaviourGenericProcessor("setcam_avdistmin", RLV_BHVR_SETCAM_AVDISTMIN)); + addEntry(new RlvBehaviourGenericProcessor("setcam_avdistmin", RLV_BHVR_SETCAM_AVDISTMIN, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addModifier(RLV_BHVR_SETCAM_AVDISTMIN, RLV_MODIFIER_SETCAM_AVDISTMIN, new RlvBehaviourModifierHandler("Camera - Avatar Distance (Min)", 0.0f, false, new RlvBehaviourModifier_CompMax())); - addEntry(new RlvBehaviourGenericProcessor("setcam_avdistmax", RLV_BHVR_SETCAM_AVDISTMAX)); + addEntry(new RlvBehaviourGenericProcessor("setcam_avdistmax", RLV_BHVR_SETCAM_AVDISTMAX, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addModifier(RLV_BHVR_SETCAM_AVDISTMAX, RLV_MODIFIER_SETCAM_AVDISTMAX, new RlvBehaviourModifier("Camera - Avatar Distance (Max)", F32_MAX, false, new RlvBehaviourModifier_CompMin)); - addEntry(new RlvBehaviourGenericProcessor("setcam_origindistmin", RLV_BHVR_SETCAM_ORIGINDISTMIN)); + addEntry(new RlvBehaviourGenericProcessor("setcam_origindistmin", RLV_BHVR_SETCAM_ORIGINDISTMIN, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addModifier(RLV_BHVR_SETCAM_ORIGINDISTMIN, RLV_MODIFIER_SETCAM_ORIGINDISTMIN, new RlvBehaviourModifier("Camera - Focus Distance (Min)", 0.0f, true, new RlvBehaviourModifier_CompMax)); - addEntry(new RlvBehaviourGenericProcessor("setcam_origindistmax", RLV_BHVR_SETCAM_ORIGINDISTMAX)); + addEntry(new RlvBehaviourGenericProcessor("setcam_origindistmax", RLV_BHVR_SETCAM_ORIGINDISTMAX, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addModifier(RLV_BHVR_SETCAM_ORIGINDISTMAX, RLV_MODIFIER_SETCAM_ORIGINDISTMAX, new RlvBehaviourModifier("Camera - Focus Distance (Max)", F32_MAX, true, new RlvBehaviourModifier_CompMin)); addEntry(new RlvBehaviourGenericToggleProcessor("setcam_eyeoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addModifier(RLV_BHVR_SETCAM_EYEOFFSET, RLV_MODIFIER_SETCAM_EYEOFFSET, new RlvBehaviourModifierHandler("Camera - Eye Offset", LLVector3::zero, true, nullptr)); diff --git a/indra/newview/skins/default/xui/en/rlva_strings.xml b/indra/newview/skins/default/xui/en/rlva_strings.xml index 62651c9a09..922173282b 100644 --- a/indra/newview/skins/default/xui/en/rlva_strings.xml +++ b/indra/newview/skins/default/xui/en/rlva_strings.xml @@ -61,6 +61,11 @@ value Unable to change your active group due to an RLV restriction; switching back to [GROUP_SLURL] + blocked_nearby + + value + Unable to see the presence of nearby avatars due to RLV restrictions + blocked_permattach value