From da5c9c0ae9ca3fa1eb1430ab48e49491a8524dd7 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Thu, 24 Sep 2009 14:01:21 -0700 Subject: Applied RLVa patch for Imprudence 1.2 by Kitty Barnett --- linden/indra/newview/llfloatermap.cpp | 34 ++++++++++++++++++++++++++ linden/indra/newview/llinventorybridge.cpp | 10 +++++++- linden/indra/newview/llnetmap.cpp | 33 +++++++++++++------------ linden/indra/newview/llpanelpermissions.cpp | 5 +++- linden/indra/newview/llwindlightremotectrl.cpp | 11 +++++++++ 5 files changed, 76 insertions(+), 17 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp index 3be891e..f7f51fd 100644 --- a/linden/indra/newview/llfloatermap.cpp +++ b/linden/indra/newview/llfloatermap.cpp @@ -240,6 +240,13 @@ void LLFloaterMap::populateRadar() std::string fullname = getSelectedName(avatar_ids[i]); if (!fullname.empty()) { +// [RLVa:KB] - Alternate: Imprudence-1.2.0 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + fullname = gRlvHandler.getAnonym(fullname); + } +// [/RLVa:KB] + std::string mute_text = LLMuteList::getInstance()->isMuted(avatar_ids[i]) ? getString("muted") : ""; element["id"] = avatar_ids[i]; element["columns"][0]["column"] = "avatar_name"; @@ -314,6 +321,33 @@ void LLFloaterMap::toggleButtons() childSetEnabled("unmute_btn", enable_unmute); childSetEnabled("ar_btn", enable); childSetEnabled("estate_eject_btn", enable_estate); + +// [RLVa:KB] - Imprudence-1.2.0 + // Bit clumsy, but this way the RLV stuff is in its own separate block and keeps the code above clean - Kitty + if ( (rlv_handler_t::isEnabled()) && (mSelectedAvatar.notNull()) ) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + childSetEnabled("im_btn", FALSE); + childSetEnabled("profile_btn", FALSE); + childSetEnabled("invite_btn", FALSE); + childSetEnabled("add_btn", FALSE); + childSetEnabled("mute_btn", FALSE); + childSetEnabled("unmute_btn", FALSE); + } + + // Even though the avie is in the same sim (so they already know where we are) the tp would just get blocked by different code + // so it's actually less confusing to the user if we just disable the teleport button here so they'll at least have a visual cue + BOOL rlv_enable_tp = (!gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) || (gRlvHandler.isException(RLV_BHVR_TPLURE, mSelectedAvatar)); + if ( (rlv_enable_tp) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(mSelectedAvatar); + if ( ((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) ) + rlv_enable_tp = FALSE; + } + childSetEnabled("offer_teleport_btn", rlv_enable_tp); + } +// [/RLVa:KB] } BOOL LLFloaterMap::getKickable(const LLUUID &agent_id) diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 19a5ade..618c4f9 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -4241,7 +4241,15 @@ void wear_attachments_on_avatar(const std::set& item_ids, BOOL remove) { if ( (gInventory.isObjectDescendentOf(*it, gAgent.getInventoryRootID())) ) { - items.put(item); +// items.put(item); +// [RLVa:KB] - Checked: 2009-09-11 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c + LLViewerJointAttachment* pAttachPt = NULL; + if ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment()) || + (((pAttachPt = gRlvHandler.getAttachPoint(item, true)) != NULL) && (gRlvHandler.isDetachable(pAttachPt->getObject()))) ) + { + items.put(item); + } +// [/RLVa:KB] } else if ( (item->isComplete()) ) { diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index 97272f4..f055dbc 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp @@ -379,7 +379,7 @@ void LLNetMap::draw() } } -// [RLVa:KB] +// [RLVa:KB] - Alternate: Imprudence-1.2.0 if ( gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) ) { // User is not allowed to see who it is, or even if it's a friend, @@ -594,21 +594,14 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec std::string fullname; if(mClosestAgentToCursor.notNull() && gCacheName->getFullName(mClosestAgentToCursor, fullname)) { -// [RLVa:KB] - if ( gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) ) - { - // User is not allowed to see who it is, due to RLV settings. - msg.append(rlv_handler_t::cstrHidden); - } - else - { - msg.append(fullname); - msg.append("\n"); - } -// [/RLVa:KB] +// [RLVa:KB] - Alternate: Imprudence-1.2.0 + // User is not allowed to see who it is, due to RLV settings. + msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : gRlvHandler.getAnonym(fullname) ); + msg.append("\n"); + // [/RLVa:KB] } -// [RLVa:KB] +// [RLVa:KB] - Alternate: Imprudence-1.2.0 if ( gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC) ) { // User is not allowed to see where they are, due to RLV settings. @@ -1018,6 +1011,13 @@ bool LLNetMap::LLEnableTracking::handleEvent(LLPointer event, const LLS bool LLNetMap::LLShowAgentProfile::handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Alternate: Imprudence-1.2.0 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; + } +// [/RLVa:KB] + LLNetMap *self = mPtr; LLFloaterAvatarInfo::show(self->mClosestAgentAtLastRightClick); return true; @@ -1026,6 +1026,9 @@ bool LLNetMap::LLShowAgentProfile::handleEvent(LLPointer event, const L bool LLNetMap::LLEnableProfile::handleEvent(LLPointer event, const LLSD& userdata) { LLNetMap *self = mPtr; - self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); + //self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); +// [RLVa:KB] - Alternate: Imprudence-1.2.0 + self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor() && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] return true; } diff --git a/linden/indra/newview/llpanelpermissions.cpp b/linden/indra/newview/llpanelpermissions.cpp index 24bbab6..aa14a90 100644 --- a/linden/indra/newview/llpanelpermissions.cpp +++ b/linden/indra/newview/llpanelpermissions.cpp @@ -348,7 +348,10 @@ void LLPanelPermissions::refresh() fRlvEnableOwner && owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned())); // [/RLVa:KB] - if (owner_name != last_owner_name) + //if (owner_name != last_owner_name) +// [RLVa:KB] + if ( (owner_name != last_owner_name) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [/RLVa:KB] { childSetText("Last Owner Name", last_owner_name); childSetEnabled("Last Owner Name", TRUE); diff --git a/linden/indra/newview/llwindlightremotectrl.cpp b/linden/indra/newview/llwindlightremotectrl.cpp index 591b413..510e1df 100644 --- a/linden/indra/newview/llwindlightremotectrl.cpp +++ b/linden/indra/newview/llwindlightremotectrl.cpp @@ -41,6 +41,9 @@ #include "llwlparammanager.h" #include "llviewercontrol.h" +// [RLVa:KB] - Alternate: Imprudence-1.2.0 +#include "rlvhandler.h" +// [/RLVa:KB] class LLWindlightRemoteObserver : public LLWLPresetsObserver { @@ -85,6 +88,14 @@ void LLWindlightRemoteCtrl::draw() } } +// [RLVa:KB] - Alternate: Imprudence-1.2.0 + if (rlv_handler_t::isEnabled()) + { + childSetEnabled("Environment", !gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)); + mPresetsCombo->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)); + } +// [/RLVA:KB] + LLPanel::draw(); } -- cgit v1.1