Merged with default tip (Revision c752f2cb29e1)

--HG--
branch : RLVa
master
Kitty Barnett 2010-09-07 01:28:38 +02:00
commit 600d60e498
128 changed files with 12940 additions and 309 deletions

1
.hgpatchinfo/RLVa.dep Normal file
View File

@ -0,0 +1 @@
b0b2817de0bc87b17b0177b96813e22543301592

View File

@ -27,6 +27,7 @@ d2382d374139850efa5bb6adfb229e3e656cfc40 howard-demo
d40ac9dd949cba6dab1cc386da6a2027690c2519 alpha-5
d6781e22543acd7e21b967209f3c6e7003d380e3 fork to viewer-2-0
c6e6324f5be1401f077ad18a4a0f6b46451c2f7b last_sprint
425f96b1e81e01644bf5e951961e7d1023bffb89 RLVa-1.2.0
0000000000000000000000000000000000000000 v2start
0000000000000000000000000000000000000000 2-1rn1
0000000000000000000000000000000000000000 2-1-beta-2

View File

@ -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;

View File

@ -45,6 +45,10 @@ std::set<std::string> LLFloaterReg::sAlwaysShowableList;
static LLFloaterRegListener sFloaterRegListener;
// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a
LLFloaterReg::validate_signal_t LLFloaterReg::mValidateSignal;
// [/RLVa:KB]
//*******************************************************
//static
@ -214,9 +218,12 @@ LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::str
//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.2.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)

View File

@ -75,6 +75,15 @@ private:
*/
static std::set<std::string> sAlwaysShowableList;
// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a
// Used to determine whether a floater can be shown
public:
typedef boost::signals2::signal<bool(const std::string&, const LLSD&), boost_boolean_combiner> 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

View File

@ -564,6 +564,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
@ -1087,6 +1095,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
)

View File

@ -1,6 +1,149 @@
<?xml version="1.0" ?>
<llsd>
<map>
<key>RestrainedLove</key>
<map>
<key>Comment</key>
<string>Toggles the RestrainedLove features (BDSM lockable toys support). Needs a restart of the viewer.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RestrainedLoveDebug</key>
<map>
<key>Comment</key>
<string>Toggles the RestrainedLove debug mode (displays the commands when in debug mode).</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RestrainedLoveNoSetEnv</key>
<map>
<key>Comment</key>
<string>When TRUE, forbids to set the environment (time of day and Windlight settings) via RestrainedLove. Needs a restart of the viewer.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RestrainedLoveForbidGiveToRLV</key>
<map>
<key>Comment</key>
<string>When FALSE, allows to give sub-folders to the #RLV RestrainedLove folder.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RLVaDebugHideUnsetDuplicate</key>
<map>
<key>Comment</key>
<string>Suppresses reporting "unset" or "duplicate" command restrictions when RestrainedLoveDebug is TRUE</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RLVaEnableCompositeFolders</key>
<map>
<key>Comment</key>
<string>Enables composite folders for shared inventory</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RLVaEnableLegacyNaming</key>
<map>
<key>Comment</key>
<string>Enables legacy naming convention for folders</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RLVaEnableSharedWear</key>
<map>
<key>Comment</key>
<string>Attachments in the shared #RLV folder can be force-attached without needing to specify an attachment point</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RLVaHideLockedLayers</key>
<map>
<key>Comment</key>
<string>Hides "remove outfit" restricted worn clothing layers from @getoufit</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RLVaHideLockedAttachments</key>
<map>
<key>Comment</key>
<string>Hides non-detachable worn attachments from @getattach</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RLVaSharedInvAutoRename</key>
<map>
<key>Comment</key>
<string>Automatically renames shared inventory items when worn</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RLVaShowNameTags</key>
<map>
<key>Comment</key>
<string>Display of names above avatars is subject to the general "Show Names" setting when @shownames=n restricted</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>WarnFirstRLVGiveToRLV</key>
<map>
<key>Comment</key>
<string>Enables FirstRLVGiveToRLV warning dialog</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>CrashHostUrl</key>
<map>
<key>Comment</key>

View File

@ -1,6 +1,17 @@
<llsd>
<map>
<key>BusyResponseChanged</key>
<key>RLVaLoginLastLocation</key>
<map>
<key>Comment</key>
<string>Determines whether the next login will be forced to the last logoff location (set by the viewer)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>BusyResponseChanged</key>
<map>
<key>Comment</key>
<string>Does user's busy mode message differ from default?</string>

View File

@ -75,6 +75,9 @@
#include "llwindow.h"
#include "llworld.h"
#include "llworldmap.h"
// [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c)
#include "rlvhandler.h"
// [/RLVa:KB]
using namespace LLVOAvatarDefines;
@ -451,6 +454,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();
@ -499,6 +505,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)
{
@ -553,7 +566,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]
}
@ -829,7 +849,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]
}
@ -2076,7 +2103,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)
{
@ -3292,6 +3327,17 @@ 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())) ))
{
return;
}
// [/RLVa:KB]
LLViewerRegion *regionp = getRegion();
if(regionp && teleportCore())
{
@ -3356,6 +3402,24 @@ 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()))) )
{
return;
}
if ( (gRlvHandler.getCurrentCommand()) && (RLV_BHVR_TPTO == gRlvHandler.getCurrentCommand()->getBehaviourType()) )
{
gRlvHandler.setCanCancelTp(false);
}
}
// [/RLVa:KB]
LLViewerRegion* regionp = getRegion();
U64 handle = to_region_handle(pos_global);
LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(handle);

View File

@ -48,6 +48,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 LLVOAvatarDefines;
@ -2253,6 +2256,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();

View File

@ -37,6 +37,9 @@
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c)
#include "rlvhandler.h"
// [/RLVa:KB]
LLAgentListener::LLAgentListener(LLAgent &agent)
: LLEventAPI("LLAgent",
@ -85,8 +88,28 @@ void LLAgentListener::requestSit(LLSD const & event_data) const
// *TODO - find a permanent place to share this code properly.
LLViewerObject *object = gObjectList.findObject(event_data["obj_uuid"]);
// [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());
@ -101,6 +124,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);
}

View File

@ -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::buildName(std::string& name)
@ -122,6 +125,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() )

View File

@ -49,6 +49,9 @@
#include "llvoavatarself.h"
#include "llwearable.h"
#include "llwearablelist.h"
// [RLVa:KB] - Checked: RLVa-1.2.0a (2010-03-04)
#include "rlvhandler.h"
// [/RLVa:KB]
#include <boost/scoped_ptr.hpp>
@ -763,12 +766,28 @@ U32 LLAgentWearables::pushWearable(const LLWearableType::EType type, LLWearable
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)
// if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_CLOTHING_PER_TYPE)
// {
// mWearableDatas[type].push_back(wearable);
// wearableUpdated(wearable);
// checkWearableAgainstInventory(wearable);
// return mWearableDatas[type].size()-1;
// }
// [RLVa:KB] - Checked: 2010-06-08 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
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);
RLV_ASSERT(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;
}
wearableUpdated(wearable);
checkWearableAgainstInventory(wearable);
return mWearableDatas[type].size()-1;
return idxWearable;
// [/RLVa:KB]
}
return MAX_CLOTHING_PER_TYPE;
}
@ -1302,7 +1321,11 @@ void LLAgentWearables::removeWearable(const LLWearableType::EType type, bool do_
{
LLWearable* old_wearable = getWearable(type,index);
if (old_wearable)
// if (old_wearable)
// [RLVa:KB] - Checked: 2010-05-11 (RLVa-1.2.0c) | Modified: RLVa-1.2.0g
// NOTE: we block actual removal in removeWearableFinal(); all we really want here is to avoid showing the save notice
if ( (old_wearable) && ((!rlv_handler_t::isEnabled()) || (!gRlvWearableLocks.isLockedWearable(old_wearable))) )
// [/RLVa:KB]
{
if (old_wearable->isDirty())
{
@ -1360,20 +1383,30 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo
{
LLWearable* old_wearable = getWearable(type,i);
//queryWearableCache(); // moved below
if (old_wearable)
// if (old_wearable)
// [RLVa:KB] - Checked: 2010-05-14 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
if ( (old_wearable) && ((!rlv_handler_t::isEnabled()) || (!gRlvWearableLocks.isLockedWearable(old_wearable))) )
// [/RLVa:KB]
{
popWearable(old_wearable);
old_wearable->removeFromAvatar(TRUE);
}
}
mWearableDatas[type].clear();
// mWearableDatas[type].clear();
// [RLVa:KB] - Checked: 2010-05-14 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
// The line above shouldn't be needed and would cause issues if we block removing one of the wearables
RLV_VERIFY( ((!rlv_handler_t::isEnabled()) || (!gRlvWearableLocks.hasLockedWearable(type))) ? mWearableDatas[type].empty() : true );
// [/RLVa:KB]
}
else
{
LLWearable* old_wearable = getWearable(type, index);
//queryWearableCache(); // moved below
if (old_wearable)
// if (old_wearable)
// [RLVa:KB] - Checked: 2010-05-14 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
if ( (old_wearable) && ((!rlv_handler_t::isEnabled()) || (!gRlvWearableLocks.isLockedWearable(old_wearable))) )
// [/RLVa:KB]
{
popWearable(old_wearable);
old_wearable->removeFromAvatar(TRUE);
@ -1411,6 +1444,12 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
S32 count = wearables.count();
llassert(items.count() == count);
// [RLVa:KB] - Checked: 2010-06-08 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
// If the user is @add/remoutfit restricted in any way then this function won't just work as-is, so instead of removing and re-adding
// we're stuck with any wearable type potentially having left-over (remove locked) clothing that we'll need to reorder in-place
S32 idxCurPerType[LLWearableType::WT_COUNT] = { 0 };
// [/RLVa:KB]
S32 i;
for (i = 0; i < count; i++)
{
@ -1430,10 +1469,51 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
// exactly one wearable per body part
setWearable(type,0,new_wearable);
}
else
// else
// {
// pushWearable(type,new_wearable);
// }
// [RLVa:KB] - Checked: 2010-06-08 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
else if ( (!rlv_handler_t::isEnabled()) || (!gRlvWearableLocks.hasLockedWearable(type)) || (!remove) )
{
// Sanity check: there shouldn't be any worn wearables for this type the first time we encounter it
RLV_ASSERT( (!remove) || (0 != idxCurPerType[type]) || (0 == getWearableCount(type)) );
pushWearable(type,new_wearable);
}
else
{
// Get the current index of the wearable (or add it if doesn't exist yet)
S32 idxCur = getWearableIndex(new_wearable);
if (MAX_CLOTHING_PER_TYPE == idxCur)
{
// Skip adding if @addoutfit=n restricted *unless* the wearable made it into COF [see LLAppMgr::updateAgentWearables()]
if ( (RLV_WEAR_LOCKED == gRlvWearableLocks.canWear(type)) &&
(!gInventory.isObjectDescendentOf(new_item->getUUID(), LLAppearanceMgr::instance().getCOF())) )
{
continue;
}
idxCur = pushWearable(type,new_wearable);
}
// Since we're moving up from index 0 we just swap the two wearables and things will work out in the end (hopefully)
if (idxCurPerType[type] != idxCur)
{
wearableentry_map_t::iterator itWearable = mWearableDatas.find(type);
RLV_ASSERT(itWearable != mWearableDatas.end());
if (itWearable == mWearableDatas.end()) continue;
wearableentry_vec_t& typeWearable = itWearable->second;
RLV_ASSERT(typeWearable.size() >= 2);
if (typeWearable.size() < 2) continue;
typeWearable[idxCur] = typeWearable[idxCurPerType[type]];
typeWearable[idxCurPerType[type]] = new_wearable;
//wearableUpdated(new_wearable);
//checkWearableAgainstInventory(new_wearable);
}
}
idxCurPerType[type]++;
// [/RLVa:KB]
wearableUpdated(new_wearable);
checkWearableAgainstInventory(new_wearable);
}
@ -1473,6 +1553,16 @@ void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLWearable* ne
const LLWearableType::EType type = new_wearable->getType();
// [RLVa:KB] - Checked: 2010-03-19 (RLVa-1.2.0a) | Modified: RLVa-1.2.0g
// TODO-RLVa: [RLVa-1.2.1] This looks like dead code in SL-2.0.2 so we can't really check to see if it works :|
if (rlv_handler_t::isEnabled())
{
ERlvWearMask eWear = gRlvWearableLocks.canWear(type);
if ( (RLV_WEAR_LOCKED == eWear) || ((!do_append) && (!(eWear & RLV_WEAR_REPLACE))) )
return;
}
// [/RLVa:KB]
if (!do_append)
{
// Remove old wearable, if any
@ -1803,6 +1893,34 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo
{
if (!isAgentAvatarValid()) return;
// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a
// RELEASE-RLVa: [SL-2.0.0] 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 (itObj != objects_to_remove.end())
{
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)
LLInventoryModel::cat_array_t folders; LLInventoryModel::item_array_t items;
LLLinkedItemIDMatches f(pAttachObj->getAttachmentItemID());
gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), folders, items, LLInventoryModel::EXCLUDE_TRASH, f);
RLV_ASSERT( 0 != items.count() );
if (0 == items.count())
LLAppearanceMgr::instance().registerAttachment(pAttachObj->getAttachmentItemID());
}
else
{
++itObj;
}
}
}
// [/RLVa:KB]
if (objects_to_remove.empty())
return;
@ -1849,6 +1967,23 @@ void LLAgentWearables::userRemoveAllAttachments()
void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array)
{
// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a
// RELEASE-RLVa: [SL-2.0.0] 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_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();
@ -1885,7 +2020,18 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra
msg->nextBlockFast(_PREHASH_ObjectData );
msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID());
msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner());
msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point
// msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point
// [RLVa:KB] - Checked: 2010-07-28 (RLVa-1.2.0i) | Added: RLVa-1.2.0i
bool fWearAdd = false;
if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) )
{
fWearAdd = true;
RlvAttachmentLockWatchdog::instance().onWearAttachment(item, (fWearAdd) ? RLV_WEAR_ADD : RLV_WEAR_REPLACE);
}
msg->addU8Fast(_PREHASH_AttachmentPt, (fWearAdd) ? 0 | ATTACHMENT_ADD : 0);
// [/RLVa:KB]
pack_permissions_slam(msg, item->getFlags(), item->getPermissions());
msg->addStringFast(_PREHASH_Name, item->getName());
msg->addStringFast(_PREHASH_Description, item->getDescription());

View File

@ -48,6 +48,9 @@
#include "llvoavatarself.h"
#include "llviewerregion.h"
#include "llwearablelist.h"
// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0b)
#include "rlvhandler.h"
// [/RLVa:KB]
// RAII thingy to guarantee that a variable gets reset when the Setter
// goes out of scope. More general utility would be handy - TODO:
@ -1006,6 +1009,33 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up
return false;
}
// [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a
if ( (rlv_handler_t::isEnabled()) &&
((gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) || (gRlvWearableLocks.hasLockedWearableType(RLV_LOCK_ANY))) )
{
switch (item_to_wear->getType())
{
case LLAssetType::AT_BODYPART:
case LLAssetType::AT_CLOTHING:
{
ERlvWearMask eWear = gRlvWearableLocks.canWear(item_to_wear);
if ( (RLV_WEAR_LOCKED == eWear) || ((replace) && ((RLV_WEAR_REPLACE & eWear) == 0)) )
return false;
}
break;
case LLAssetType::AT_OBJECT:
{
ERlvWearMask eWear = gRlvAttachmentLocks.canAttach(item_to_wear);
if ( (RLV_WEAR_LOCKED == eWear) || ((replace) && ((RLV_WEAR_REPLACE & eWear) == 0)) )
return false;
}
break;
default:
return false;
}
}
// [/RLVa:KB]
switch (item_to_wear->getType())
{
case LLAssetType::AT_CLOTHING:
@ -1367,6 +1397,45 @@ 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::syncCOF(const LLInventoryModel::item_array_t& items, LLAssetType::EType type, LLPointer<LLInventoryCallback> cb)
{
const LLUUID idCOF = getCOF();
LLInventoryModel::item_array_t cur_cof_items, new_cof_items = items;
// Grab the current COF contents
LLIsType f(type);
LLInventoryModel::cat_array_t cats;
gInventory.collectDescendentsIf(getCOF(), cats, cur_cof_items, LLInventoryModel::EXCLUDE_TRASH, f);
// 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++)
{
const 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())
gInventory.purgeObject(pItem->getUUID());
}
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());
}
}
// Link to whatever remains in new_cof_items
for (S32 idxNewItem = 0, cntNewItem = new_cof_items.count(); idxNewItem < cntNewItem; idxNewItem++)
{
const LLInventoryItem* pItem = new_cof_items.get(idxNewItem);
link_inventory_item(
gAgent.getID(), pItem->getLinkedUUID(), idCOF, pItem->getName(), pItem->getDescription(), LLAssetType::AT_LINK, cb);
}
}
// [/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(
@ -1419,10 +1488,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);
llinfos << "starting, cat " << (pcat ? pcat->getName() : "[UNKNOWN]") << llendl;
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);
// llinfos << "starting, cat " << (pcat ? pcat->getName() : "[UNKNOWN]") << llendl;
// [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();
@ -1443,75 +1533,142 @@ 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);
// 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(), rlvPredIsNotWearableItem), body_items_new.end());
body_items.insert(body_items.end(), body_items_new.begin(), body_items_new.end());
// [/RLVa:KB]
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(), rlvPredIsRemovableItem), 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(), rlvPredIsNotWearableItem), 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);
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(), rlvPredIsRemovableItem), 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(), rlvPredIsNotWearableItem), 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);
// Remove current COF contents.
bool keep_outfit_links = append;
purgeCategory(cof, keep_outfit_links);
gInventory.notifyObservers();
// Create links to new COF contents.
llinfos << "creating LLUpdateAppearanceOnDestroy" << llendl;
LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy(!append);
#ifndef LL_RELEASE_FOR_DOWNLOAD
llinfos << "Linking body items" << llendl;
#endif
linkAll(cof, body_items, link_waiter);
#ifndef LL_RELEASE_FOR_DOWNLOAD
llinfos << "Linking wear items" << llendl;
#endif
linkAll(cof, wear_items, link_waiter);
#ifndef LL_RELEASE_FOR_DOWNLOAD
llinfos << "Linking obj items" << llendl;
#endif
linkAll(cof, obj_items, link_waiter);
#ifndef LL_RELEASE_FOR_DOWNLOAD
llinfos << "Linking gesture items" << llendl;
#endif
linkAll(cof, gest_items, link_waiter);
// Add link to outfit if category is an outfit.
// [SL:KB] - Checked: 2010-04-24 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
if (!append)
{
createBaseOutfitLink(category, link_waiter);
// [/SL:KB]
// Remove current COF contents.
bool keep_outfit_links = append;
purgeCategory(cof, keep_outfit_links);
gInventory.notifyObservers();
#ifndef LL_RELEASE_FOR_DOWNLOAD
llinfos << "Linking body items" << llendl;
#endif
linkAll(cof, body_items, link_waiter);
#ifndef LL_RELEASE_FOR_DOWNLOAD
llinfos << "Linking wear items" << llendl;
#endif
linkAll(cof, wear_items, link_waiter);
#ifndef LL_RELEASE_FOR_DOWNLOAD
llinfos << "Linking obj items" << llendl;
#endif
linkAll(cof, obj_items, link_waiter);
#ifndef LL_RELEASE_FOR_DOWNLOAD
llinfos << "Linking gesture items" << llendl;
#endif
linkAll(cof, gest_items, link_waiter);
// [SL:KB] - Checked: 2010-04-24 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
}
else
{
// 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
syncCOF(body_items, LLAssetType::AT_BODYPART, link_waiter);
syncCOF(wear_items, LLAssetType::AT_CLOTHING, link_waiter);
syncCOF(obj_items, LLAssetType::AT_OBJECT, link_waiter);
syncCOF(gest_items, LLAssetType::AT_GESTURE, link_waiter);
gInventory.notifyObservers();
}
// [/SL:KB]
// Add link to outfit if category is an outfit.
// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0z) | Added: RLVa-1.2.0b
if ( (!append) && (idOutfit.notNull()) )
{
createBaseOutfitLink(idOutfit, link_waiter);
}
// [/RLVa:KB]
// if (!append)
// {
// createBaseOutfitLink(category, link_waiter);
// }
llinfos << "waiting for LLUpdateAppearanceOnDestroy" << llendl;
}
@ -1562,6 +1719,25 @@ 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);
}
@ -2617,6 +2793,9 @@ void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove)
// LLWearableBridge::removeItemFromAvatar(item_to_remove);
// }
// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.1.2a) | Added: Catznip-2.1.1d
// [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
if ( (!rlv_handler_t::isEnabled()) || (gRlvWearableLocks.canRemove(item_to_remove)) )
// [/RLVa:KB]
{
/*const*/ LLWearable* pWearable = gAgentWearables.getWearableFromItemID(item_to_remove->getLinkedUUID());
if ( (pWearable) && (LLAssetType::AT_BODYPART != pWearable->getAssetType()) )

View File

@ -56,6 +56,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);
@ -208,6 +213,10 @@ private:
void setOutfitLocked(bool locked);
// [SL:KB] - Checked: 2010-04-24 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
void syncCOF(const LLInventoryModel::item_array_t& items, LLAssetType::EType type, LLPointer<LLInventoryCallback> cb);
// [/SL:KB]
bool mAttachmentInvLinkEnabled;
bool mOutfitIsDirty;
bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls.

View File

@ -80,6 +80,10 @@
#include "llurlmatch.h"
#include "lltextutil.h"
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g)
#include "rlvhandler.h"
// [/RLVa:KB]
#include "llweb.h"
#include "llsecondlifeurls.h"
@ -334,7 +338,16 @@ LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ;
void idle_afk_check()
{
// check idle timers
// if (gSavedSettings.getS32("AFKTimeout") && (gAwayTriggerTimer.getElapsedTimeF32() > 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
S32 nAFKTimeout = (gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) ? gSavedSettings.getS32("AFKTimeout") : 60 * 30;
if ( (nAFKTimeout) && (gAwayTriggerTimer.getElapsedTimeF32() > nAFKTimeout) )
#else
if (gSavedSettings.getS32("AFKTimeout") && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getS32("AFKTimeout")))
#endif // RLV_EXTENSION_CMD_ALLOWIDLE
// [/RLVa:KB]
{
gAgent.setAFK();
}

View File

@ -45,6 +45,9 @@
#include "lluuid.h"
#include "llvoiceclient.h"
#include "llviewercontrol.h" // for gSavedSettings
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d)
#include "rlvhandler.h"
// [/RLVa:KB]
static LLDefaultChildRegistry::Register<LLAvatarList> r("avatar_list");
@ -121,6 +124,9 @@ LLAvatarList::LLAvatarList(const Params& p)
, mShowInfoBtn(p.show_info_btn)
, mShowProfileBtn(p.show_profile_btn)
, mShowSpeakingIndicator(p.show_speaking_indicator)
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
, mRlvCheckShowNames(false)
// [/RLVa:KB]
{
setCommitOnSelectionChange(true);
@ -368,6 +374,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.0d) | Added: RLVa-1.2.0d
item->setRlvCheckShowNames(mRlvCheckShowNames);
// [/RLVa:KB]
item->setName(name);
item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus);
item->setOnline(mIgnoreOnlineStatus ? true : is_online);
@ -387,7 +396,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 )
// if ( mContextMenu )
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d
if ( (mContextMenu) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) )
// [/RLVa:KB]
{
uuid_vec_t selected_uuids;
getSelectedUUIDs(selected_uuids);
@ -443,9 +455,32 @@ 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.0d) | Added: RLVa-1.2.0d
if ( (!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
mItemDoubleClickSignal(ctrl, x, y, mask);
// [/RLVa:KB]
}
// [RLVa:KB] - Checked: 2010-06-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
void LLAvatarList::refreshNames()
{
std::vector<LLPanel*> items;
getItems(items);
std::string strFullName;
for (std::vector<LLPanel*>::const_iterator itItem = items.begin(); itItem != items.end(); ++itItem)
{
LLAvatarListItem* pItem = static_cast<LLAvatarListItem*>(*itItem);
if (gCacheName->getFullName(pItem->getAvatarId(), strFullName))
pItem->setName(strFullName);
}
if (&NAME_COMPARATOR == mItemComparator)
sort();
}
// [/RLVa:KB]
bool LLAvatarItemComparator::compare(const LLPanel* item1, const LLPanel* item2) const
{
const LLAvatarListItem* avatar_item1 = dynamic_cast<const LLAvatarListItem*>(item1);

View File

@ -87,6 +87,11 @@ public:
// Return true if filter has at least one match.
bool filterHasMatches();
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
void setRlvCheckShowNames(bool fRlvCheckShowNames) { mRlvCheckShowNames = fRlvCheckShowNames; }
void refreshNames();
// [/RLVa:KB]
boost::signals2::connection setRefreshCompleteCallback(const commit_signal_t::slot_type& cb);
boost::signals2::connection setItemDoubleClickCallback(const mouse_signal_t::slot_type& cb);
@ -115,6 +120,9 @@ private:
bool mShowInfoBtn;
bool mShowProfileBtn;
bool mShowSpeakingIndicator;
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
bool mRlvCheckShowNames;
// [/RLVa:KB]
LLTimer* mLITUpdateTimer; // last interaction time update timer
std::string mIconParamName;

View File

@ -37,6 +37,9 @@
#include "llagent.h"
#include "llavatariconctrl.h"
#include "lloutputmonitorctrl.h"
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d)
#include "rlvhandler.h"
// [/RLVa:KB]
bool LLAvatarListItem::sStaticInitialized = false;
S32 LLAvatarListItem::sLeftPadding = 0;
@ -65,7 +68,11 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
mProfileBtn(NULL),
mOnlineStatus(E_UNKNOWN),
mShowInfoBtn(true),
mShowProfileBtn(true)
// mShowProfileBtn(true)
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
mShowProfileBtn(true),
mRlvCheckShowNames(false)
// [/RLVa:KB]
{
if (not_from_ui_factory)
{
@ -122,8 +129,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.0d) | 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]
LLPanel::onMouseEnter(x, y, mask);
@ -163,7 +174,11 @@ void LLAvatarListItem::setOnline(bool online)
void LLAvatarListItem::setName(const std::string& name)
{
setNameInternal(name, mHighlihtSubstring);
// setNameInternal(name, mHighlihtSubstring);
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
bool fRlvFilter = (mRlvCheckShowNames) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
setNameInternal( (!fRlvFilter) ? name : RlvStrings::getAnonym(name), mHighlihtSubstring);
// [/RLVa:KB]
}
void LLAvatarListItem::setHighlight(const std::string& highlight)

View File

@ -96,6 +96,9 @@ public:
void showSpeakingIndicator(bool show);
void showLastInteractionTime(bool show);
void setAvatarIconVisible(bool visible);
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
void setRlvCheckShowNames(bool fRlvCheckShowNames) { mRlvCheckShowNames = fRlvCheckShowNames; }
// [/RLVa:KB]
const LLUUID& getAvatarId() const;
const std::string getAvatarName() const;
@ -180,6 +183,9 @@ private:
//Speaker indicator and avatar name coords are translated accordingly
bool mShowInfoBtn;
bool mShowProfileBtn;
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
bool mRlvCheckShowNames;
// [/RLVa:KB]
static bool sStaticInitialized; // this variable is introduced to improve code readability
static S32 sLeftPadding; // padding to first left visible child (icon or name)

View File

@ -307,6 +307,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()

View File

@ -73,6 +73,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
{

View File

@ -61,6 +61,9 @@
#include "llviewermenu.h"
#include "lluictrlfactory.h"
#include "llbottomtray.h"
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b)
#include "rlvhandler.h"
// [/RLVa:KB]
//
// Globals
@ -80,7 +83,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
@ -473,7 +479,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();
}
@ -577,6 +587,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))
{

View File

@ -52,7 +52,9 @@
#include "llviewertexteditor.h"
#include "llworld.h"
#include "lluiconstants.h"
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f)
#include "rlvcommon.h"
// [/RLVa:KB]
#include "llsidetray.h"//for blocked objects panel
@ -86,6 +88,10 @@ public:
LLSD payload;
payload["object_id"] = object_id;
payload["owner_id"] = query_map["owner"];
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
if (query_map.has("owner_name"))
payload["owner_name"] = query_map["owner_name"];
// [/RLVa:KB]
payload["name"] = query_map["name"];
payload["slurl"] = LLWeb::escapeURL(query_map["slurl"]);
payload["group_owned"] = query_map["groupowned"];
@ -97,6 +103,10 @@ LLObjectIMHandler gObjectIMHandler;
class LLChatHistoryHeader: public LLPanel
{
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
LLChatHistoryHeader() : mShowContextMenu(true), mShowInfoCtrl(true) {}
// [/RLVa:KB]
public:
static LLChatHistoryHeader* createInstance(const std::string& file_name)
{
@ -209,7 +219,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.0f) | 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)
{
@ -271,6 +285,15 @@ public:
if(mSourceType != CHAT_SOURCE_AGENT)
icon->setDrawTooltip(false);
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | 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:
@ -328,6 +351,10 @@ protected:
void showContextMenu(S32 x,S32 y)
{
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | 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)
@ -378,7 +405,10 @@ protected:
void showInfoCtrl()
{
if (mAvatarID.isNull() || mFrom.empty() || SYSTEM_FROM == mFrom) return;
// if (mAvatarID.isNull() || mFrom.empty() || SYSTEM_FROM == mFrom) return;
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
if ( (!mShowInfoCtrl) || (mAvatarID.isNull() || mFrom.empty() || SYSTEM_FROM == mFrom) ) return;
// [/RLVa:KB]
if (!sInfoCtrl)
{
@ -447,6 +477,10 @@ protected:
EChatSourceType mSourceType;
std::string mFrom;
LLUUID mSessionID;
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
bool mShowContextMenu;
bool mShowInfoCtrl;
// [/RLVa:KB]
S32 mMinUserNameWidth;
};
@ -664,22 +698,32 @@ 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 = LLSLURL("objectim", chat.mFromID, "").getSLURLString();
url += "?name=" + chat.mFromName;
url += "&owner=" + chat.mOwnerID.asString();
std::string slurl = args["slurl"].asString();
if (slurl.empty())
// [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")) )
{
LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent);
if(region)
{
LLSLURL region_slurl(region->getName(), chat.mPosAgent);
slurl = region_slurl.getLocationString();
}
// [/RLVa:KB]
// for object IMs, create a secondlife:///app/objectim SLapp
/*std::string*/ url = LLSLURL("objectim", chat.mFromID, "").getSLURLString();
url += "?name=" + chat.mFromName;
url += "&owner=" + chat.mOwnerID.asString();
std::string slurl = args["slurl"].asString();
if (slurl.empty())
{
LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent);
if(region)
{
LLSLURL region_slurl(region->getName(), chat.mPosAgent);
slurl = region_slurl.getLocationString();
}
}
url += "&slurl=" + LLURI::escape(slurl);
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
}
url += "&slurl=" + LLURI::escape(slurl);
// [/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)
@ -689,7 +733,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
mEditor->appendText("<nolink>" + chat.mFromName + "</nolink>" + 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));

View File

@ -40,6 +40,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;
@ -141,7 +145,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;
@ -186,7 +194,11 @@ 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 = LLSLURL("agent",mFromID,"about").getSLURLString();
// style_params_name.link_href = LLSLURL("agent",mFromID,"about").getSLURLString();
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
style_params_name.link_href = LLSLURL("agent",mFromID,"about").getSLURLString();
// [/RLVa:KB]
msg_text->appendText(str_sender, FALSE, style_params_name);
@ -319,7 +331,10 @@ void LLNearbyChatToastPanel::draw()
LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("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)

View File

@ -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]
};

View File

@ -41,6 +41,9 @@
#include "llviewerregion.h"
#include "llversioninfo.h"
#include "llweb.h"
// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.2.0e)
#include "rlvhandler.h"
// [/RLVa:KB]
// Linden library includes
#include "llaudioengine.h"
@ -255,6 +258,12 @@ LLSD LLFloaterAbout::getInfo()
}
#endif
// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.2.0e) | Added: RLVa-1.2.0e
if (rlv_handler_t::isEnabled())
info["RLV_VERSION"] = RlvStrings::getVersionAbout();
else
info["RLV_VERSION"] = "(disabled)";
// [/RLVa:KB]
info["OPENGL_VERSION"] = (const char*)(glGetString(GL_VERSION));
info["LIBCURL_VERSION"] = LLCurl::getVersionString();
info["J2C_VERSION"] = LLImageJ2C::getEngineInfo();

View File

@ -36,6 +36,9 @@
#include "lltooldraganddrop.h" // for LLToolDragAndDrop
#include "llviewercontrol.h"
#include "llworld.h"
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d)
#include "rlvhandler.h"
// [/RLVa:KB]
// Linden libraries
#include "llbutton.h"
@ -234,6 +237,21 @@ void LLFloaterAvatarPicker::onRangeAdjust()
void LLFloaterAvatarPicker::onList()
{
getChildView("ok_btn")->setEnabled(isSelectBtnEnabled());
// [RLVa:KB] - Checked: 2010-06-05 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d
if (rlv_handler_t::isEnabled())
{
LLTabContainer* pTabs = getChild<LLTabContainer>("ResidentChooserTabs");
LLPanel* pNearMePanel = getChild<LLPanel>("NearMePanel");
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()

View File

@ -40,6 +40,9 @@
#include "llviewercontrol.h"
#include "llviewerobject.h"
#include "lluictrlfactory.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b)
#include "rlvhandler.h"
// [/RLVa:KB]
//LLFloaterInspect* LLFloaterInspect::sInstance = NULL;
@ -113,7 +116,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.1b) | 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 +151,10 @@ void LLFloaterInspect::onClickOwnerProfile()
if(node)
{
const LLUUID& owner_id = node->mPermissions->getOwner();
// [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(owner_id);
}
}
@ -148,8 +164,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.1b) | 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]
}
}
@ -208,6 +229,19 @@ void LLFloaterInspect::refresh()
gCacheName->getFullName(obj->mPermissions->getOwner(), owner_name);
gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name);
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.2.1b
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
if (!obj->mPermissions->isGroupOwned())
owner_name = RlvStrings::getAnonym(owner_name);
const LLUUID& idCreator = obj->mPermissions->getCreator();
if ( (obj->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator)) )
creator_name = RlvStrings::getAnonym(creator_name);
}
// [/RLVa:KB]
row["id"] = obj->getObject()->getID();
row["columns"][0]["column"] = "object_name";
row["columns"][0]["type"] = "text";

View File

@ -101,6 +101,9 @@
#include "llviewermedia.h"
#include "llpluginclassmedia.h"
#include "llteleporthistorystorage.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
@ -841,6 +844,11 @@ void LLFloaterPreference::refreshEnabledState()
LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections");
LLRadioGroup* radio_reflection_detail = getChild<LLRadioGroup>("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
@ -878,8 +886,14 @@ void LLFloaterPreference::refreshEnabledState()
// radio set for terrain detail mode
LLRadioGroup* mRadioTerrainDetail = getChild<LLRadioGroup>("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)
{
@ -896,7 +910,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<LLCheckBoxCtrl>("UseLightShaders");

View File

@ -58,6 +58,9 @@
#include "lluictrlfactory.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b)
#include "rlvhandler.h"
// [/RLVa:KB]
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLPropertiesObserver
@ -280,6 +283,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 anonimize 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<LLUICtrl>("LabelCreatorName")->setValue(name);
}
else
@ -303,8 +316,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<LLUICtrl>("LabelOwnerName")->setValue(name);
@ -541,6 +561,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());
}
}
@ -556,6 +587,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());
}
}

View File

@ -254,6 +254,14 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
if (regionp)
{
getChild<LLUICtrl>("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);

View File

@ -34,6 +34,10 @@
#include "llcolorswatch.h"
#include "llviewercontrol.h"
#include "lltexteditor.h"
// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a)
#include "rlvhandler.h"
#include "rlvextensions.h"
// [/RLVa:KB]
LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key)
@ -210,6 +214,33 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
if (controlp)
{
// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0e) | Modified: RLVa-0.2.1d
// TODO-RLVa: [RLVa-1.2.1] Look into rewriting the whole debug setting blocking code
if (rlv_handler_t::isEnabled())
{
// Don't allow changing DBG_WRITE debug settings under @setdebug=n
bool fEnable = !( (gRlvHandler.hasBehaviour(RLV_BHVR_SETDEBUG)) &&
(RlvExtGetSet::getDebugSettingFlags(controlp->getName()) & RlvExtGetSet::DBG_WRITE) );
// Don't allow toggling "Basic Shaders" and/or "Atmopsheric Shaders" through the debug settings under @setenv=n
fEnable &= !((gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) &&
(("VertexShaderEnable" == controlp->getName()) || ("WindLightUseAtmosShaders" == controlp->getName())));
#ifdef RLV_EXTENSION_STARTLOCATION
// Don't allow toggling RestrainedLoveLoginLastLocation
fEnable &= !(RLV_SETTING_LOGINLASTLOCATION == controlp->getName());
#endif // RLV_EXTENSION_STARTLOCATION
// NOTE: this runs per-frame so there's no need to explictly handle onCommitSettings() or onClickDefault()
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

View File

@ -270,6 +270,17 @@ void LLFloaterWindLight::syncMenu()
LLWLParamSet& currentParams = param_mgr->mCurParams;
//std::map<std::string, LLVector4> & currentParams = param_mgr->mCurParams.mParamValues;
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
/*
// Fixes LL "bug" (preset name isn't kept synchronized)
LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo");
if (comboBox->getSelectedItemLabel() != currentParams.mName)
{
comboBox->setSimple(currentParams.mName);
}
*/
// [/RLVa:KB]
// blue horizon
param_mgr->mBlueHorizon = currentParams.getVector(param_mgr->mBlueHorizon.mName, err);
getChild<LLUICtrl>("WLBlueHorizonR")->setValue(param_mgr->mBlueHorizon.r / 2.0);

View File

@ -75,6 +75,10 @@
#include "llwindow.h" // copyTextToClipboard()
// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a)
#include "rlvhandler.h"
// [/RLVa:KB]
//---------------------------------------------------------------------------
// Constants
//---------------------------------------------------------------------------
@ -434,6 +438,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);
@ -716,6 +724,16 @@ void LLFloaterWorldMap::updateLocation()
{ // Empty SLURL will disable the "Copy SLURL to clipboard" button
mSLURL = LLSLURL();
}
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
/*
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
{
childSetValue("location", RlvStrings::getString(RLV_STRING_HIDDEN_REGION));
mSLURL.clear();
}
*/
// [/RLVa:KB]
}
}

View File

@ -46,6 +46,10 @@
#include "llrecentpeople.h"
#include "llviewerobjectlist.h"
#include "llvoavatarself.h"
// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.0a)
#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
@ -300,6 +304,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.0h) | 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 strName, strMsgName = "inventory_item_offered-im"; LLSD args;
if (gCacheName->getFullName(to_agent, strName))
{
args["NAME"] = RlvStrings::getAnonym(strName);
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))
{
@ -397,7 +415,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.0f) | 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
@ -452,7 +478,15 @@ void 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.0f) | 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;

View File

@ -61,6 +61,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;
@ -68,6 +71,13 @@ 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-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l
if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(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;
@ -132,6 +142,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);

View File

@ -47,9 +47,11 @@
#include "llstatusbar.h"
#include "llmenugl.h"
#include "pipeline.h"
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b)
#include "rlvhandler.h"
// [/RLVa:KB]
#include <boost/tokenizer.hpp>
const F32 SPRING_STRENGTH = 0.7f;
const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f;
const F32 HORIZONTAL_PADDING = 15.f;
@ -558,6 +560,30 @@ void LLHUDText::renderText(BOOL for_select)
void LLHUDText::setStringUTF8(const std::string &wtext)
{
// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.2.0a) | Modified: RLVa-1.0.0f
// NOTE: setString() is only called for debug beacons and the floating name tags (which we don't want to censor
// because you'd see "(Region hidden) LastName" if you happen to go to a sim who's name is your first name :p
if (rlv_handler_t::isEnabled())
{
std::string text(wtext);
if (gRlvHandler.canShowHoverText(mSourceObject))
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
RlvUtil::filterLocation(text);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
RlvUtil::filterNames(text);
}
else
{
text = "";
}
setString(utf8str_to_wstring(text));
return;
}
// [/RLVa:KB]
setString(utf8str_to_wstring(wtext));
}
@ -1133,3 +1159,18 @@ F32 LLHUDText::LLHUDTextSegment::getWidth(const LLFontGL* font)
return width;
}
}
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | 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->mObjText) ) &&
(pText->mSourceObject) && (LL_PCODE_VOLUME == pText->mSourceObject->getPCode()) )
{
pText->setStringUTF8(pText->mObjText);
}
}
}
// [/RLVa:KB]

View File

@ -125,6 +125,11 @@ public:
static void addPickable(std::set<LLViewerObject*> &pick_list);
static void reshape();
static void setDisplayText(BOOL flag) { sDisplayText = flag ; }
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | 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);
@ -170,6 +175,9 @@ private:
EVertAlignment mVertAlignment;
S32 mLOD;
BOOL mHidden;
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Added: RLVa-1.0.0f
std::string mObjText;
// [/RLVa:KB]
static BOOL sDisplayText ;
static std::set<LLPointer<LLHUDText> > sTextObjects;

View File

@ -56,6 +56,9 @@
#include "llspeakers.h"
#include "llsidetray.h"
// [RLVa:KB] - Checked: 2010-04-09 (RLVa-1.2.0e)
#include "rlvhandler.h"
// [/RLVa:KB]
static const S32 RECT_PADDING_NOT_INIT = -1;
static const S32 RECT_PADDING_NEED_RECALC = -2;
@ -210,6 +213,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-04-09 (RLVa-1.2.0e) | Modified: RLVa-1.2.0e
if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM))
{
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: allow if recipient is a sendim exception
fRlvFilter = !gRlvHandler.isException(RLV_BHVR_SENDIM, mOtherParticipantUUID);
break;
case LLIMModel::LLIMSession::GROUP_SESSION: // Group chat: allow if group is a sendim exception
fRlvFilter = !gRlvHandler.isException(RLV_BHVR_SENDIM, mSessionID);
break;
case LLIMModel::LLIMSession::ADHOC_SESSION: // Conference chat: allow if all participants are sendim exceptions
{
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.isException(RLV_BHVR_SENDIM, 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,

View File

@ -62,7 +62,9 @@
#include "lltextbox.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 IM_TIME("time");
const static std::string IM_TEXT("message");
@ -3072,6 +3074,20 @@ public:
{
return;
}
// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0e) | Modified: RLVa-1.2.0a
if (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM))
{
if (gAgent.isInGroup(session_id)) // Group chat: don't accept the invite if not an exception
{
if (!gRlvHandler.isException(RLV_BHVR_RECVIM, session_id))
return;
}
else if (!gRlvHandler.isException(RLV_BHVR_RECVIM, 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;

View File

@ -37,6 +37,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!
@ -377,6 +381,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)
@ -472,10 +485,26 @@ 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();
args["[CREATOR]"] = creator_url;
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
// Only anonimize the creator if they're also the owner or if they're a nearby avie
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
((nodep->mPermissions->getOwner() == creator_id) || (RlvUtil::isNearbyAgent(creator_id))) )
{
// TODO-RLVa: [RLVa-1.2.2] We need to put a callback here in case the name hasn't previously resolved
std::string strFullName;
args["[CREATOR]"] = (gCacheName->getFullName(creator_id, strFullName)) ? RlvStrings::getAnonym(strFullName)
: LLTrans::getString("Unknown");
}
else
{
// [/RLVa:KB]
std::string creator_url =
LLSLURL("agent", creator_id, "about").getSLURLString();
args["[CREATOR]"] = creator_url;
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
}
// [/RLVa:KB]
// created by one user but owned by another
std::string owner_url;
LLUUID owner_id;
@ -488,7 +517,21 @@ void LLInspectObject::updateCreator(LLSelectNode* nodep)
else
{
owner_id = nodep->mPermissions->getOwner();
owner_url = LLSLURL("agent", owner_id, "about").getSLURLString();
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
// TODO-RLVa: [RLVa-1.2.2] We need to put a callback here in case the name hasn't previously resolved
std::string strFullName;
owner_url = (gCacheName->getFullName(owner_id, strFullName)) ? RlvStrings::getAnonym(strFullName)
: LLTrans::getString("Unknown");
}
else
{
// [/RLVa:KB]
owner_url = LLSLURL("agent", owner_id, "about").getSLURLString();
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
}
// [/RLVa:KB]
}
args["[OWNER]"] = owner_url;

View File

@ -35,6 +35,9 @@
#include "llui.h"
#include "lluictrl.h"
#include "llurlaction.h"
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f)
#include "rlvhandler.h"
// [/RLVa:KB]
//////////////////////////////////////////////////////////////////////////////
// LLInspectRemoteObject
@ -112,8 +115,12 @@ void LLInspectRemoteObject::onOpen(const LLSD& data)
mSLurl = data["slurl"].asString();
// work out the owner's name
mOwner = "";
if (gCacheName)
// mOwner = "";
// if (gCacheName)
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
mOwner = (data.has("owner_name")) ? data["owner_name"].asString() : "";
if ( (gCacheName) && (mOwnerID.notNull()) )
// [/RLVa:KB]
{
gCacheName->get(mOwnerID, mGroupOwned, nameCallback, this);
}
@ -186,7 +193,10 @@ void LLInspectRemoteObject::update()
owner = LLSLURL("agent", mOwnerID, "about").getSLURLString();
}
}
else
// else
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
else if (mOwner.empty()) // If "objectim" was subject to @shownames then we passed an anonimized owner name so use that if available
// [/RLVa:KB]
{
owner = LLTrans::getString("Unknown");
}
@ -205,6 +215,14 @@ void LLInspectRemoteObject::update()
// disable the Block button if we don't have the owner ID
getChild<LLUICtrl>("block_btn")->setEnabled(! mOwnerID.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<LLUICtrl>("object_slurl")->setValue(mSLurl);
getChild<LLUICtrl>("map_btn")->setEnabled(false);
}
// [/RLVa:KB]
}
//////////////////////////////////////////////////////////////////////////////

View File

@ -66,6 +66,9 @@
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "llwearablelist.h"
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b)
#include "rlvhandler.h"
// [/RLVa:KB]
typedef std::pair<LLUUID, LLUUID> two_uuids_t;
typedef std::list<two_uuids_t> two_uuids_list_t;
@ -618,6 +621,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);
@ -2897,6 +2914,15 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
{
is_movable = FALSE;
}
// [RLVa:KB] - Checked: 2010-05-27 (RLVa-1.2.0h) | Added: RLVa-1.2.0h
if ( (rlv_handler_t::isEnabled()) && (move_is_into_current_outfit) )
{
const LLViewerInventoryItem* pItem = dynamic_cast<const LLViewerInventoryItem*>(inv_item);
is_movable = rlvPredIsWearableItem(pItem);
}
// [/RLVa:KB]
if (move_is_into_trash)
{
is_movable &= inv_item->getIsLinkType() || !get_is_item_worn(inv_item->getUUID());
@ -3998,6 +4024,14 @@ std::string LLObjectBridge::getLabelSuffix() const
void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace)
{
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1a) | Added: RLVa-1.2.1a
// If no attachment point was specified, try looking it up from the item name
if ( (rlv_handler_t::isEnabled()) && (!attachment) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) )
{
attachment = RlvAttachPtLookup::getAttachPoint(item);
}
// [/RLVa:KB]
const LLUUID& item_id = item->getLinkedUUID();
// Check for duplicate request.
@ -4036,10 +4070,20 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach
if (replace &&
(attachment && attachment->getNumObjects() > 0))
{
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a
// 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_replace_attachment_rez);
}
else
{
// [RLVa:KB] - Checked: 2010-08-07 (RLVa-1.2.0i) | Modified: RLVa-1.2.0i
// 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*/);
}
}
@ -4063,7 +4107,17 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon
if (itemp)
{
U8 attachment_pt = notification["payload"]["attachment_point"].asInteger();
// [RLVa:KB] - Checked: 2010-08-06 (RLVa-1.2.0i) | Added: RLVa-1.2.0i
// NOTE: we're letting our callers decide whether or not to use ATTACHMENT_ADD
if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) &&
((!notification["payload"].has("rlv_force")) || (!notification["payload"]["rlv_force"].asBoolean())) )
{
ERlvWearMask eWearAction = (attachment_pt & ATTACHMENT_ADD) ? RLV_WEAR_ADD : RLV_WEAR_REPLACE;
RlvAttachmentLockWatchdog::instance().onWearAttachment(itemp, eWearAction);;
attachment_pt |= ATTACHMENT_ADD;
}
// [/RLVa:KB]
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv);
@ -4115,6 +4169,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())
{
@ -4133,6 +4191,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
@ -4317,6 +4386,10 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_
if (get_is_item_worn(item->getUUID()))
{
/*
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0c) | Modified: RLVa-0.2.2a
if ( (rlv_handler_t::isEnabled()) && (!gRlvWearableLocks.canRemove(item)) )
continue;
// [/RLVa:KB]
LLWearableList::instance().getAsset(item->getAssetUUID(),
item->getName(),
item->getType(),
@ -4493,6 +4566,10 @@ 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
{
@ -4500,6 +4577,17 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Wearable Add"));
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]
}
break;
default:
@ -4675,6 +4763,15 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable,
{
OnRemoveStruct *on_remove_struct = (OnRemoveStruct*) userdata;
const LLUUID &item_id = gInventory.getLinkedItemID(on_remove_struct->mUUID);
// [RLVa:KB] - Checked: 2010-03-20 (RLVa-1.2.0c) | Modified: RLVa-1.2.0a
if ( (rlv_handler_t::isEnabled()) && ((!wearable) || (!gRlvWearableLocks.canRemove(gInventory.getItem(item_id)))) )
{
delete on_remove_struct;
return;
}
// [/RLVa:KB]
if(wearable)
{
if( get_is_item_worn( item_id ) )
@ -4721,6 +4818,11 @@ void LLWearableBridge::removeAllClothesFromAvatar()
const LLWearable *wearable = gAgentWearables.getWearableFromItemID(item_id);
if (!wearable)
continue;
// [RLVa:KB] - Checked: 2010-05-14 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g
if ( (rlv_handler_t::isEnabled()) && (!gRlvWearableLocks.canRemove(item)) )
continue;
// [/RLVa:KB]
// Find and remove this item from the COF.
LLAppearanceMgr::instance().removeCOFItemLinks(item_id,false);
@ -4729,7 +4831,10 @@ void LLWearableBridge::removeAllClothesFromAvatar()
gInventory.notifyObservers();
// Remove wearables from gAgentWearables
LLAgentWearables::userRemoveAllClothes();
// LLAgentWearables::userRemoveAllClothes();
// [RLVa:KB] - Checked: 2010-05-14 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g
LLAppearanceMgr::instance().updateAppearanceFromCOF();
// [/RLVa:KB]
}
// static

View File

@ -46,6 +46,9 @@
#include "llviewerregion.h"
#include "llcallbacklist.h"
#include "llvoavatarself.h"
// [RLVa:KB] - Checked: RLVa-1.2.0a (2010-03-05)
#include "rlvhandler.h"
// [/RLVa:KB]
//#define DIFF_INVENTORY_FILES
#ifdef DIFF_INVENTORY_FILES
@ -2442,6 +2445,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();
@ -2492,6 +2503,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

View File

@ -59,6 +59,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]
//============================================================================
/*
@ -589,16 +592,31 @@ void LLLocationInputCtrl::reshape(S32 width, S32 height, BOOL called_from_parent
void LLLocationInputCtrl::onInfoButtonClicked()
{
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
return;
// [/RLVa:KB]
LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "agent"));
}
void LLLocationInputCtrl::onForSaleButtonClicked()
{
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
return;
// [/RLVa:KB]
handle_buy_land();
}
void LLLocationInputCtrl::onAddLandmarkButtonClicked()
{
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
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())
@ -715,6 +733,10 @@ void LLLocationInputCtrl::onTextEditorRightClicked(S32 x, S32 y, MASK mask)
void LLLocationInputCtrl::refresh()
{
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
mInfoBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
// [/RLVa:KB]
refreshLocation(); // update location string
refreshParcelIcons();
updateAddLandmarkButton(); // indicate whether current parcel has been landmarked
@ -986,6 +1008,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.2.0d) | Added: RLVa-1.2.0d
mAddLandmarkBtn->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
// [/RLVa:KB]
enableAddLandmarkButton(LLLandmarkActions::hasParcelLandmark());
}
void LLLocationInputCtrl::updateAddLandmarkTooltip()
@ -1015,6 +1040,9 @@ void LLLocationInputCtrl::updateContextMenu(){
{
landmarkItem->setLabel(LLTrans::getString("EditLandmarkNavBarMenu"));
}
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
landmarkItem->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
// [/RLVa:KB]
}
}
void LLLocationInputCtrl::updateWidgetlayout()
@ -1070,17 +1098,24 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata)
}
else if (item == "landmark")
{
LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos();
if(!landmark)
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
{
LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark"));
}
else
{
LLSideTray::getInstance()->showPanel("panel_places",
LLSD().with("type", "landmark").with("id",landmark->getUUID()));
// [/RLVa:KB]
LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos();
if(!landmark)
{
LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark"));
}
else
{
LLSideTray::getInstance()->showPanel("panel_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")
{

View File

@ -60,6 +60,9 @@
#include "llworld.h"
#include "llui.h"
#include "pipeline.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

View File

@ -48,6 +48,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
@ -701,8 +704,15 @@ LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel()
void LLPanelStandStopFlying::onStandButtonClick()
{
LLSelectMgr::getInstance()->deselectAllForStandingUp();
gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
// [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c) | Added: RLVa-1.2.0a
if ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canStand()) )
{
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.

View File

@ -46,11 +46,17 @@
#include "llwindow.h"
#include "llviewerwindow.h"
#include "llrootview.h"
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b)
#include "rlvhandler.h"
// [/RLVa:KB]
S32 LLNearbyChatBar::sLastSpecialChatChannel = 0;
// 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]
static LLDefaultChildRegistry::Register<LLGestureComboList> r("gesture_combo_list");
@ -495,7 +501,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();
}
@ -708,6 +717,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))
{
@ -838,8 +862,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);

View File

@ -40,6 +40,10 @@
#include "llfloaterreg.h"//for LLFloaterReg::getTypedInstance
#include "llviewerwindow.h"//for screen channel position
// [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.0f)
#include "rlvhandler.h"
// [/RLVa:KB]
//add LLNearbyChatHandler to LLNotificationsUI namespace
using namespace LLNotificationsUI;
@ -340,7 +344,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
{
if(chat_msg.mMuted == TRUE)
return;
if(chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull())
// if(chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull())
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
if ( (chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [/RLVa:KB]
LLRecentPeople::instance().add(chat_msg.mFromID);
if(chat_msg.mText.empty())
@ -348,6 +355,23 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
LLChat& tmp_chat = const_cast<LLChat&>(chat_msg);
// [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
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]
LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
{
//sometimes its usefull to have no name at all...
@ -434,6 +458,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
notification["source"] = (S32)chat_msg.mSourceType;
notification["chat_type"] = (S32)chat_msg.mChatType;
notification["chat_style"] = (S32)chat_msg.mChatStyle;
// [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;

View File

@ -58,6 +58,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<LLNetMap> r1("net_map");
@ -354,7 +357,11 @@ void LLNetMap::draw()
BOOL show_as_friend = FALSE;
if( i < regionp->mMapAvatarIDs.count())
{
show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(regionp->mMapAvatarIDs.get(i)) != NULL);
// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(regionp->mMapAvatarIDs.get(i)) != NULL) &&
(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [/RLVa:KB]
// show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(regionp->mMapAvatarIDs.get(i)) != NULL);
}
LLWorldMapView::drawAvatar(
pos_map.mV[VX], pos_map.mV[VY],
@ -568,35 +575,57 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask )
return FALSE;
}
LLStringUtil::format_map_t args;
std::string avatar_name;
if(mClosestAgentToCursor.notNull() && gCacheName->getFullName(mClosestAgentToCursor, avatar_name))
{
// only show tooltip if same inspector not already open
LLFloater* existing_inspector = LLFloaterReg::findInstance("inspect_avatar");
if (!existing_inspector
|| !existing_inspector->getVisible()
|| existing_inspector->getKey()["avatar_id"].asUUID() != mClosestAgentToCursor)
// [RLVa:KB] - Checked: 2010-08-08 (RLVa-1.2.0h) | Added: RLVa-1.2.0h | RLVa-1.2.0-final
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
LLInspector::Params p;
p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>());
p.message(avatar_name);
p.image.name("Inspector_I");
p.click_callback(boost::bind(showAvatarInspector, mClosestAgentToCursor));
p.visible_time_near(6.f);
p.visible_time_far(3.f);
p.delay_time(0.35f);
p.wrap(false);
// [/RLVa:KB]
// only show tooltip if same inspector not already open
LLFloater* existing_inspector = LLFloaterReg::findInstance("inspect_avatar");
if (!existing_inspector
|| !existing_inspector->getVisible()
|| existing_inspector->getKey()["avatar_id"].asUUID() != mClosestAgentToCursor)
{
LLInspector::Params p;
p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>());
p.message(avatar_name);
p.image.name("Inspector_I");
p.click_callback(boost::bind(showAvatarInspector, mClosestAgentToCursor));
p.visible_time_near(6.f);
p.visible_time_far(3.f);
p.delay_time(0.35f);
p.wrap(false);
LLToolTipMgr::instance().show(p);
LLToolTipMgr::instance().show(p);
}
return TRUE;
// [RLVa:KB] - Checked: 2010-08-08 (RLVa-1.2.0h) | Added: RLVa-1.2.0h | RLVa-1.2.0-final
}
return TRUE;
else
{
args["[AGENT]"] = RlvStrings::getAnonym(avatar_name) + "\n";
}
// [/RLVa:KB]
}
// [RLVa:KB] - Checked: 2010-08-08 (RLVa-1.2.0h) | Added: RLVa-1.2.0h | RLVa-1.2.0-final
else
{
args["[AGENT]"] = "";
}
// [/RLVa:KB]
LLStringUtil::format_map_t args;
// LLStringUtil::format_map_t args;
LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) );
if( region )
{
args["[REGION]"] = region->getName() + "\n";
// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
args["[REGION]"] =
((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION)) + "\n";
// [/RLVa:KB]
// args["[REGION]"] = region->getName() + "\n";
}
else
{

View File

@ -100,7 +100,13 @@ 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: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
// Don't spawn a new IM session for inventory offers if this notification was subject to @shownames=n
// RELEASE-RLVa: [SL-2.0.1] Test on every new release to make sure the notification gets routed the way we want it to be
bool fSpawnIM = (LLHandlerUtil::canSpawnIMSession(notification)) && (!notification->getPayload().has("rlv_shownames"));
if (fSpawnIM)
// [/RLVa:KB]
{
const std::string name = LLHandlerUtil::getSubstitutionName(notification);
@ -110,7 +116,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);
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
// 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 = (fSpawnIM) && (LLHandlerUtil::canAddNotifPanelToIM(notification));
// [/RLVa:KB]
if (add_notid_to_im)
{
LLHandlerUtil::addNotifPanelToIM(notification);
@ -149,7 +160,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.0f) | 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);
}
@ -170,8 +189,25 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
}
else
{
if (LLHandlerUtil::canAddNotifPanelToIM(notification)
&& !LLHandlerUtil::isIMFloaterOpened(notification))
// if (LLHandlerUtil::canAddNotifPanelToIM(notification)
// && !LLHandlerUtil::isIMFloaterOpened(notification))
// [SL:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
// Repro:
// 1) have someone drop you 2 inventory items (new IM session will be spawned)
// 2) accept/decline the inventory offers as they come in
// -> unread IM counter shows 0
// 3) toggle "Enable plain text chat history" while the IM session with the inventory offers isn't the active session
// -> unread IM counter shows -2
// -> LLHandlerUtil::decIMMesageCounter() really should be fixed to check for "0" before decreasing the count but
// there are enough bugfixes in RLVa as it is already :(
// Fix:
// - 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<LLScreenChannel*>(mChannel);
LLToast* pToast = (pChannel) ? pChannel->getToastByNotificationID(notification->getID()) : NULL;
if ( (pToast) && (!pToast->getCanBeStored()) )
// [/SL:KB]
{
LLHandlerUtil::decIMMesageCounter(notification);
}
@ -186,7 +222,11 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
void LLOfferHandler::onDeleteToast(LLToast* toast)
{
if (!LLHandlerUtil::canAddNotifPanelToIM(toast->getNotification()))
// if (!LLHandlerUtil::canAddNotifPanelToIM(toast->getNotification()))
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
// BUGFIX: LLHandlerUtil::canAddNotifPanelToIM() won't necessarily tell us whether the notification went into an IM or to the syswell
if (toast->getCanBeStored())
// [/RLVa:KB]
{
// send a signal to the counter manager
mDelNotificationSignal();

View File

@ -297,6 +297,13 @@ void LLOverlayBar::onClickMouselook(void*)
//static
void LLOverlayBar::onClickStandUp(void*)
{
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) )
{
return;
}
// [/RLVa:KB]
LLSelectMgr::getInstance()->deselectAllForStandingUp();
gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
}

View File

@ -59,6 +59,9 @@
#include "llviewerregion.h"
#include "llviewerwindow.h"
#include "llworld.h"
// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c)
#include "rlvhandler.h"
// [/RLVa:KB]
//
// Imported globals
@ -120,6 +123,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 +176,22 @@ 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()]
{
const LLViewerObject* pObjRoot = object->getRootEdit();
if (gRlvAttachmentLocks.isLockedAttachment(pObjRoot))
{
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() == pObjRoot) )
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(

View File

@ -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();
}

View File

@ -68,6 +68,9 @@
#include "llviewercontrol.h"
#include "lluictrlfactory.h"
//#include "llfirstuse.h"
// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c)
#include "rlvhandler.h"
// [/RLVa:KB]
#include "lldrawpool.h"
@ -383,6 +386,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)
{

View File

@ -63,7 +63,10 @@
#include "llviewerregion.h"
#include "llviewerobjectlist.h"
#include "llviewermessage.h"
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b)
#include "rlvhandler.h"
#include "rlvui.h"
// [/RLVa:KB]
///----------------------------------------------------------------------------
/// Class LLTaskInvFVBridge
@ -398,12 +401,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))
{
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))
{
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()))
{
@ -669,6 +705,19 @@ 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())
@ -1070,6 +1119,15 @@ 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())) )
{
RlvUIEnabler::notifyBlockedViewXXX(LLAssetType::AT_SCRIPT);
return;
}
// [/RLVa:KB]
if (object->permModify() || gAgent.isGodlike())
{
LLLiveLSLEditor* preview = LLFloaterReg::showTypedInstance<LLLiveLSLEditor>("preview_scriptedit", LLSD(mUUID), TAKE_FOCUS_YES);
@ -1128,6 +1186,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())) )
{
RlvUIEnabler::notifyBlockedViewXXX(LLAssetType::AT_NOTECARD);
return;
}
// [/RLVa:KB]
if(object->permModify() || gAgent.isGodlike())
{
LLPreviewNotecard* preview = LLFloaterReg::showTypedInstance<LLPreviewNotecard>("preview_notecard", LLSD(mUUID), TAKE_FOCUS_YES);

View File

@ -56,6 +56,12 @@ public:
static LLSidepanelAppearance* getAppearanceSP();
// [RLVa:KB] - Checked: 2010-08-24 (RLVa-1.2.1a) | Added: RLVa-1.2.1a
LLTabContainer* getAppearanceTabs() { return mAppearanceTabs; }
LLOutfitsList* getMyOutfitsPanel() { return mMyOutfitsPanel; }
LLPanelWearing* getCurrentOutfitPanel() { return mCurrentOutfitPanel; }
// [/RLVa:KB]
static LLPanelOutfitsInventory* findInstance();
protected:

View File

@ -60,6 +60,9 @@
#include "llvoiceclient.h"
#include "llworld.h"
#include "llspeakers.h"
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d)
#include "rlvhandler.h"
// [/RLVa:KB]
#define FRIEND_LIST_UPDATE_TIMEOUT 0.5
#define NEARBY_LIST_UPDATE_INTERVAL 1
@ -532,6 +535,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.0d) | Added: RLVa-1.2.0d
mNearbyList->setRlvCheckShowNames(true);
// [/RLVa:KB]
mRecentList = getChild<LLPanel>(RECENT_TAB_NAME)->getChild<LLAvatarList>("avatar_list");
mRecentList->setNoItemsCommentText(getString("no_recent_people"));
@ -827,7 +833,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.0h) | 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);
@ -837,6 +847,13 @@ void LLPanelPeople::updateButtons()
bool enable_calls = LLVoiceClient::getInstance()->isVoiceWorking() && LLVoiceClient::getInstance()->voiceEnabled();
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | 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

View File

@ -53,6 +53,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;

View File

@ -62,7 +62,9 @@
#include "llspinctrl.h"
#include "roles_constants.h"
#include "llgroupactions.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b)
#include "rlvhandler.h"
// [/RLVa:KB]
U8 string_value_to_click_action(std::string p_value);
std::string click_action_to_string_value( U8 action);
@ -329,8 +331,9 @@ void LLPanelPermissions::refresh()
creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID,
creator_name);
getChild<LLUICtrl>("Creator Name")->setValue(creator_name);
getChildView("Creator Name")->setEnabled(TRUE);
// getChild<LLUICtrl>("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);
@ -358,8 +361,28 @@ void LLPanelPermissions::refresh()
}
}
}
// getChild<LLUICtrl>("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-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.2.1b
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
// Only anonimize 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 == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) )
creator_name = RlvStrings::getAnonym(creator_name);
// Only anonimize 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()) )
owner_name = RlvStrings::getAnonym(owner_name);
}
getChild<LLUICtrl>("Creator Name")->setValue(creator_name);
getChildView("Creator Name")->setEnabled(TRUE);
getChild<LLUICtrl>("Owner Name")->setValue(owner_name);
getChildView("Owner Name")->setEnabled(TRUE);
// [/RLVa:KB]
// update group text field
getChildView("Group:")->setEnabled(TRUE);

View File

@ -49,6 +49,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<LLPanelPlaceProfile> t_place_profile("panel_place_profile");
@ -541,7 +544,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.2.1b) | Added: RLVa-1.2.1b
mYouAreHerePanel->setVisible(is_current_parcel && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)));
// [/RLVa:KB]
getChild<LLAccordionCtrlTab>("sales_tab")->setVisible(for_sale);
}
@ -608,6 +614,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.2.1b) | Added: RLVa-1.2.1b
self->mYouAreHerePanel->setVisible(display_banner && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)));
// [/RLVa:KB]
}
}

View File

@ -53,6 +53,10 @@ 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();
@ -63,7 +67,7 @@ protected:
LLTabContainer* getTabCtrl() { return mTabCtrl; }
const LLUUID& getAvatarId() { return mAvatarId; }
// const LLUUID& getAvatarId() { return mAvatarId; }
void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; }

View File

@ -2116,6 +2116,16 @@ void LLLiveLSLEditor::onLoad(void* userdata)
void LLLiveLSLEditor::onSave(void* userdata, BOOL close_after_save)
{
LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata;
// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a
/*
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(gObjectList.findObject(self->mObjectID), RLV_LOCK_REMOVE)) )
{
return;
}
*/
// [/RLVa:KB]
self->mCloseAfterSave = close_after_save;
self->saveIfNeeded();
}

View File

@ -882,8 +882,18 @@ LLToast* LLScreenChannel::getToastByNotificationID(LLUUID id)
std::vector<ToastElem>::iterator it = find(mStoredToastList.begin(),
mStoredToastList.end(), id);
// if (it == mStoredToastList.end())
// return NULL;
// [SL:KB] - Checked: 2010-04-21 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
// BUGFIX-SL: we need to get the visible toast in LLOfferHandler::processNotification() whether it's "stored" or not
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->toast;
}

View File

@ -87,6 +87,9 @@
#include "llvoavatarself.h"
#include "llvovolume.h"
#include "pipeline.h"
// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0a)
#include "rlvhandler.h"
// [/RLVa:KB]
#include "llglheaders.h"
@ -2736,6 +2739,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;
@ -3048,7 +3061,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");
@ -3502,11 +3518,38 @@ void LLSelectMgr::convertTransient()
void LLSelectMgr::deselectAllIfTooFar()
{
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (!mSelectedObjects->isEmpty()) )
{
struct NotTransientOrFocusedMedia : public LLSelectedNodeFunctor
{
bool apply(LLSelectNode* node)
{
return (node) && (node->getObject()) &&
( (!node->isTransient()) && (node->getObject()->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())
@ -3515,13 +3558,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;
@ -5802,7 +5852,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;
}
@ -5834,7 +5887,12 @@ void LLSelectMgr::deselect()
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::canDuplicate() const
{
return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstCopyableObject() != NULL; // HACK: casting away constness - MG
// return const_cast<LLSelectMgr*>(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<LLSelectMgr*>(this)->mSelectedObjects->getFirstCopyableObject() != NULL) &&
( (!rlv_handler_t::isEnabled()) || (rlvCanDeleteOrReturn()) );
// [/RLVa:KB]
}
//-----------------------------------------------------------------------------
// duplicate()

View File

@ -42,7 +42,9 @@
#include "llviewercontrol.h"
#include "llviewerinventory.h"
#include "llviewerobjectlist.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b)
#include "rlvhandler.h"
// [/RLVa:KB]
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLItemPropertiesObserver
@ -280,6 +282,16 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* 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 anonimize 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<LLUICtrl>("LabelCreatorName")->setValue(name);
}
else
@ -303,8 +315,15 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* 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<LLUICtrl>("LabelOwnerName")->setValue(name);
@ -606,6 +625,17 @@ void LLSidepanelItemInfo::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());
}
}
@ -621,6 +651,10 @@ void LLSidepanelItemInfo::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());
}
}

View File

@ -61,6 +61,9 @@
#include "llspinctrl.h"
#include "roles_constants.h"
#include "llgroupactions.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b)
#include "rlvhandler.h"
// [/RLVa:KB]
///----------------------------------------------------------------------------
/// Class llsidepaneltaskinfo
@ -295,8 +298,9 @@ void LLSidepanelTaskInfo::refresh()
creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID,
creator_name);
getChild<LLUICtrl>("Creator Name")->setValue(creator_name);
getChildView("Creator Name")->setEnabled(TRUE);
// getChild<LLUICtrl>("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);
@ -324,8 +328,28 @@ void LLSidepanelTaskInfo::refresh()
}
}
}
// getChild<LLUICtrl>("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-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
// Only anonimize 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 == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) )
creator_name = RlvStrings::getAnonym(creator_name);
// Only anonimize 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()) )
owner_name = RlvStrings::getAnonym(owner_name);
}
getChild<LLUICtrl>("Creator Name")->setValue(creator_name);
getChildView("Creator Name")->setEnabled(TRUE);
getChild<LLUICtrl>("Owner Name")->setValue(owner_name);
getChildView("Owner Name")->setEnabled(TRUE);
// [/RLVa:KB]
// update group text field
getChildView("Group:")->setEnabled(TRUE);

View File

@ -568,6 +568,12 @@ LLPanel* LLSideTray::openChildPanel(LLSideTrayTab* tab, const std::string& panel
std::string tab_name = tab->getName();
// [RLVa:KB] - Checked: 2010-09-07 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a
// NOTE: - "panel_name" is a name of a panel *inside* of the tab, not the name of the tab that's being switched to
if ( (mValidateSignal) && (!(*mValidateSignal)(tab, LLSD(tab_name))) )
return NULL;
// [/RLVa:KB]
// Select tab and expand Side Tray only when a tab is attached.
if (isTabAttached(tab_name))
{
@ -627,6 +633,11 @@ bool LLSideTray::selectTabByName (const std::string& name)
if (new_tab == mActiveTab)
return false;
// [RLVa:KB] - Checked: 2010-03-01 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a
if ( (mValidateSignal) && (!(*mValidateSignal)(new_tab, LLSD(name))) )
return false;
// [/RLVa:KB]
//deselect old tab
if (mActiveTab)
{
@ -1193,3 +1204,9 @@ void LLSideTray::updateSidetrayVisibility()
}
}
// [RLVa:KB] - Checked: 2010-03-01 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
const LLPanel* LLSideTray::getActiveTab() const
{
return mActiveTab;
}
// [/RLVa:KB]

View File

@ -109,7 +109,11 @@ public:
/*
* get currently active tab
*/
const LLSideTrayTab* getActiveTab() const { return mActiveTab; }
// const LLSideTrayTab* getActiveTab() const { return mActiveTab; }
// [RLVa:KB] - Checked: 2010-03-01 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
// *sighs* LLSideTrayTab is defined in llsidetray.cpp... we can make do with an LLPanel* though
const LLPanel* getActiveTab() const;
// [/RLVa:KB]
/*
* collapse SideBar, hiding visible tab and moving tab buttons
@ -134,6 +138,13 @@ public:
}
LLPanel* getButtonsPanel() { return mButtonsPanel; }
// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
LLButton* getButtonFromName(const std::string& strName)
{
std::map<std::string, LLButton*>::const_iterator itBtn = mTabButtons.find(strName);
return (mTabButtons.end() != itBtn) ? itBtn->second : NULL;
}
// [/RLVa:KB]
bool getCollapsed() { return mCollapsed; }

View File

@ -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";
@ -381,8 +384,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:
{

View File

@ -186,6 +186,10 @@
#include "llavatariconctrl.h"
#include "llvoicechannel.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"
@ -367,6 +371,13 @@ bool idle_startup()
// Initialize stuff that doesn't need data from simulators
//
// [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");
@ -906,6 +917,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:
@ -1664,6 +1687,14 @@ bool idle_startup()
llinfos << "Creating Inventory Views" << llendl;
LLFloaterReg::getInstance("inventory");
// [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 );
return FALSE;
}

View File

@ -84,7 +84,6 @@
// system includes
#include <iomanip>
//
// Globals
//

View File

@ -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
@ -144,8 +147,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.
@ -155,11 +166,23 @@ void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
llassert(!"Invalid current teleport histiry 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();

View File

@ -231,6 +231,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

View File

@ -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;
@ -91,6 +94,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();
@ -115,6 +125,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(),

View File

@ -111,7 +111,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 onTeleportHistoryChange();
bool compareByTitleAndGlobalPos(const LLTeleportHistoryPersistentItem& a, const LLTeleportHistoryPersistentItem& b);

View File

@ -58,6 +58,9 @@
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "llworld.h"
// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.0a)
#include "rlvhandler.h"
// [/RLVa:KB]
// syntactic sugar
#define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember))
@ -1135,6 +1138,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;
@ -1400,6 +1412,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;
@ -1574,6 +1603,14 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(
return ACCEPT_NO;
}
// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a
// RELEASE-RLVa: [SL-2.0.0] This will need revisiting for "ENABLE_MULTIATTACHMENTS"
if ( (rlv_handler_t::isEnabled()) && (!gRlvAttachmentLocks.canAttach(item)) )
{
return ACCEPT_NO_LOCKED;
}
// [/RLVa:KB]
if (drop)
{
if (mSource == SOURCE_LIBRARY)
@ -1599,6 +1636,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.0.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);
@ -1660,6 +1705,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.0.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)
{
@ -1863,6 +1920,13 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem(
return ACCEPT_NO;
}
// [RLVa:KB] - Checked: 2010-03-20 (RLVa-1.2.0c) | Modified: RLVa-1.2.0a
if ( (rlv_handler_t::isEnabled()) && (RLV_WEAR_LOCKED == gRlvWearableLocks.canWear(item)) )
{
return ACCEPT_NO_LOCKED;
}
// [/RLVa:KB]
if (drop)
{
// TODO: investigate wearables may not be loaded at this point EXT-8231

View File

@ -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-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l
if ( (rlv_handler_t::isEnabled()) &&
( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) ||
((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)

View File

@ -57,6 +57,9 @@
#include "llviewerwindow.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;
@ -158,7 +161,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;
@ -428,6 +435,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 )
{

View File

@ -55,7 +55,9 @@
#include "llviewerjoystick.h"
#include "llviewermenu.h"
#include "llviewerparcelmgr.h"
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e)
#include "rlvhandler.h"
// [/RLVa:KB]
// Used when app not active to avoid processing hover.
LLTool* gToolNull = NULL;
@ -291,7 +293,14 @@ void LLToolMgr::toggleBuildMode()
}
}
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.0.0b
// TODO-RLVa: [RLVa-1.2.1] Does this code actually still ever trigger?
if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT))
{
LLSelectMgr::getInstance()->deselectAll();
}
// [/RLVa:KB]
setCurrentToolset(gBasicToolset);
getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );

View File

@ -68,6 +68,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;
@ -184,6 +187,15 @@ BOOL LLToolPie::pickLeftMouseDownCallback()
// 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())
{
@ -293,6 +305,14 @@ BOOL LLToolPie::pickLeftMouseDownCallback()
((object->usePhysics() || (parent && !parent->isAvatar() && parent->usePhysics())) || 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;
LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() );
return LLToolGrab::getInstance()->handleObjectHit( mPick );
@ -405,7 +425,11 @@ ECursorType cursor_from_object(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;
}
@ -500,6 +524,19 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
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();
@ -521,7 +558,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->usePhysics())
|| (parent && !parent->isAvatar() && parent->usePhysics()))
{
@ -861,6 +904,10 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l
if (firstname && lastname)
{
avatar_name = llformat("%s %s", firstname->getString(), lastname->getString());
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
avatar_name = RlvStrings::getAnonym(avatar_name);
// [/RLVa:KB]
}
else
{
@ -869,17 +916,29 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l
// *HACK: We may select this object, so pretend it was clicked
mPick = mHoverPick;
LLInspector::Params p;
p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>());
p.message(avatar_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(0.35f);
p.wrap(false);
LLToolTipMgr::instance().show(p);
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | 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<LLInspector>());
p.message(avatar_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(0.35f);
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(avatar_name);
}
// [/RLVa:KB]
}
}
else
@ -982,22 +1041,33 @@ 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<LLInspector>());
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(0.35f);
p.wrap(false);
LLToolTipMgr::instance().show(p);
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e
if ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canTouch(hover_object, mHoverPick.mObjectOffset)) )
{
// [/RLVa:KB]
LLInspector::Params p;
p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>());
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(0.35f);
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]
}
}
}
@ -1009,6 +1079,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();
@ -1520,16 +1595,29 @@ BOOL LLToolPie::pickRightMouseDownCallback()
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<LLUICtrl>("Avatar Mute")->setValue(mute_msg);
gMenuAttachmentOther->show(x, y);
// [/RLVa:KB]
if (is_other_attachment)
{
gMenuAttachmentOther->getChild<LLUICtrl>("Avatar Mute")->setValue(mute_msg);
gMenuAttachmentOther->show(x, y);
}
else
{
gMenuAvatarOther->getChild<LLUICtrl>("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<LLUICtrl>("Avatar Mute")->setValue(mute_msg);
gMenuAvatarOther->show(x, y);
make_ui_sound("UISndInvalidOp");
}
// [/RLVa:KB]
}
else if (object->isAttachment())
{
@ -1554,10 +1642,24 @@ BOOL LLToolPie::pickRightMouseDownCallback()
mute_msg = LLTrans::getString("MuteObject2");
}
gMenuHolder->getChild<LLUICtrl>("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<LLUICtrl>("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]
}
}

View File

@ -60,6 +60,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; }

View File

@ -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);

View File

@ -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-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l
if (rlv_handler_t::isEnabled())
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT))
{
if (!temp_select)
return LLSelectMgr::getInstance()->getSelection();
else if (LLToolMgr::instance().inBuildMode())
LLToolMgr::instance().toggleBuildMode();
}
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (object) && ((!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::floaterInstanceVisible("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");

View File

@ -61,6 +61,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;

View File

@ -40,6 +40,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"
@ -345,7 +348,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
{

View File

@ -77,6 +77,9 @@
#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "llpostprocess.h"
// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a)
#include "rlvhandler.h"
// [/RLVa:KB]
extern LLPointer<LLViewerTexture> gStartTexture;
@ -908,7 +911,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));

View File

@ -120,7 +120,9 @@
#include "llsyswellwindow.h"
#include "llscriptfloater.h"
// *NOTE: Please add files in alphabetical order to keep merges easy.
// [RLVa:KB] - Checked: 2010-03-11
#include "rlvfloaters.h"
// [/RLVa:KB]
void LLViewerFloaterReg::registerFloaters()
{
@ -227,6 +229,10 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("reporter", "floater_report_abuse.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterReporter>);
LLFloaterReg::add("reset_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterResetQueue>);
LLFloaterReg::add("region_info", "floater_region_info.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRegionInfo>);
// [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<RlvFloaterBehaviours>);
LLFloaterReg::add("rlv_locks", "floater_rlv_locks.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<RlvFloaterLocks>);
// [/RLVa:KB]
LLFloaterReg::add("script_debug", "floater_script_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptDebug>);
LLFloaterReg::add("script_debug_output", "floater_script_debug_panel.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptDebugOutput>);

View File

@ -104,6 +104,10 @@
#include "lleconomy.h"
#include "boost/unordered_map.hpp"
// [RLVa:KB] - Checked: 2010-03-09 (RLVa-1.2.0a)
#include "rlvhandler.h"
// [/RLVa:KB]
using namespace LLVOAvatarDefines;
static boost::unordered_map<std::string, LLStringExplicit> sDefaultItemLabels;
@ -1076,7 +1080,10 @@ class LLAdvancedToggleWireframe : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
gUseWireframe = !(gUseWireframe);
// gUseWireframe = !(gUseWireframe);
// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a
gUseWireframe = (!gUseWireframe) && (!gRlvAttachmentLocks.hasLockedHUD());
// [/RLVa:KB]
LLPipeline::updateRenderDeferred();
gPipeline.resetVertexBuffers();
return true;
@ -2365,6 +2372,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]
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrab);
@ -2468,7 +2484,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()
@ -2695,7 +2715,10 @@ bool enable_object_edit()
}
else if (LLSelectMgr::getInstance()->selectGetAllValidAndObjectsFound())
{
enable = true;
// enable = true;
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e
enable = !gRlvHandler.hasBehaviour(RLV_BHVR_EDIT);
// [/RLVa:KB]
}
return enable;
@ -2728,7 +2751,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;
@ -2771,7 +2797,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
{
@ -2794,6 +2823,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");
@ -3067,6 +3100,14 @@ void handle_avatar_eject(const LLSD& avatar_id)
LLSD payload;
payload["avatar_id"] = avatar->getID();
std::string fullname = avatar->getFullname();
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e)
/*
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) )
{
fullname = RlvStrings::getAnonym(fullname);
}
*/
// [/RLVa:KB]
const LLVector3d& pos = avatar->getPositionGlobal();
LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel();
@ -3154,7 +3195,10 @@ class LLAvatarGiveCard : public view_listener_t
{
llinfos << "handle_give_card()" << llendl;
LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
if(dest && dest->isAvatar())
// if(dest && dest->isAvatar())
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d
if ( (dest && dest->isAvatar()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [/RLVa:KB]
{
bool found_name = false;
LLSD args;
@ -3383,7 +3427,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
@ -3397,7 +3444,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();
}
// Used from the login screen to aid in UI work on side tray
@ -3612,7 +3662,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;
}
};
@ -3650,7 +3703,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;
}
};
@ -3665,6 +3721,16 @@ class LLEnableEditShape : 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.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();
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)
@ -3696,8 +3762,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);
@ -3727,6 +3808,13 @@ class LLLandSit : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c) | Modified: RLVa-1.2.0c
if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SIT))) )
{
return true;
}
// [/RLVa:KB]
gAgent.standUp();
LLViewerParcelMgr::getInstance()->deselectLand();
@ -4173,6 +4261,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->getRoot());
if ( (hSel.notNull()) && (hSel->getFirstRootNode(&f, TRUE)) )
return;
}
// [/RLVa:KB]
const LLUUID category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id);
}
@ -4183,6 +4282,9 @@ class LLObjectReturn : public view_listener_t
bool handleEvent(const LLSD& userdata)
{
if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true;
// [RLVa:KB] - Checked: 2010-03-24 (RLVa-1.2.0e) | Modified: RLVa-1.0.0b
if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) return true;
// [/RLVa:KB]
mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
@ -4250,6 +4352,9 @@ class LLObjectEnableReturn : public view_listener_t
}
}
#endif
// [RLVa:KB] - Checked: 2010-03-24 (RLVa-1.2.0e) | Modified: RLVa-1.0.0b
new_value &= (!rlv_handler_t::isEnabled()) || (rlvCanDeleteOrReturn());
// [/RLVa:KB]
return new_value;
}
};
@ -4265,11 +4370,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;
@ -4382,7 +4490,10 @@ bool confirm_take(const LLSD& notification, const LLSD& response)
// 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;
}
@ -4882,6 +4993,17 @@ class LLToolsEnableUnlink : public view_listener_t
bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
first_editable_object &&
!first_editable_object->isAttachment();
// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.0g
if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) &&
(isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) )
{
// Allow only if the avie isn't sitting on any of the selected objects
LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection();
RlvSelectIsSittingOn f(gAgentAvatarp->getRoot());
if (handleSel->getFirstRootNode(&f, TRUE))
new_value = false;
}
// [/RLVa:KB]
return new_value;
}
};
@ -4890,6 +5012,17 @@ class LLToolsUnlink : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
// [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c) | Modified: RLVa-0.2.0g
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->getRoot());
if ( (hSel.notNull()) && (hSel->getFirstRootNode(&f, TRUE)) )
return true;
}
// [/RLVa:KB]
LLSelectMgr::getInstance()->sendDelink();
return true;
}
@ -4909,8 +5042,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;
}
};
@ -4919,7 +5056,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();
}
};
@ -5195,6 +5336,16 @@ void show_debug_menus()
gMenuBarView->setItemVisible("Advanced", debug);
// gMenuBarView->setItemEnabled("Advanced", debug); // Don't disable Advanced keyboard shortcuts when hidden
// [RLVa:KB] - Checked: 2010-03-09 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
// NOTE: this is supposed to execute whether RLVa is enabled or not
LLMenuGL* pAdvancedMenu = gMenuBarView->findChildMenuByName("Advanced", FALSE);
if (pAdvancedMenu)
{
pAdvancedMenu->setItemVisible("RLVa", rlv_handler_t::isEnabled());
pAdvancedMenu->setItemEnabled("RLVa", rlv_handler_t::isEnabled());
}
// [/RLVa:KB]
gMenuBarView->setItemVisible("Debug", qamode);
gMenuBarView->setItemEnabled("Debug", qamode);
@ -5442,7 +5593,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());
}
@ -5455,7 +5609,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());
}
@ -5468,7 +5625,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());
}
@ -5532,7 +5692,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()
@ -5552,7 +5715,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)
@ -5577,6 +5743,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.0.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();
}
@ -5791,7 +5968,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());
}
@ -5875,6 +6055,19 @@ private:
LLViewerJointAttachment* attachment_point = NULL;
if (index > 0)
attachment_point = get_if_there(gAgentAvatarp->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL);
// [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.2.0e) | Modified: RLVa-1.2.0a
// RELEASE-RLVa: [SL-2.1.2] This will need revisiting when LL deprecates the "MultipleAttachment" debug setting
if ( (rlv_handler_t::isEnabled()) &&
( ((index == 0) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY))) || // Can't wear on default attach point
((index > 0) && (RLV_WEAR_LOCKED == gRlvAttachmentLocks.canAttach(attachment_point))) || // or replace a locked attachment
(gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take"
{
setObjectSelection(NULL); // Clear the selection or it'll get stuck
return true;
}
// [/RLVa:KB]
confirmReplaceAttachment(0, attachment_point);
}
return true;
@ -6019,6 +6212,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)) )
return true;
}
if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ))
{
return true;
}
}
// [/RLVa:KB]
LLSD payload;
LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
@ -6043,7 +6254,10 @@ class LLAttachmentDetachFromPoint : public view_listener_t
bool handleEvent(const LLSD& user_data)
{
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]
{
gMessageSystem->newMessage("ObjectDetach");
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
@ -6055,6 +6269,10 @@ class LLAttachmentDetachFromPoint : public view_listener_t
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;
// [/RLVa:KB]
gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, attached_object->getLocalID());
}
@ -6066,6 +6284,11 @@ class LLAttachmentDetachFromPoint : public view_listener_t
static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data)
{
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
// RELEASE-RLVa: [2010-02-27] This will need rewriting once multiple attachments can be attached to the same point
bool fRlvEnable = true;
bool fRlvHasLockedAttachment = false; // Remove once multiple attachments can be attached to the same point
// [/RLVa:KB]
std::string label;
LLMenuItemGL* menu = dynamic_cast<LLMenuItemGL*>(ctrl);
if (menu)
@ -6081,6 +6304,12 @@ static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data)
const LLViewerObject* attached_object = (*attachment_iter);
if (attached_object)
{
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
// RELEASE-RLVa: [SL-2.0.0] This will need removing for "ENABLE_MULTIATTACHMENTS"
if (rlv_handler_t::isEnabled())
fRlvHasLockedAttachment |= gRlvAttachmentLocks.isLockedAttachment(attached_object);
// [/RLVa:KB]
LLViewerInventoryItem* itemp = gInventory.getItem(attached_object->getAttachmentItemID());
if (itemp)
{
@ -6090,9 +6319,19 @@ static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data)
}
}
}
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
// Remove fHasLockedAttachment once multiple attachments can be attached to the same point
if (rlv_handler_t::isEnabled())
fRlvEnable = (!fRlvHasLockedAttachment) && (!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
@ -6131,6 +6370,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)) )
return true;
}
// [/RLVa:KB]
// The sendDetach() method works on the list of selected
// objects. Thus we need to clear the list, make sure it only
// contains the object the user clicked, send the message,
@ -6216,7 +6466,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;
}
@ -6241,6 +6494,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.0.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)) )
return FALSE;
}
// [/RLVa:KB]
return TRUE;
}
@ -6260,8 +6527,32 @@ 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-03-16 (RLVa-1.2.0e) | Modified: RLVa-1.2.0a
if (rlv_handler_t::isEnabled())
{
if (!isAgentAvatarValid())
return FALSE;
// RELEASE-RLVa: [SL-2.1.1] 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]
// RELEASE-RLVa: [SL-2.1.2] This will need revisiting when LL deprecates the "MultipleAttachment" debug setting
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_LOCKED == gRlvAttachmentLocks.canAttach(pAttachPt))) || // or replace a locked attachment
(gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attach on rezzed object == "Take"
{
return FALSE;
}
}
// [/RLVa:KB]
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
for (LLObjectSelection::root_iterator iter = selection->root_begin();
iter != selection->root_end(); iter++)
@ -6289,9 +6580,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;
}
@ -6311,7 +6605,8 @@ BOOL object_is_wearable()
}
return FALSE;
}
*/
// [/RLVa:KB]
class LLAttachmentPointFilled : public view_listener_t
{
@ -6321,7 +6616,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;
}
@ -6332,7 +6632,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());
}
@ -6345,7 +6648,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());
}
@ -6353,6 +6659,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
@ -6415,6 +6728,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)) )
return true;
}
// [/RLVa:KB]
std::string action = userdata.asString();
bool mono = false;
std::string msg, name;
@ -6515,12 +6839,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 );
}
@ -6722,7 +7064,12 @@ 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;
@ -6876,6 +7223,9 @@ 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-04-07 (RLVa-1.2.0d) | Added: RLVa-1.1.0j
enable_teleport_home &= !gRlvHandler.hasBehaviour(RLV_BHVR_TPLM);
// [/RLVa:KB]
return enable_teleport_home;
}
};
@ -7337,6 +7687,11 @@ class LLViewHighlightTransparent : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.0.0b
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (!LLDrawPoolAlpha::sShowDebugAlpha))
return true;
// [/RLVa:KB]
LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha;
return true;
}
@ -7523,6 +7878,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;
}
@ -7543,8 +7903,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;
}
};
@ -7565,6 +7932,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 LLWearable* pWearable = gAgentWearables.getWearable(type, wearable_index);
if (!gRlvWearableLocks.isLockedWearable(pWearable))
break;
}
if (wearable_index < 0)
return true; // No wearable found that can be removed
}
// [/RLVa:KB]
LLViewerInventoryItem *item = dynamic_cast<LLViewerInventoryItem*>(gAgentWearables.getWearableInventoryItem(type,wearable_index));
LLWearableBridge::removeItemFromAvatar(item);
}
@ -7618,6 +8001,12 @@ class LLWorldEnvSettings : public view_listener_t
return true;
}
// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-1.0.0g
if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV))
{
return true;
} else
// [/RLVa:KB]
if (tod == "sunrise")
{
// set the value, turn off animation
@ -8137,7 +8526,10 @@ void initialize_menus()
commit.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD()));
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 LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend");
@ -8165,7 +8557,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));
@ -8220,4 +8615,12 @@ void initialize_menus()
view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected");
view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
// [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]
}

View File

@ -99,6 +99,11 @@
#include "llagentui.h"
#include "llpanelblockedlist.h"
#include "llpanelplaceprofile.h"
// [RLVa:KB] - Checked: 2010-03-09 (RLVa-1.2.0a)
#include "rlvhandler.h"
#include "rlvinventory.h"
#include "rlvui.h"
// [/RLVa:KB]
#include <boost/algorithm/string/split.hpp> //
#include <boost/regex.hpp>
@ -1376,7 +1381,14 @@ 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.0f) | Added: RLVa-1.2.0f
// RELEASE-RLVa: [RLVa-1.2.0] 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)))
{
LLRecentPeople::instance().add(mFromID);
}
// [/RLVa:KB]
}
}
@ -1447,6 +1459,21 @@ 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
#ifdef RLV_EXTENSION_GIVETORLV_A2A
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);
}
#endif // RLV_EXTENSION_GIVETORLV_A2A
// [/RLVa:KB]
LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(mObjectID, from_string);
open_agent_offer->startFetch();
if(catp || (itemp && itemp->isFinished()))
@ -1611,12 +1638,27 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
}
else
{
std::string first_name, last_name;
if (gCacheName->getName(mFromID, first_name, last_name))
// std::string first_name, last_name;
// if (gCacheName->getName(mFromID, first_name, last_name))
// [RLVa:KB] - Checked: 2010-04-022 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
std::string strFullName;
if (gCacheName->getFullName(mFromID, strFullName))
// [/RLVa:KB]
{
// [RLVa:KB] - Checked: 2010-04-022 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
// RELEASE-RLVa: [RLVa-1.2.0] 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)) )
{
strFullName = RlvStrings::getAnonym(strFullName);
}
from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName
+ LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + first_name + " " + last_name;
chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + first_name + " " + last_name;
+ LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + strFullName;
chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + strFullName;
// [/RLVa:KB]
// from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName
// + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + first_name + " " + last_name;
// chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + first_name + " " + last_name;
}
else
{
@ -1639,6 +1681,26 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
// 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-04-18 (RLVa-1.2.0e) | Modified: RLVa-1.2.0e
// 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()) && (!RlvSettings::getForbidGiveToRLV()) &&
(IM_TASK_INVENTORY_OFFERED == mIM) && (LLAssetType::AT_CATEGORY == mType) && (mDesc.find(RLV_PUTINV_PREFIX) == 1) )
{
const LLViewerInventoryCategory* pRlvRoot = RlvInventory::instance().getSharedRoot();
if (pRlvRoot)
{
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));
@ -1829,6 +1891,15 @@ void inventory_offer_handler(LLOfferInfo* info)
// Object -> Agent Inventory Offer
if (info->mFromObject)
{
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
// 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"] = args["NAME_SLURL"] = RlvStrings::getAnonym(info->mFromName);
}
// [/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
@ -1840,6 +1911,16 @@ void inventory_offer_handler(LLOfferInfo* info)
}
else // Agent -> Agent Inventory Offer
{
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
// 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"] = args["NAME_SLURL"] = RlvStrings::getAnonym(info->mFromName);
}
// [/RLVa:KB]
p.responder = info;
// Note: sets inventory_offer_callback as the callback
// *TODO fix memory leak
@ -2109,7 +2190,18 @@ 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: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0b
else if ( (rlv_handler_t::isEnabled()) && (offline == IM_ONLINE) && ("@version" == message) )
{
// TODO-RLVa: [RLVa-1.2.1] Should we send our version string if the other party is muted?
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-03-23 (RLVa-1.2.0a) | Modified: RLVa-1.0.0g
else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) &&
( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, 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)
@ -2180,6 +2272,23 @@ 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-03-23 (RLVa-1.2.0e) | Modified: RLVa-1.2.0a
// Don't block offline IMs, or IMs from Lindens
if ( (rlv_handler_t::isEnabled()) && (offline != IM_OFFLINE) && (!is_linden) &&
(gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, 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)
{
@ -2191,11 +2300,13 @@ 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)
{
mute_im = true;
}
*/
if (!mute_im || is_linden)
{
gIMMgr->addMessage(
@ -2412,6 +2523,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0];
info->mType = (LLAssetType::EType) bucketp->asset_type;
info->mObjectID = bucketp->object_id;
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
/*
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(from_id)) )
{
name = RlvStrings::getAnonym(name);
}
*/
// [/RLVa:KB]
}
else
{
@ -2462,7 +2582,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_INVENTORY_ACCEPTED:
{
args["NAME"] = name;
// args["NAME"] = name;
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
// Only filter 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"] = (!fRlvFilterName) ? name : RlvStrings::getAnonym(name);
// [/RLVa:KB]
LLSD payload;
payload["from_id"] = from_id;
LLNotificationsUtil::add("InventoryAccepted", args, payload);
@ -2470,7 +2596,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
}
case IM_INVENTORY_DECLINED:
{
args["NAME"] = name;
// args["NAME"] = name;
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
// Only filter 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"] = (!fRlvFilterName) ? name : RlvStrings::getAnonym(name);
// [/RLVa:KB]
LLSD payload;
payload["from_id"] = from_id;
LLNotificationsUtil::add("InventoryDeclined", args, payload);
@ -2498,10 +2630,37 @@ 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) )
{
return;
}
*/
// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0e) | Modified: RLVa-1.2.0a
LLIMModel::LLIMSession* pIMSession = LLIMModel::instance().findIMSession(session_id);
if (!pIMSession)
{
return;
}
if (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM))
{
switch (pIMSession->mSessionType)
{
case LLIMModel::LLIMSession::GROUP_SESSION: // Group chat: allow if group is a sendim exception
if ( (from_id != gAgent.getID()) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, session_id)) )
return;
break;
case LLIMModel::LLIMSession::ADHOC_SESSION: // Conference chat: allow if the sender is a sendim exception
if ( (from_id != gAgent.getID()) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, 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;
@ -2564,6 +2723,30 @@ 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)) )
{
std::string strOwnerName;
if (gCacheName->getFullName(from_id, strOwnerName))
{
query_string["owner"] = LLUUID::null;
query_string["owner_name"] = RlvStrings::getAnonym(strOwnerName);
}
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)
@ -2664,6 +2847,26 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
region_access_icn = LLViewerRegion::getAccessIcon(region_access);
}
// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.0d
if (rlv_handler_t::isEnabled())
{
// Block if: 1) @tplure=n restricted (and sender isn't an exception), or 2) @unsit=n restricted and currently sitting
if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) && (!gRlvHandler.isException(RLV_BHVR_TPLURE, from_id)) ) ||
( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) ) )
{
RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_TPLURE_REMOTE));
return;
}
// Censor lure message if: 1) @revcim=n restricted (and sender isn't an exception), or 2) @showloc=n restricted
if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) ||
(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
{
message = RlvStrings::getString(RLV_STRING_HIDDEN);
}
}
// [/RLVa:KB]
LLSD args;
// *TODO: Translate -> [FIRST] [LAST] (maybe)
args["NAME_SLURL"] = LLSLURL("agent", from_id, "about").getSLURLString();
@ -2675,10 +2878,23 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
payload["lure_id"] = session_id;
payload["godlike"] = FALSE;
LLNotification::Params params("TeleportOffered");
params.substitutions = args;
params.payload = payload;
LLPostponedNotification::add<LLPostponedOfferNotification>( params, from_id, false);
LLNotification::Params params("TeleportOffered");
params.substitutions = args;
params.payload = payload;
// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-0.2.0b
if ( (rlv_handler_t::isEnabled()) &&
((gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP)) || (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id))) )
{
gRlvHandler.setCanCancelTp(false);
LLNotifications::instance().forceResponse(LLNotification::Params("TeleportOffered").payload(payload), 0);
}
else
{
LLPostponedNotification::add<LLPostponedOfferNotification>( params, from_id, false);
}
// [/RLVa:KB]
// LLPostponedNotification::add<LLPostponedOfferNotification>( params, from_id, false);
}
}
break;
@ -2963,9 +3179,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<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
psc->setSourceObject(chatter);
@ -2998,6 +3219,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;
// 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) ) )
{
if (!RlvUtil::isEmote(mesg))
{
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id)) )
gRlvHandler.filterChat(mesg, false);
}
else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id)) )
{
mesg = "/me ...";
}
}
// Filtering "rules":
// avatar => filter only their name (unless it's this avie)
// other => filter everything except attachments this avie owns but then we still do filter their text
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
((CHAT_SOURCE_AGENT != chat.mSourceType) || (chat.mFromID != gAgent.getID())) )
{
if (CHAT_SOURCE_AGENT == chat.mSourceType)
{
chat.mFromName = RlvStrings::getAnonym(from_name);
chat.mRlvNamesFiltered = TRUE;
}
else if ( (!is_owned_by_me) || (!is_attachment) )
{
RlvUtil::filterNames(chat.mFromName);
}
}
// 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; std::string strOwnerName, strQuery;
sdQuery["name"] = chat.mFromName;
sdQuery["owner"] = owner_id;
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
(!is_owned_by_me) && (gCacheName->getFullName(owner_id, strOwnerName)) )
{
sdQuery["owner"] = LLUUID::null;
sdQuery["owner_name"] = RlvStrings::getAnonym(strOwnerName);
}
const LLViewerRegion* pRegion = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent);
if (pRegion)
{
sdQuery["slurl"] = LLSLURL(pRegion->getName(), LLVector3d(chat.mPosAgent)).getSLURLString();
}
strQuery = LLURI::mapToQueryString(sdQuery);
chat.mURL = LLSLURL("objectim", from_id, strQuery).getSLURLString();
}
}
// [/RLVa:KB]
BOOL ircstyle = FALSE;
// Look for IRC-style emotes here so chatbubbles work
@ -3047,8 +3337,99 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
case CHAT_TYPE_WHISPER:
verb = 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<char>(",", "", 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()) )
{
verb = " executes: @";
mesg = strExecuted;
}
else if ( (strExecuted.empty()) && (!strFailed.empty()) && (strRetained.empty()) )
{
verb = " failed: @";
mesg = strFailed;
}
else if ( (strExecuted.empty()) && (strFailed.empty()) && (!strRetained.empty()) )
{
verb = " retained: @";
mesg = strRetained;
}
else
{
verb = ": @";
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<LLViewerPartSourceChat> 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:
verb = "";
break;
@ -3129,7 +3510,10 @@ void process_teleport_start(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);
}
@ -3164,7 +3548,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);
}
@ -5353,7 +5740,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);
@ -5361,7 +5748,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)");
@ -5566,8 +5961,32 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
payload["object_name"] = object_name;
payload["owner_name"] = owner_name;
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0e
S32 rlvQuestionsOther = questions;
if (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTPERMISSION))
{
const LLViewerObject* pObj = gObjectList.findObject(taskid);
if (pObj)
{
// if (pObj->permYouOwner())
// {
// PERMISSION_TAKE_CONTROLS and PERMISSION_ATTACH are only auto-granted to objects this avie owns
rlvQuestionsOther &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS] |
LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]);
// }
}
}
if ( (!caution) && (!rlvQuestionsOther) )
{
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"))
{
// display the caution permissions prompt
LLNotificationsUtil::add(caution ? "ScriptQuestionCaution" : "ScriptQuestion", args, payload);
@ -5915,6 +6334,22 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response)
if(0 == option)
{
// [RLVa:KB] - Checked: 2010-04-09 (RLVa-1.2.0e) | Modified: RLVa-0.2.0b
if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM))
{
// Filter the teleport offer text unless everyone is a sendim exception
for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray();
it != notification["payload"]["ids"].endArray(); ++it)
{
if (!gRlvHandler.isException(RLV_BHVR_SENDIM, it->asUUID()))
{
text = RlvStrings::getString(RLV_STRING_HIDDEN);
break;
}
}
}
// [/RLVa:KB]
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_StartLure);
msg->nextBlockFast(_PREHASH_AgentData);
@ -5969,13 +6404,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<LLUUID>::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())

View File

@ -99,6 +99,9 @@
#include "lltrans.h"
#include "llsdutil.h"
#include "llmediaentry.h"
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b)
#include "rlvhandler.h"
// [/RLVa:KB]
//#define DEBUG_UPDATE_TYPE
@ -1093,6 +1096,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
coloru.mV[3] = 255 - coloru.mV[3];
mText->setColor(LLColor4(coloru));
mText->setStringUTF8(temp_string);
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Added: RLVa-1.0.0f
if (rlv_handler_t::isEnabled())
{
mText->setObjectText(temp_string);
}
// [/RLVa:KB]
if (mDrawable.notNull())
{
@ -1485,6 +1494,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
coloru.mV[3] = 255 - coloru.mV[3];
mText->setColor(LLColor4(coloru));
mText->setStringUTF8(temp_string);
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Added: RLVa-1.0.0f
if (rlv_handler_t::isEnabled())
{
mText->setObjectText(temp_string);
}
// [/RLVa:KB]
setChanged(TEXTURE);
}
@ -1655,6 +1670,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())
@ -4897,7 +4931,10 @@ BOOL LLViewerObject::permTransfer() const
// given you modify rights to. JC
BOOL LLViewerObject::allowOpen() const
{
return !flagInventoryEmpty() && (permYouOwner() || permModify());
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.0.0b
return !flagInventoryEmpty() && (permYouOwner() || permModify()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT));
// [/RLVa:KB]
// return !flagInventoryEmpty() && (permYouOwner() || permModify());
}
LLViewerObject::LLInventoryCallbackInfo::~LLInventoryCallbackInfo()

View File

@ -328,7 +328,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; }

View File

@ -198,6 +198,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 <tchar.h> // For Unicode conversion methods
#endif
@ -3178,6 +3182,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();
@ -3445,17 +3458,42 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de
}
else // check ALL objects
{
{
found = gPipeline.lineSegmentIntersectInHUD(mouse_hud_start, mouse_hud_end, pick_transparent,
face_hit, intersection, uv, normal, binormal);
if (!found) // if not found in HUD, look in world:
// [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,
face_hit, intersection, uv, normal, binormal);
}
// [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;

View File

@ -85,6 +85,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"
@ -2756,12 +2759,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.0d) | 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.0d) | 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())
@ -2781,7 +2790,18 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
new_name = TRUE;
}
if (sRenderGroupTitles != mRenderGroupTitles)
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d) | 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;
@ -2904,27 +2924,38 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
)
{
std::string line;
if (!sRenderGroupTitles)
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d) | Added: RLVa-0.2.0b
if (!fRlvShowNames)
{
// If all group titles are turned off, stack first name
// on a line above last name
line += firstname->getString();
line += "\n";
}
else if (title && title->getString() && title->getString()[0] != '\0')
{
line += title->getString();
LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR);
line += "\n";
line += firstname->getString();
// [/RLVa:KB]
if (!sRenderGroupTitles)
{
// If all group titles are turned off, stack first name
// on a line above last name
line += firstname->getString();
line += "\n";
}
else if (title && title->getString() && title->getString()[0] != '\0')
{
line += title->getString();
LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR);
line += "\n";
line += firstname->getString();
}
else
{
line += firstname->getString();
}
line += " ";
line += lastname->getString();
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d) | Added: RLVa-0.2.0b
}
else
{
line += firstname->getString();
line = RlvStrings::getAnonym(line.assign(firstname->getString()).append(" ").append(lastname->getString()));
}
line += " ";
line += lastname->getString();
// [/RLVa:KB]
BOOL need_comma = FALSE;
if (is_away || is_muted || is_busy)
@ -5718,6 +5749,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]
}
}

View File

@ -57,6 +57,9 @@
#include "llviewerstats.h"
#include "llviewerregion.h"
#include "llappearancemgr.h"
// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0a)
#include "rlvhandler.h"
// [/RLVa:KB]
#if LL_MSVC
// disable boost::lexical_cast warning
@ -326,6 +329,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<LLMenuItemCallGL>(item_params);
@ -400,6 +404,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<LLMenuItemCallGL>(item_params);
@ -443,6 +448,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:
@ -509,6 +515,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;
@ -1068,6 +1075,20 @@ LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id)
return NULL;
}
// [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);
@ -1105,6 +1126,18 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view
LLAppearanceMgr::instance().registerAttachment(attachment_id);
// Clear any pending requests once the attachment arrives.
removeAttachmentRequest(attachment_id);
// [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 (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;
@ -1114,6 +1147,23 @@ 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);
}
}
}
// [/RLVa:KB]
if (LLVOAvatar::detachObject(viewer_object))
{
// the simulator should automatically handle permission revocation
@ -1146,6 +1196,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;
@ -1155,7 +1210,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);

View File

@ -289,6 +289,9 @@ 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);

View File

@ -63,6 +63,9 @@
#include "llmediadataclient.h"
#include "llagent.h"
#include "llviewermediafocus.h"
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d)
#include "rlvhandler.h"
// [/RLVa:KB]
const S32 MIN_QUIET_FRAMES_COALESCE = 30;
const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
@ -3222,7 +3225,12 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
{
LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects)
// if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects)
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d) | Modified: RLVa-1.0.5a
const LLViewerObject* pObj = facep->getViewerObject();
if ( (pObj->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) &&
((!rlv_handler_t::isEnabled()) || (!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj))) )
// [/RVLa:KB]
{
return;
}

View File

@ -37,6 +37,9 @@
#include "lltransutil.h"
#include "llviewerattachmenu.h"
#include "llvoavatarself.h"
// [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1a)
#include "rlvhandler.h"
// [/RLVa:KB]
class LLFindOutfitItems : public LLInventoryCollectFunctor
{
@ -833,6 +836,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;
@ -873,6 +883,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;
@ -880,10 +913,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);
@ -893,7 +931,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);

View File

@ -58,6 +58,12 @@ class LLWearableDictionary : public LLSingleton<LLWearableDictionary>,
{
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()
@ -94,6 +100,10 @@ const std::string& LLWearableType::getTypeName(LLWearableType::EType type)
{
const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
const WearableEntry *entry = dict->lookup(type);
// [RLVa:KB] - Checked: 2010-05-15 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
if (!entry)
entry = dict->lookup(WT_INVALID);
// [/RLVa:KB]
return entry->mName;
}
@ -102,6 +112,10 @@ const std::string& LLWearableType::getTypeDefaultNewName(LLWearableType::EType t
{
const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
const WearableEntry *entry = dict->lookup(type);
// [RLVa:KB] - Checked: 2010-05-15 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
if (!entry)
entry = dict->lookup(WT_INVALID);
// [/RLVa:KB]
return entry->mDefaultNewName;
}
@ -110,6 +124,10 @@ const std::string& LLWearableType::getTypeLabel(LLWearableType::EType type)
{
const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
const WearableEntry *entry = dict->lookup(type);
// [RLVa:KB] - Checked: 2010-05-15 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
if (!entry)
entry = dict->lookup(WT_INVALID);
// [/RLVa:KB]
return entry->mLabel;
}
@ -118,6 +136,10 @@ LLAssetType::EType LLWearableType::getAssetType(LLWearableType::EType type)
{
const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
const WearableEntry *entry = dict->lookup(type);
// [RLVa:KB] - Checked: 2010-05-15 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
if (!entry)
entry = dict->lookup(WT_INVALID);
// [/RLVa:KB]
return entry->mAssetType;
}
@ -126,6 +148,10 @@ LLInventoryIcon::EIconName LLWearableType::getIconName(LLWearableType::EType typ
{
const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
const WearableEntry *entry = dict->lookup(type);
// [RLVa:KB] - Checked: 2010-05-15 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
if (!entry)
entry = dict->lookup(WT_INVALID);
// [/RLVa:KB]
return entry->mIconName;
}

Some files were not shown because too many files have changed in this diff Show More