Merged with RLVa update tip

Kitty Barnett 2016-06-24 00:48:37 +02:00
commit a21ad8481e
77 changed files with 2294 additions and 717 deletions

View File

@ -1366,17 +1366,6 @@
<key>Backup</key>
<integer>0</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>
<boolean>0</boolean>
</map>
<key>RLVaTopLevelMenu</key>
<map>
<key>Comment</key>

View File

@ -777,7 +777,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
report_to_nearby_chat(llformat("Object with key %s not found!", target_key.asString().c_str()));
return false;
}
if ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canSit(myObject, LLVector3::zero)))
if ((!RlvActions::isRlvEnabled()) || (RlvActions::canSit(myObject, LLVector3::zero)))
{
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_AgentRequestSit);

View File

@ -2312,7 +2312,10 @@ std::ostream& operator<<(std::ostream &s, const LLAgent &agent)
//-----------------------------------------------------------------------------
BOOL LLAgent::needsRenderAvatar()
{
if (gAgentCamera.cameraMouselook() && !LLVOAvatar::sVisibleInFirstPerson)
// if (gAgentCamera.cameraMouselook() && !LLVOAvatar::sVisibleInFirstPerson)
// [RLVa:KB] - Checked: RLVa-2.0.2
if ( (gAgentCamera.cameraMouselook() && !LLVOAvatar::sVisibleInFirstPerson) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWSELF)) )
// [/RLVa:KB]
{
return FALSE;
}
@ -2323,7 +2326,10 @@ BOOL LLAgent::needsRenderAvatar()
// TRUE if we need to render your own avatar's head.
BOOL LLAgent::needsRenderHead()
{
return (LLVOAvatar::sVisibleInFirstPerson && LLPipeline::sReflectionRender) || (mShowAvatar && !gAgentCamera.cameraMouselook());
// [RLVa:KB] - Checked: RLVa-2.0.2
return ((LLVOAvatar::sVisibleInFirstPerson && LLPipeline::sReflectionRender) || (mShowAvatar && !gAgentCamera.cameraMouselook())) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWSELFHEAD));
// [/RLVa:KB]
// return (LLVOAvatar::sVisibleInFirstPerson && LLPipeline::sReflectionRender) || (mShowAvatar && !gAgentCamera.cameraMouselook());
}
//-----------------------------------------------------------------------------
@ -4777,7 +4783,7 @@ void LLAgent::teleportViaLocation(const LLVector3d& pos_global)
// [RLVa:KB] - Checked: RLVa-2.0.0
if ( (RlvActions::isRlvEnabled()) && (!RlvUtil::isForceTp()) )
{
if ( (RlvActions::isLocalTp(pos_global)) ? !RlvActions::canTeleportToLocal() : !RlvActions::canTeleportToLocation() )
if ( (RlvActions::isLocalTp(pos_global)) ? !RlvActions::canTeleportToLocal(pos_global) : !RlvActions::canTeleportToLocation() )
{
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT);
return;
@ -4857,7 +4863,7 @@ void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global, const LLVe
{
if ( (RlvActions::isRlvEnabled()) && (!RlvUtil::isForceTp()) )
{
if ( (RlvActions::isLocalTp(pos_global)) ? !RlvActions::canTeleportToLocal() : !RlvActions::canTeleportToLocation() )
if ( (RlvActions::isLocalTp(pos_global)) ? !RlvActions::canTeleportToLocal(pos_global) : !RlvActions::canTeleportToLocation() )
{
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT);
return;

View File

@ -217,10 +217,18 @@ void LLAgentCamera::init()
mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("CameraOffsetRearView");
mCameraOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("CameraOffsetFrontView");
mCameraOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("CameraOffsetGroupView");
// [RLVa:KB] - Checked: RLVa-2.0.0
mCameraOffsetInitial[CAMERA_RLV_SETCAM_VIEW] = gSavedSettings.declareVec3("CameraOffsetRLVaView", LLVector3(mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW]->getDefault()), "Declared in code", LLControlVariable::PERSIST_NO);
mCameraOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->setHiddenFromSettingsEditor(true);
// [/RLVa:KB]
mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("FocusOffsetRearView");
mFocusOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("FocusOffsetFrontView");
mFocusOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("FocusOffsetGroupView");
// [RLVa:KB] - Checked: RLVa-2.0.0
mFocusOffsetInitial[CAMERA_RLV_SETCAM_VIEW] = gSavedSettings.declareVec3("FocusOffsetRLVaView", LLVector3(mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW]->getDefault()), "Declared in code", LLControlVariable::PERSIST_NO);
mFocusOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->setHiddenFromSettingsEditor(true);
// [/RLVa:KB]
mCameraCollidePlane.clearVec();
mCurrentCameraDistance = getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale");
@ -830,7 +838,13 @@ void LLAgentCamera::setCameraZoomFraction(F32 fraction)
LLVector3d camera_offset_dir = mCameraFocusOffsetTarget;
camera_offset_dir.normalize();
mCameraFocusOffsetTarget = camera_offset_dir * rescale(fraction, 0.f, 1.f, max_zoom, min_zoom);
// [RLVa:KB] - Checked: 2.0.0
const LLVector3d focus_offset_target = camera_offset_dir * rescale(fraction, 0.f, 1.f, max_zoom, min_zoom);
if ( (RlvActions::isRlvEnabled()) && (!allowFocusOffsetChange(focus_offset_target)) )
return;
mCameraFocusOffsetTarget = focus_offset_target;
// [/RLVa:KB]
// mCameraFocusOffsetTarget = camera_offset_dir * rescale(fraction, 0.f, 1.f, max_zoom, min_zoom);
}
startCameraAnimation();
}
@ -962,6 +976,11 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction)
new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM );
}
// [RLVa:KB] - Checked: 2.0.0
if ( (RlvActions::isRlvEnabled()) && (!allowFocusOffsetChange(new_distance * camera_offset_unit)) )
return;
// [/RLVa:KB]
mCameraFocusOffsetTarget = new_distance * camera_offset_unit;
}
@ -1033,6 +1052,11 @@ void LLAgentCamera::cameraOrbitIn(const F32 meters)
new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM );
}
// [RLVa:KB] - Checked: 2.0.0
if ( (RlvActions::isRlvEnabled()) && (!allowFocusOffsetChange(new_distance * camera_offset_unit)) )
return;
// [/RLVa:KB]
// Compute new camera offset
mCameraFocusOffsetTarget = new_distance * camera_offset_unit;
cameraZoomIn(1.f);
@ -1177,6 +1201,14 @@ void LLAgentCamera::updateCamera()
mCameraUpVector = LLVector3::z_axis;
//LLVector3 camera_skyward(0.f, 0.f, 1.f);
// [RLVa:KB] - Checked: RLVa-2.0.0
// Set focus back on our avie if something changed it
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_UNLOCK)) && (cameraThirdPerson()) && (!getFocusOnAvatar()) )
{
setFocusOnAvatar(TRUE, FALSE);
}
// [/RLVa:KB]
U32 camera_mode = mCameraAnimating ? mLastCameraMode : mCameraMode;
validateFocusObject();
@ -1957,6 +1989,44 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
// }
// [RLVa:KB] - Checked: RLVa-2.0.0
if ( (CAMERA_MODE_THIRD_PERSON == mCameraMode) && (RlvActions::isRlvEnabled()) && (RlvActions::isCameraDistanceClamped()) )
{
m_fRlvMinDist = m_fRlvMaxDist = false;
// Av-locked | Focus-locked | Result
// ===================================================
// T | T | skip focus => slam av
// T | F | skip focus => slam av
// F | T | skip av => slam focus
// F | F | clamp focus then av
bool fCamAvDistClamped, fCamAvDistLocked = false; float nCamAvDistLimitMin, nCamAvDistLimitMax;
if (fCamAvDistClamped = RlvActions::getCameraAvatarDistanceLimits(nCamAvDistLimitMin, nCamAvDistLimitMax))
fCamAvDistLocked = nCamAvDistLimitMin == nCamAvDistLimitMax;
bool fCamOriginDistClamped, fCamOriginDistLocked = false; float nCamOriginDistLimitMin, nCamOriginDistLimitMax;
if (fCamOriginDistClamped = RlvActions::getCameraOriginDistanceLimits(nCamOriginDistLimitMin, nCamOriginDistLimitMax))
fCamOriginDistLocked = nCamOriginDistLimitMin == nCamOriginDistLimitMax;
// Check focus distance limits
if ( (fCamOriginDistClamped) && (!fCamAvDistLocked) )
{
const LLVector3 offsetCameraLocal = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale");
const LLVector3d offsetCamera(gAgent.getFrameAgent().rotateToAbsolute(offsetCameraLocal));
const LLVector3d posFocusCam = frame_center_global + head_offset + offsetCamera;
if (clampCameraPosition(camera_position_global, posFocusCam, nCamOriginDistLimitMin, nCamOriginDistLimitMax))
isConstrained = TRUE;
}
// Check avatar distance limits
if ( (fCamAvDistClamped) && (fCamAvDistLocked || !fCamOriginDistClamped) )
{
const LLVector3d posAvatarCam = gAgent.getPosGlobalFromAgent( (isAgentAvatarValid()) ? gAgentAvatarp->mHeadp->getWorldPosition() : gAgent.getPositionAgent() );
if (clampCameraPosition(camera_position_global, posAvatarCam, nCamAvDistLimitMin, nCamAvDistLimitMax))
isConstrained = TRUE;
}
}
// [/RLVa:KB]
// Don't let camera go underground
F32 camera_min_off_ground = getCameraMinOffGround();
@ -1977,6 +2047,49 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
return camera_position_global;
}
// [RLVa:KB] - Checked: RLVa-2.0.0
bool LLAgentCamera::allowFocusOffsetChange(const LLVector3d& offsetFocus)
{
if (RlvActions::isCameraDistanceClamped())
{
if ( (CAMERA_MODE_THIRD_PERSON == getCameraMode()) && ((m_fRlvMinDist) || (m_fRlvMaxDist)) )
{
const LLVector3d posFocusGlobal = calcFocusPositionTargetGlobal();
// Don't allow moving the focus offset if at minimum and moving closer (or if at maximum and moving further) to prevent camera warping
F32 nCurDist = llabs((posFocusGlobal + mCameraFocusOffsetTarget - m_posRlvRefGlobal).magVec());
F32 nNewDist = llabs((posFocusGlobal + offsetFocus - m_posRlvRefGlobal).magVec());
if ( ((m_fRlvMaxDist) && (nNewDist > nCurDist)) || ((m_fRlvMinDist) && (nNewDist < nCurDist)) )
return false;
}
}
return true;
}
bool LLAgentCamera::clampCameraPosition(LLVector3d& posCamGlobal, const LLVector3d posCamRefGlobal, float nDistMin, float nDistMax)
{
const LLVector3d offsetCamera = posCamGlobal - posCamRefGlobal;
F32 nCamAvDist = llabs(offsetCamera.magVec()), nDistMult = NAN;
if (nCamAvDist > nDistMax)
{
nDistMult = nDistMax / nCamAvDist;
m_fRlvMaxDist = true;
}
else if (nCamAvDist < nDistMin)
{
nDistMult = nDistMin / nCamAvDist;
m_fRlvMinDist = true;
}
if (!isnan(nDistMult))
{
posCamGlobal = posCamRefGlobal + nDistMult * offsetCamera;
m_posRlvRefGlobal = posCamRefGlobal;
return true;
}
return false;
}
// [/RLVa:KB]
LLVector3 LLAgentCamera::getCameraOffsetInitial()
{
@ -2110,6 +2223,10 @@ void LLAgentCamera::resetCamera()
void LLAgentCamera::changeCameraToMouselook(BOOL animate)
{
if (!gSavedSettings.getBOOL("EnableMouselook")
// [RLVa:KB] - Checked: RLVa-2.0.0
|| ( (RlvActions::isRlvEnabled()) && (!RlvActions::canChangeToMouselook()) )
// [/RLVa:KB]
|| LLViewerJoystick::getInstance()->getOverrideCamera())
{
return;
@ -2404,6 +2521,26 @@ void LLAgentCamera::changeCameraToCustomizeAvatar()
void LLAgentCamera::switchCameraPreset(ECameraPreset preset)
{
// [RLVa:KB] - Checked: RLVa-2.0.0
if (RlvActions::isRlvEnabled())
{
// Don't allow changing away from the our view if an object is restricting it
if (RlvActions::isCameraPresetLocked())
preset = CAMERA_RLV_SETCAM_VIEW;
// Don't reset anything if our view is already current
if ( (CAMERA_RLV_SETCAM_VIEW == preset) && (CAMERA_RLV_SETCAM_VIEW == mCameraPreset) )
return;
// Reset our view when switching away
if (CAMERA_RLV_SETCAM_VIEW != preset)
{
mCameraOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->resetToDefault();
mFocusOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->resetToDefault();
}
}
// [/RLVa:KB]
//zoom is supposed to be reset for the front and group views
mCameraZoomFraction = 1.f;

View File

@ -56,7 +56,12 @@ enum ECameraPreset
CAMERA_PRESET_FRONT_VIEW,
/** "Above and to the left, over the shoulder, pulled back a little on the zoom" */
CAMERA_PRESET_GROUP_VIEW
CAMERA_PRESET_GROUP_VIEW,
// [RLVa:KB] - Checked: RLVa-2.0.0
/* Used by RLVa */
CAMERA_RLV_SETCAM_VIEW
// [/RLVa:KB]
};
//------------------------------------------------------------------------
@ -305,6 +310,18 @@ public:
F32 mHUDTargetZoom; // Target zoom level for HUD objects (used when editing)
F32 mHUDCurZoom; // Current animated zoom level for HUD objects
// [RLVa:KB] - Checked: RLVa-2.0.0
//--------------------------------------------------------------------
// RLVa
//--------------------------------------------------------------------
protected:
bool allowFocusOffsetChange(const LLVector3d& offsetFocus);
bool clampCameraPosition(LLVector3d& posCamGlobal, const LLVector3d posCamRefGlobal, float nDistMin, float nDistMax);
bool m_fRlvMaxDist; // True if the camera is at max distance
bool m_fRlvMinDist; // True if the camera is at min distance
LLVector3d m_posRlvRefGlobal; // Current reference point for distance calculations
// [/RLVa:KB]
/********************************************************************************
** **

View File

@ -186,7 +186,7 @@ void LLAgentListener::requestSit(LLSD const & event_data) const
// [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)) )
if ( (rlv_handler_t::isEnabled()) && (!RlvActions::canSit(object)) )
{
return;
}

View File

@ -617,8 +617,8 @@ void LLAvatarActions::teleportRequest(const LLUUID& id)
LLSD notification;
notification["uuid"] = id;
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
notification["NAME"] = LLSLURL("agent", id, (RlvActions::canShowName(RlvActions::SNC_TELEPORTREQUEST)) ? "completename" : "rlvanonym").getSLURLString();
// [RLVa:KB] - Checked: RLVa-1.5.0
notification["NAME"] = LLSLURL("agent", id, (RlvActions::canShowName(RlvActions::SNC_TELEPORTREQUEST, id)) ? "completename" : "rlvanonym").getSLURLString();
// [/RLVa:KB]
// LLAvatarName av_name;
// if (!LLAvatarNameCache::get(id, &av_name))

View File

@ -49,8 +49,8 @@
#include "lltooldraganddrop.h"
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a)
#include "rlvhandler.h"
#include "rlvactions.h"
// [/RLVa:KB]
static LLDefaultChildRegistry::Register<LLAvatarList> r("avatar_list");
// Last interaction time update period.
@ -185,7 +185,7 @@ LLAvatarList::LLAvatarList(const Params& p)
, mShowProfileBtn(p.show_profile_btn)
, mShowSpeakingIndicator(p.show_speaking_indicator)
, mShowPermissions(p.show_permissions_granted)
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
, mRlvCheckShowNames(false)
// [/RLVa:KB]
, mShowVoiceVolume(p.show_voice_volume)
@ -581,7 +581,7 @@ S32 LLAvatarList::notifyParent(const LLSD& info)
void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
{
LLAvatarListItem* item = new LLAvatarListItem();
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
item->setRlvCheckShowNames(mRlvCheckShowNames);
// [/RLVa:KB]
@ -610,7 +610,7 @@ BOOL LLAvatarList::handleRightMouseDown(S32 x, S32 y, MASK mask)
BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask);
// if ( mContextMenu && !isAvalineItemSelected())
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) | Modified: RLVa-1.2.0d
if ( (mContextMenu && !isAvalineItemSelected()) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) )
if ( (mContextMenu && !isAvalineItemSelected()) && ((!mRlvCheckShowNames) || (!RlvActions::hasBehaviour(RLV_BHVR_SHOWNAMES))) )
// [/RLVa:KB]
{
uuid_vec_t selected_uuids;
@ -735,7 +735,7 @@ void LLAvatarList::onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask)
{
// mItemDoubleClickSignal(ctrl, x, y, mask);
// [RLVa:KB] - Checked: 2010-06-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
if ( (!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
if ( (!mRlvCheckShowNames) || (!RlvActions::hasBehaviour(RLV_BHVR_SHOWNAMES)) )
mItemDoubleClickSignal(ctrl, x, y, mask);
// [/RLVa:KB]
}
@ -744,7 +744,7 @@ void LLAvatarList::onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask)
// static
std::string LLAvatarList::getNameForDisplay(const LLAvatarName& av_name, bool show_displayname, bool show_username, bool rlv_check_shownames)
{
bool fRlvFilter = (rlv_check_shownames) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
bool fRlvFilter = (rlv_check_shownames) && (RlvActions::hasBehaviour(RLV_BHVR_SHOWNAMES));
if (show_displayname && !show_username)
{
return ( (!fRlvFilter) ? av_name.getDisplayName() : RlvStrings::getAnonym(av_name) );

View File

@ -102,7 +102,7 @@ public:
// Return true if filter has at least one match.
bool filterHasMatches();
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
void setRlvCheckShowNames(bool fRlvCheckShowNames) { mRlvCheckShowNames = fRlvCheckShowNames; }
// We need this to be public since we call it from RlvUIEnabler::onToggleShowNames()
void updateAvatarNames();
@ -151,7 +151,7 @@ private:
bool mShowVoiceVolume;
bool mShowSpeakingIndicator;
bool mShowPermissions;
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - RLVa-1.2.0
bool mRlvCheckShowNames;
// [/RLVa:KB]
bool mShowDisplayName;

View File

@ -42,8 +42,9 @@
#include "llavatariconctrl.h"
#include "lloutputmonitorctrl.h"
#include "lltooldraganddrop.h"
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
#include <time.h>
#include "llnotificationsutil.h"
@ -87,7 +88,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
mOnlineStatus(E_UNKNOWN),
mShowInfoBtn(true),
mShowProfileBtn(true),
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
mRlvCheckShowNames(false),
// [/RLVa:KB]
mShowPermissions(false),
@ -232,9 +233,10 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask)
// <FS:AO>, removed on-hover visibility. Don't do this. instead flip info buttons on full-time in postbuild.
// mInfoBtn->setVisible(mShowInfoBtn);
// mProfileBtn->setVisible(mShowProfileBtn);
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
//mInfoBtn->setVisible( (mShowInfoBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) );
//mProfileBtn->setVisible( (mShowProfileBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) );
// [RLVa:KB] - Checked: RLVa-1.2.0
//bool fRlvCanShowName = (!mRlvCheckShowNames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mAvatarId));
//mInfoBtn->setVisible( (mShowInfoBtn) && (fRlvCanShowName) );
//mProfileBtn->setVisible( (mShowProfileBtn) && (fRlvCanShowName) );
// [/RLVa:KB]
mHovered = true;
@ -422,13 +424,13 @@ void LLAvatarListItem::setLastInteractionTime(U32 secs_since)
void LLAvatarListItem::setShowInfoBtn(bool show)
{
mShowInfoBtn = show;
mInfoBtn->setVisible( (mShowInfoBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) );
mInfoBtn->setVisible( (mShowInfoBtn) && ((!mRlvCheckShowNames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mAvatarId))) );
}
void LLAvatarListItem::setShowVoiceVolume(bool show)
{
mShowVoiceVolume = show;
mVoiceSlider->setVisible( (mShowVoiceVolume) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) );
mVoiceSlider->setVisible( (mShowVoiceVolume) && ((!mRlvCheckShowNames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mAvatarId))) );
if (show)
{
updateVoiceLevelSlider();
@ -509,7 +511,7 @@ void LLAvatarListItem::onProfileBtnClick()
BOOL LLAvatarListItem::handleDoubleClick(S32 x, S32 y, MASK mask)
{
// if(mInfoBtn->getRect().pointInRect(x, y))
// [SL:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
// [RVLa:KB] - Checked: RLVa-1.2.2
if ( (mInfoBtn->getVisible()) && (mInfoBtn->getEnabled()) && (mInfoBtn->getRect().pointInRect(x, y)) )
// [/SL:KB]
{
@ -517,7 +519,7 @@ BOOL LLAvatarListItem::handleDoubleClick(S32 x, S32 y, MASK mask)
return TRUE;
}
// if(mProfileBtn->getRect().pointInRect(x, y))
// [SL:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
if ( (mProfileBtn->getVisible()) && (mProfileBtn->getEnabled()) && (mProfileBtn->getRect().pointInRect(x, y)) )
// [/SL:KB]
{
@ -580,22 +582,21 @@ void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name)
mAvatarNameCacheConnection.disconnect();
// setAvatarName(av_name.getDisplayName());
// setAvatarToolTip(av_name.getUserName());
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
// <FS:Ansa> Centralized in LLAvatarList::getNameForDisplay!
bool fRlvFilter = (mRlvCheckShowNames) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
bool fRlvCanShowName = (!mRlvCheckShowNames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mAvatarId));
//if (mShowDisplayName && !mShowUsername)
// setAvatarName( (!fRlvFilter) ? av_name.getDisplayName() : RlvStrings::getAnonym(av_name) );
// setAvatarName( (fRlvCanShowName) ? av_name.getDisplayName() : RlvStrings::getAnonym(av_name) );
//else if (!mShowDisplayName && mShowUsername)
// setAvatarName( (!fRlvFilter) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) );
// setAvatarName( (fRlvCanShowName) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) );
//else
// setAvatarName( (!fRlvFilter) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name) );
// setAvatarName( (fRlvCanShowName) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name) );
setAvatarName(LLAvatarList::getNameForDisplay(av_name, mShowDisplayName, mShowUsername, mRlvCheckShowNames));
// NOTE: If you change this, you will break sorting the contacts list
// by username unless you go change the comparator too. -- TS
setAvatarToolTip( (!fRlvFilter) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) );
// TODO-RLVa: bit of a hack putting this here. Maybe find a better way?
mAvatarIcon->setDrawTooltip(!fRlvFilter);
mAvatarIcon->setDrawTooltip(fRlvCanShowName);
// [/RLVa:KB]
//KC - store the username for use in sorting

View File

@ -116,7 +116,7 @@ public:
void setShowPermissions(bool show);
void showLastInteractionTime(bool show);
void setAvatarIconVisible(bool visible);
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
void setRlvCheckShowNames(bool fRlvCheckShowNames);
void updateRlvRestrictions();
// [/RLVa:KB]
@ -252,7 +252,7 @@ private:
bool mShowInfoBtn;
bool mShowVoiceVolume;
bool mShowProfileBtn;
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
bool mRlvCheckShowNames;
// [/RLVa:KB]
std::string mUserName; //KC - username cache used for sorting

View File

@ -337,10 +337,16 @@ void LLDrawPoolTerrain::renderFullShader()
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
LLViewerTexture *detail_texture0p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[0] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
LLViewerTexture *detail_texture1p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[1] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
LLViewerTexture *detail_texture2p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[2] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
LLViewerTexture *detail_texture3p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[3] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
// [/SL:KB]
// LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
// LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
// LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
// LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal();
F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale;
@ -488,10 +494,16 @@ void LLDrawPoolTerrain::renderFull4TU()
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
LLViewerTexture *detail_texture0p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[0] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
LLViewerTexture *detail_texture1p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[1] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
LLViewerTexture *detail_texture2p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[2] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
LLViewerTexture *detail_texture3p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[3] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
// [/SL:KB]
// LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
// LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
// LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
// LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal();
F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale;
@ -690,10 +702,16 @@ void LLDrawPoolTerrain::renderFull2TU()
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
LLViewerTexture *detail_texture0p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[0] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
LLViewerTexture *detail_texture1p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[1] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
LLViewerTexture *detail_texture2p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[2] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
LLViewerTexture *detail_texture3p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[3] : LLViewerFetchedTexture::sDefaultDiffuseImagep;
// [/SL:KB]
// LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
// LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
// LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
// LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal();
F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale;

View File

@ -98,7 +98,10 @@ void LLDrawPoolTree::render(S32 pass)
LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1);
LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
gGL.getTexUnit(sDiffTex)->bind(mTexturep);
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
gGL.getTexUnit(sDiffTex)->bind( (LLPipeline::sRenderTextures) ? mTexturep : LLViewerFetchedTexture::sDefaultDiffuseImagep );
// [/SL:KB]
// gGL.getTexUnit(sDiffTex)->bind(mTexturep);
for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
iter != mDrawFace.end(); iter++)

View File

@ -53,6 +53,9 @@
#include "llviewershadermgr.h"
#include "llviewertexture.h"
#include "llvoavatar.h"
// [RLVa:KB] - Checked: RLVa-2.0.0
#include "rlvhandler.h"
// [/RLVa:KB]
#if LL_LINUX
// Work-around spurious used before init warning on Vector4a
@ -166,6 +169,10 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
mBoundingSphereRadius = 0.0f ;
mHasMedia = FALSE ;
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
mShowDiffTexture = true;
// [/SL:KB]
}
void LLFace::destroy()
@ -282,6 +289,14 @@ void LLFace::setTexture(U32 ch, LLViewerTexture* tex)
return ;
}
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
if ( (LLRender::DIFFUSE_MAP == ch) && (!mShowDiffTexture) )
{
mOrigDiffTexture = tex;
return;
}
// [/SL:KB]
if(mTexture[ch].notNull())
{
mTexture[ch]->removeFace(ch, this) ;
@ -2698,9 +2713,60 @@ LLViewerTexture* LLFace::getTexture(U32 ch) const
{
llassert(ch < LLRender::NUM_TEXTURE_CHANNELS);
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
// Check whether the diffuse texture needs to be obscured or restored
if (mShowDiffTexture != LLPipeline::sRenderTextures)
setDefaultTexture(LLRender::DIFFUSE_MAP, !LLPipeline::sRenderTextures);
// [/SL:KB]
return mTexture[ch] ;
}
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
void LLFace::setDefaultTexture(U32 nChannel, bool fShowDefault) const
{
bool fUpdated = false;
if ( (LLRender::DIFFUSE_MAP == nChannel) && (mVObjp) && (!mVObjp->isDead()) && ((LL_PCODE_VOLUME == mVObjp->getPCode()) || (LLViewerObject::LL_VO_PART_GROUP == mVObjp->getPCode())) )
{
if ( ((mShowDiffTexture) && (fShowDefault)) ||
((!mShowDiffTexture) && (fShowDefault) && (mOrigDiffTexture.notNull()) && (mTexture[nChannel]) && (mTexture[nChannel]->getID() != LLViewerFetchedTexture::sDefaultDiffuseImagep->getID())) )
{
if (mOrigDiffTexture.notNull())
mShowDiffTexture = true; // Swap out the default texture
else
mOrigDiffTexture = mTexture[nChannel]; // Cache the original texture
if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_TEXTURES)) || (!mVObjp->isAttachment()) )
{
if (LL_PCODE_VOLUME == mVObjp->getPCode())
const_cast<LLFace*>(this)->switchTexture(nChannel, LLViewerFetchedTexture::sDefaultDiffuseImagep);
else
const_cast<LLFace*>(this)->setTexture(nChannel, LLViewerFetchedTexture::sDefaultDiffuseImagep);
}
mShowDiffTexture = false; fUpdated = true;
}
else if ( (!mShowDiffTexture) && (!fShowDefault) && (mOrigDiffTexture.notNull()) )
{
mShowDiffTexture = true;
if (LL_PCODE_VOLUME == mVObjp->getPCode())
const_cast<LLFace*>(this)->switchTexture(nChannel, mOrigDiffTexture);
else
const_cast<LLFace*>(this)->setTexture(nChannel, mOrigDiffTexture);
mOrigDiffTexture = nullptr; fUpdated = true;
}
if ((fUpdated) && (mDrawablep))
{
gPipeline.markTextured(mDrawablep);
const_cast<LLDrawable*>(mDrawablep.get())->updateTexture();
}
}
// Always flip the flag even if we didn't obscure so we don't keep wasting cycles with negative checks
mShowDiffTexture = !fShowDefault;
}
// [/SL:KB]
void LLFace::setVertexBuffer(LLVertexBuffer* buffer)
{
mVertexBuffer = buffer;

View File

@ -220,6 +220,10 @@ public:
BOOL switchTexture() ;
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
void setDefaultTexture(U32 nChannel, bool fShowDefault) const;
// [/SL:KB]
//vertex buffer tracking
void setVertexBuffer(LLVertexBuffer* buffer);
void clearVertexBuffer(); //sets mVertexBuffer to NULL
@ -294,7 +298,11 @@ private:
F32 mBoundingSphereRadius ;
bool mHasMedia ;
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
mutable bool mShowDiffTexture;
mutable LLPointer<LLViewerTexture> mOrigDiffTexture;
// [/SL:KB]
protected:
static BOOL sSafeRenderSelect;

View File

@ -408,6 +408,7 @@ void LLFloaterAvatarPicker::onList()
RLV_ASSERT( (pTabs) && (pNearMePanel) );
if ( (pTabs) && (pNearMePanel) )
{
// TODO-RLVa: check this for RlvActions::canShowName()
bool fRlvEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
pTabs->enableTabButton(pTabs->getIndexForPanel(pNearMePanel), fRlvEnable);
if ( (!fRlvEnable) && (pTabs->getCurrentPanel() == pNearMePanel) )

View File

@ -104,7 +104,10 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info)
// Clean up the lists...
floater->reset();
floater->mSaleInfo = sale_info;
floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
// [RLVa:KB] - Checked: RLVa-2.0.0
floater->mObjectSelection = LLSelectMgr::getInstance()->getSelection();
// [/RLVa:KB]
// floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
LLSelectNode* node = selection->getFirstRootNode();
if (!node)

View File

@ -104,7 +104,10 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info)
if (list)
list->deleteAllItems();
floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
// [RLVa:KB] - Checked: RLVa-2.0.0
floater->mObjectSelection = LLSelectMgr::getInstance()->getSelection();
// [/RLVa:KB]
// floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
LLUUID owner_id;
std::string owner_name;

View File

@ -71,6 +71,7 @@
#include "llautoreplace.h"
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b)
#include "rlvhandler.h"
#include "rlvactions.h"
// [/RLVa:KB]
S32 LLFloaterIMNearbyChat::sLastSpecialChatChannel = 0;
@ -876,7 +877,7 @@ void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channe
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)) )
if (!RlvActions::canSendChannel(channel))
return;
// Don't allow chat on debug channel if @sendchat, @redirchat or @rediremote restricted (shows as public chat on viewers)

View File

@ -46,8 +46,9 @@
#include "llrootview.h"
#include "lllayoutstack.h"
// [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.0f)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.0
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
#include "fsconsoleutils.h"
@ -551,16 +552,16 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
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())
if (RlvActions::isRlvEnabled())
{
// NOTE-RLVa: we can only filter the *message* here since most everything else will already be part of "args" as well
LLChat& tmp_chat = const_cast<LLChat&>(chat_msg);
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!tmp_chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) )
if ( (!RlvActions::canShowLocation()) && (!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) )
if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) )
{
RlvUtil::filterNames(tmp_chat.mText);
tmp_chat.mRlvNamesFiltered = TRUE;
@ -664,8 +665,8 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
LLFirstUse::otherAvatarChatFirst();
// Add sender to the recent people list.
// [RLVa:KB] - Checked: 2012-03-15 (RLVa-1.4.6) | Added: RLVa-1.4.6
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
// [RLVa:KB] - Checked: RLVa-2.0.0
if ( (!RlvActions::isRlvEnabled()) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, chat_msg.mFromID)) )
LLRecentPeople::instance().add(chat_msg.mFromID);
// [/RLVa:KB]
// LLRecentPeople::instance().add(chat_msg.mFromID);
@ -765,8 +766,8 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
LLUUID id;
id.generate();
chat["id"] = id;
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
if (rlv_handler_t::isEnabled())
// [RLVa:KB] - Checked: RLVa-1.2.0
if (RlvActions::isRlvEnabled())
chat["show_icon_tooltip"] = !chat_msg.mRlvNamesFiltered;
// [/RLVa:KB]
std::string r_color_name = "White";

View File

@ -42,9 +42,10 @@
#include "llviewercontrol.h"
#include "llviewerobject.h"
#include "lluictrlfactory.h"
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a)
#include "rlvhandler.h"
#include "llagent.h"
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvcommon.h"
#include "rlvui.h"
// [/RLVa:KB]
//LLFloaterInspect* LLFloaterInspect::sInstance = NULL;
@ -105,11 +106,13 @@ void LLFloaterInspect::onOpen(const LLSD& key)
mObjectSelection = LLSelectMgr::getInstance()->getSelection();
refresh();
}
void LLFloaterInspect::onClickCreatorProfile()
// [RLVa:KB] - Checked: RLVa-2.0.1
const LLSelectNode* LLFloaterInspect::getSelectedNode() /*const*/
{
if(mObjectList->getAllSelected().size() == 0)
{
return;
return NULL;
}
LLScrollListItem* first_selected =mObjectList->getFirstSelected();
@ -124,41 +127,29 @@ void LLFloaterInspect::onClickCreatorProfile()
return (obj_id == node->getObject()->getID());
}
} func(first_selected->getUUID());
LLSelectNode* node = mObjectSelection->getFirstNode(&func);
return mObjectSelection->getFirstNode(&func);
}
return NULL;
}
void LLFloaterInspect::onClickCreatorProfile()
{
const LLSelectNode* node = getSelectedNode();
if(node)
{
// LLAvatarActions::showProfile(node->mPermissions->getCreator());
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e
// Only anonymize the creator if they're also the owner or if they're a nearby avie
const LLUUID& idCreator = node->mPermissions->getCreator();
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
((node->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator))) )
if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) && ((node->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator))) )
{
return;
}
LLAvatarActions::showProfile(idCreator);
// [/RLVa:KB]
}
}
}
void LLFloaterInspect::onClickOwnerProfile()
{
if(mObjectList->getAllSelected().size() == 0) return;
LLScrollListItem* first_selected =mObjectList->getFirstSelected();
if (first_selected)
{
LLUUID selected_id = first_selected->getUUID();
struct f : public LLSelectedNodeFunctor
{
LLUUID obj_id;
f(const LLUUID& id) : obj_id(id) {}
virtual bool apply(LLSelectNode* node)
{
return (obj_id == node->getObject()->getID());
}
} func(selected_id);
LLSelectNode* node = mObjectSelection->getFirstNode(&func);
const LLSelectNode* node = getSelectedNode();
if(node)
{
if(node->mPermissions->isGroupOwned())
@ -169,30 +160,108 @@ void LLFloaterInspect::onClickOwnerProfile()
else
{
const LLUUID& owner_id = node->mPermissions->getOwner();
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
return;
// [/RLVa:KB]
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, owner_id))
return;
LLAvatarActions::showProfile(owner_id);
}
}
}
}
void LLFloaterInspect::onSelectObject()
{
if(LLFloaterInspect::getSelectedUUID() != LLUUID::null)
{
// getChildView("button owner")->setEnabled(true);
// getChildView("button creator")->setEnabled(true);
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e
getChildView("button owner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// TODO-RLVa: [RLVa-1.2.2] Is it worth checking the selected node just to selectively disable this button?
getChildView("button creator")->setEnabled(true);
// [/RLVa:KB]
if (!RlvActions::isRlvEnabled())
{
getChildView("button owner")->setEnabled(true);
getChildView("button creator")->setEnabled(true);
}
else
{
const LLSelectNode* node = getSelectedNode();
const LLUUID& idOwner = (node) ? node->mPermissions->getOwner() : LLUUID::null;
const LLUUID& idCreator = (node) ? node->mPermissions->getCreator() : LLUUID::null;
// See LLFloaterInspect::onClickCreatorProfile()
getChildView("button owner")->setEnabled( (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idOwner)) || ((node) && (node->mPermissions->isGroupOwned())) );
// See LLFloaterInspect::onClickOwnerProfile()
getChildView("button creator")->setEnabled( ((idOwner != idCreator) && (!RlvUtil::isNearbyAgent(idCreator))) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) );
}
}
}
// [/RLVa:KB]
//void LLFloaterInspect::onClickCreatorProfile()
//{
// if(mObjectList->getAllSelected().size() == 0)
// {
// return;
// }
// LLScrollListItem* first_selected =mObjectList->getFirstSelected();
//
// if (first_selected)
// {
// struct f : public LLSelectedNodeFunctor
// {
// LLUUID obj_id;
// f(const LLUUID& id) : obj_id(id) {}
// virtual bool apply(LLSelectNode* node)
// {
// return (obj_id == node->getObject()->getID());
// }
// } func(first_selected->getUUID());
// LLSelectNode* node = mObjectSelection->getFirstNode(&func);
// if(node)
// {
// LLAvatarActions::showProfile(node->mPermissions->getCreator());
// }
// }
//}
//void LLFloaterInspect::onClickOwnerProfile()
//{
// if(mObjectList->getAllSelected().size() == 0) return;
// LLScrollListItem* first_selected =mObjectList->getFirstSelected();
//
// if (first_selected)
// {
// LLUUID selected_id = first_selected->getUUID();
// struct f : public LLSelectedNodeFunctor
// {
// LLUUID obj_id;
// f(const LLUUID& id) : obj_id(id) {}
// virtual bool apply(LLSelectNode* node)
// {
// return (obj_id == node->getObject()->getID());
// }
// } func(selected_id);
// LLSelectNode* node = mObjectSelection->getFirstNode(&func);
// if(node)
// {
// if(node->mPermissions->isGroupOwned())
// {
// const LLUUID& idGroup = node->mPermissions->getGroup();
// LLGroupActions::show(idGroup);
// }
// else
// {
// const LLUUID& owner_id = node->mPermissions->getOwner();
// LLAvatarActions::showProfile(owner_id);
// }
//
// }
// }
//}
//void LLFloaterInspect::onSelectObject()
//{
// if(LLFloaterInspect::getSelectedUUID() != LLUUID::null)
// {
// getChildView("button owner")->setEnabled(true);
// getChildView("button creator")->setEnabled(true);
// }
//}
LLUUID LLFloaterInspect::getSelectedUUID()
{
@ -278,12 +347,11 @@ void LLFloaterInspect::refresh()
// actual name and set a placeholder.
if (LLAvatarNameCache::get(idOwner, &av_name))
{
// owner_name = av_name.getCompleteName();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idOwner != gAgent.getID()) &&
(!obj->mPermissions->isGroupOwned());
owner_name = (!fRlvFilterOwner) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvCanShowName = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idOwner)) || (obj->mPermissions->isGroupOwned());
owner_name = (fRlvCanShowName) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB]
// owner_name = av_name.getCompleteName();
}
else
{
@ -298,14 +366,12 @@ void LLFloaterInspect::refresh()
if (LLAvatarNameCache::get(idCreator, &av_name))
{
// creator_name = av_name.getCompleteName();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-2.0.1
const LLUUID& idCreator = obj->mPermissions->getCreator();
LLAvatarNameCache::get(idCreator, &av_name);
bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idCreator != gAgent.getID()) &&
( (obj->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator)) );
creator_name = (!fRlvFilterCreator) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
bool fRlvCanShowName = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) || ( (obj->mPermissions->getOwner() != idCreator) && (!RlvUtil::isNearbyAgent(idCreator)) );
creator_name = (fRlvCanShowName) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB]
// creator_name = av_name.getCompleteName();
}
else
{
@ -316,7 +382,7 @@ void LLFloaterInspect::refresh()
}
mCreatorNameCacheConnection = LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::onGetCreatorNameCallback, this));
}
row["id"] = obj->getObject()->getID();
row["columns"][0]["column"] = "object_name";
row["columns"][0]["type"] = "text";

View File

@ -36,6 +36,9 @@
class LLObjectSelection;
class LLScrollListCtrl;
class LLUICtrl;
// [RLVa:KB] - Checked: RLVa-2.0.1
class LLSelectNode;
// [/RLVa:KB]
class LLFloaterInspect : public LLFloater
{
@ -61,6 +64,10 @@ protected:
void setDirty() { mDirty = TRUE; }
bool mDirty;
// [RLVa:KB] - Checked: RLVa-2.0.1
const LLSelectNode* getSelectedNode() /*const*/;
// [/RLVa:KB]
private:
void onGetOwnerNameCallback();
void onGetCreatorNameCallback();

View File

@ -59,8 +59,9 @@
#include "lluictrlfactory.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
#include "llviewernetwork.h" // <FS:CR> For OpenSim export perms
#include "llexperiencecache.h"
@ -306,11 +307,10 @@ 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
// [RLVa:KB] - Checked: RLVa-2.0.1
// If the object creator matches the object owner we need to anonymize the creator field as well
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) ||
(RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) )
if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, item->getCreatorUUID())) &&
( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) )
{
childSetEnabled("BtnCreator", FALSE);
name = RlvStrings::getAnonym(name);
@ -331,6 +331,9 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
////////////////
if(perm.isOwned())
{
// [RLVa:KB] - Checked: RVLa-2.0.1
bool fRlvCanShowOwner = true;
// [/RLVa:KB]
std::string name;
if (perm.isGroupOwned())
{
@ -339,14 +342,18 @@ 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] - Checked: RLVa-2.0.1
if (RlvActions::isRlvEnabled())
{
fRlvCanShowOwner = RlvActions::canShowName(RlvActions::SNC_DEFAULT, perm.getOwner());
if (!fRlvCanShowOwner)
name = RlvStrings::getAnonym(name);
}
// [/RLVa:KB]
}
// 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] - Checked: RLVa-2.0.1
getChildView("BtnOwner")->setEnabled(fRlvCanShowOwner);
// [/RLVa:KB]
getChildView("LabelOwnerTitle")->setEnabled(TRUE);
getChildView("LabelOwnerName")->setEnabled(TRUE);
@ -616,12 +623,12 @@ 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))
// [RLVa:KB] - Checked: RLVa-1.2.1
const LLUUID& idCreator = item->getCreatorUUID();
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) )
{
const LLPermissions& perm = item->getPermissions();
if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) ||
(RlvUtil::isNearbyAgent(item->getCreatorUUID())) )
if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == idCreator) ) || (RlvUtil::isNearbyAgent(idCreator)) )
{
return;
}
@ -642,8 +649,8 @@ 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))
// [RLVa:KB] - Checked: RLVa-1.0.0
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, item->getPermissions().getOwner())) )
return;
// [/RLVa:KB]
LLAvatarActions::showProfile(item->getPermissions().getOwner());

View File

@ -61,6 +61,10 @@
#include "chatbar_as_cmdline.h" // <ND/> For FIRE-1624
// [RLVa:KB] - Checked: RLVa-2.0.0
#include "rlvactions.h"
// [/RLVa:KB]
// Longest time, in seconds, to wait for all animations to stop playing
const F32 MAX_WAIT_ANIM_SECS = 60.f;
@ -532,6 +536,11 @@ void LLGestureMgr::playGesture(LLMultiGesture* gesture)
{
if (!gesture) return;
// [RLVa:KB] - Checked: RLVa-2.0.0 | Handles: @sendgesture
if (!RlvActions::canPlayGestures())
return;
// [/RLVa:KB]
// Reset gesture to first step
gesture->mCurrentStep = 0;

View File

@ -46,9 +46,10 @@
#include "llrecentpeople.h"
#include "llviewerobjectlist.h"
#include "llvoavatarself.h"
// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.2a)
// [RLVa:KB] - Checked: RLVa-1.2.2
#include "llavatarnamecache.h"
#include "rlvhandler.h"
#include "rlvactions.h"
#include "rlvcommon.h"
#include "rlvui.h"
// [/RLVa:KB]
#include "llworld.h" // <FS:CR> Aurora Sim
@ -326,9 +327,8 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im
{
gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args);
}
// [RLVa:KB] - Checked: 2010-05-26 (RLVa-1.2.2a) | Modified: RLVa-1.2.0h
else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(to_agent)) &&
(!RlvUIEnabler::hasOpenProfile(to_agent)) )
// [RLVa:KB] - Checked: RLVa-1.2.0
else if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, to_agent)) && (RlvUtil::isNearbyAgent(to_agent)) && (!RlvUIEnabler::hasOpenProfile(to_agent)) )
{
// Log to chat history if the user didn't drop on an IM session or a profile to avoid revealing the name of the recipient
std::string strMsgName = "inventory_item_offered-im"; LLSD args; LLAvatarName avName;
@ -462,10 +462,10 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent,
// add buddy to recent people list
// LLRecentPeople::instance().add(to_agent);
// [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.2a) | Added: RLVa-1.2.0f
// [RLVa:KB] - Checked: RLVa-2.0.0
// 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)) )
if ( (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, to_agent)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || (RlvUIEnabler::hasOpenProfile(to_agent)) )
{
LLRecentPeople::instance().add(to_agent);
}
@ -536,10 +536,10 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent,
// add buddy to recent people list
// LLRecentPeople::instance().add(to_agent);
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0f
// [RLVa:KB] - Checked: RLVa-2.0.0
// 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)) )
if ( (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, to_agent)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || (RlvUIEnabler::hasOpenProfile(to_agent)) )
{
LLRecentPeople::instance().add(to_agent);
}

View File

@ -64,7 +64,9 @@
#include "llspatialpartition.h"
#include "llviewershadermgr.h"
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e)
#include "rlvactions.h"
#include "rlvhandler.h"
#include "rlvhelper.h"
// [/RLVa:KB]
// Height of the yellow selection highlight posts for land
@ -167,13 +169,15 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.0.0g
if (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))
{
static RlvCachedBehaviourModifier<float> s_nFartouchDist(RLV_MODIFIER_FARTOUCHDIST);
// 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;
F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + s_nFartouchDist;
F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - s_nFartouchDist;
new_near = llmax(new_near, 0.1f);
@ -182,7 +186,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
// Usurp these two
limit_select_distance = TRUE;
select_dist_squared = 1.5f * 1.5f;
select_dist_squared = s_nFartouchDist * s_nFartouchDist;
}
// [/RLVa:KB]
LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION,
@ -269,7 +273,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
}
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Added: RLVa-1.3.0c
if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canEdit(vobjp)) )
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canEdit(vobjp)) )
{
continue;
}

View File

@ -46,7 +46,8 @@
#include "llstatusbar.h"
#include "llmenugl.h"
#include "pipeline.h"
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a)
// [RLVa:KB] - Checked: RLVa-1.4.0
#include "rlvactions.h"
#include "rlvhandler.h"
// [/RLVa:KB]
#include <boost/tokenizer.hpp>
@ -260,14 +261,14 @@ void LLHUDText::setString(const std::string &text_utf8)
// addLine(text_utf8, mColor);
// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.4.0a) | Modified: RLVa-1.0.0f
// NOTE: setString() is called for debug and map beacons as well
if (rlv_handler_t::isEnabled())
if (RlvActions::isRlvEnabled())
{
std::string text(text_utf8);
if (gRlvHandler.canShowHoverText(mSourceObject))
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
if (!RlvActions::canShowLocation())
RlvUtil::filterLocation(text);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT))
RlvUtil::filterNames(text);
}
else

View File

@ -39,6 +39,7 @@
#include "llviewermediafocus.h"
#include "llviewerobjectlist.h" // to select the requested object
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0c)
#include "rlvactions.h"
#include "rlvhandler.h"
#include "lltoolpie.h"
// [/RLVa:KB]
@ -401,7 +402,7 @@ void LLInspectObject::updateSitLabel(LLSelectNode* nodep)
if (rlv_handler_t::isEnabled())
{
const LLPickInfo& pick = LLToolPie::getInstance()->getPick();
sit_btn->setEnabled( (pick.mObjectID.notNull()) && (gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset)) );
sit_btn->setEnabled( (pick.mObjectID.notNull()) && (RlvActions::canSit(pick.getObject(), pick.mObjectOffset)) );
}
// [/RLVa:KB]
}
@ -501,12 +502,10 @@ void LLInspectObject::updateCreator(LLSelectNode* nodep)
LLUUID creator_id = nodep->mPermissions->getCreator();
// std::string creator_url =
// LLSLURL("agent", creator_id, "about").getSLURLString();
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
// Only anonymize the creator if they're also the owner or if they're a nearby avie
bool fRlvHideCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
((nodep->mPermissions->getOwner() == creator_id) || (RlvUtil::isNearbyAgent(creator_id)));
std::string creator_url =
LLSLURL("agent", creator_id, (!fRlvHideCreator) ? "about" : "rlvanonym").getSLURLString();
bool fRlvHideCreator = (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, creator_id)) && ((nodep->mPermissions->getOwner() == creator_id) || (RlvUtil::isNearbyAgent(creator_id)));
const std::string creator_url = LLSLURL("agent", creator_id, (!fRlvHideCreator) ? "about" : "rlvanonym").getSLURLString();
// [/RLVa:KB]
args["[CREATOR]"] = creator_url;
@ -523,8 +522,8 @@ void LLInspectObject::updateCreator(LLSelectNode* nodep)
{
owner_id = nodep->mPermissions->getOwner();
// owner_url = LLSLURL("agent", owner_id, "about").getSLURLString();
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
bool fRlvHideOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [RLVa:KB] - Checked: RLVa-1.2.2
bool fRlvHideOwner = (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, owner_id));
owner_url = LLSLURL("agent", owner_id, (!fRlvHideOwner) ? "about" : "rlvanonym").getSLURLString();
// [/RLVa:KB]
}

View File

@ -74,8 +74,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] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
#include "llmutelist.h"
#include "lfsimfeaturehandler.h"
@ -677,7 +678,7 @@ void LLNetMap::draw()
// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f | FS-Specific
LLWorldMapView::drawAvatar(
pos_map.mV[VX], pos_map.mV[VY],
((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? color : map_avatar_color.get()),
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, uuid)) ? color : map_avatar_color.get(),
pos_map.mV[VZ], mDotRadius,
unknown_relative_z);
// [/RLVa:KB]
@ -995,26 +996,17 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask )
// If the cursor is near an avatar on the minimap, a mini-inspector will be
// shown for the avatar, instead of the normal map tooltip.
// if (handleToolTipAgent(mClosestAgentToCursor))
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (handleToolTipAgent(mClosestAgentToCursor)) )
// [RLVa:KB] - Checked: RLVa-1.2.2
bool fRlvCanShowName = (mClosestAgentToCursor.notNull()) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mClosestAgentToCursor));
if ( (fRlvCanShowName) && (handleToolTipAgent(mClosestAgentToCursor)) )
// [/RLVa:KB]
{
return TRUE;
}
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
LLStringUtil::format_map_t args;
LLAvatarName avName;
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
(mClosestAgentToCursor.notNull()) && (LLAvatarNameCache::get(mClosestAgentToCursor, &avName)) )
{
args["[AGENT]"] = RlvStrings::getAnonym(avName) + "\n";
}
else
{
args["[AGENT]"] = "";
}
// [RLVa:KB] - Checked: RLVa-1.2.2
LLStringUtil::format_map_t args; LLAvatarName avName;
args["[AGENT]"] = ( (!fRlvCanShowName) && (mClosestAgentToCursor.notNull()) && (LLAvatarNameCache::get(mClosestAgentToCursor, &avName)) ) ? RlvStrings::getAnonym(avName) + "\n" : "";
// [/RLVa:KB]
LLRect sticky_rect;
@ -1029,8 +1021,8 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask )
sticky_rect.mTop = sticky_rect.mBottom + 2 * SLOP;
// region_name = region->getName();
// [RLVa:KB] - Checked: 2010-10-19 (RLVa-1.2.2b) | Modified: RLVa-1.2.2b
region_name = ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION));
// [RLVa:KB] - Checked: RLVa-1.2.2
region_name = (RlvActions::canShowLocation()) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION);
// [/RLVa:KB]
// <FS:Ansariel> Synchronize tooltips throughout instances
//if (!region_name.empty())
@ -1553,7 +1545,7 @@ BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask)
mPopupMenu->setItemVisible("More Options", mClosestAgentsToCursor.size() == 1);
mPopupMenu->setItemVisible("View Profile", mClosestAgentsToCursor.size() == 1);
bool can_show_names = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
bool can_show_names = !RlvActions::hasBehaviour(RLV_BHVR_SHOWNAMES);
mPopupMenu->setItemEnabled("Add to Set Multiple", can_show_names);
mPopupMenu->setItemEnabled("More Options", can_show_names);
mPopupMenu->setItemEnabled("View Profile", can_show_names);
@ -1601,8 +1593,8 @@ BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask)
mPopupMenu->setItemVisible("MarkAvatar", mClosestAgentToCursor.notNull());
mPopupMenu->setItemVisible("Start Tracking", mClosestAgentToCursor.notNull());
mPopupMenu->setItemVisible("Profile Separator", (mClosestAgentsToCursor.size() >= 1 || mClosestAgentToCursor.notNull()));
mPopupMenu->setItemEnabled("Place Profile", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
mPopupMenu->setItemEnabled("World Map", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWWORLDMAP));
mPopupMenu->setItemEnabled("Place Profile", RlvActions::canShowLocation());
mPopupMenu->setItemEnabled("World Map", !RlvActions::hasBehaviour(RLV_BHVR_SHOWWORLDMAP));
// [/SL:KB]
mPopupMenu->buildDrawLabels();
@ -1960,7 +1952,7 @@ bool LLNetMap::canMap()
bool LLNetMap::canShare()
{
return (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV));
return (!RlvActions::hasBehaviour(RLV_BHVR_SHOWINV));
}
bool LLNetMap::canOfferTeleport()

View File

@ -75,8 +75,8 @@
#include "llagentui.h"
#include "llslurl.h"
#include "llevents.h" // for LLEventPumps
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-1.2.2
#include "rlvactions.h"
// [/RLVa:KB]
@ -693,7 +693,7 @@ BOOL LLPanelPeople::postBuild()
//mNearbyList->setNoFilteredItemsMsg(getString("no_one_filtered_near"));
//mNearbyList->setShowIcons("NearbyListShowIcons");
// </FS:Ansariel> Firestorm radar
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
// Externalized to FSRadar
//mNearbyList->setRlvCheckShowNames(true);
// [/RLVa:KB]
@ -1010,7 +1010,7 @@ void LLPanelPeople::updateFacebookList(bool visible)
void LLPanelPeople::updateButtons()
{
std::string cur_tab = getActiveTabName();
// [RLVa:KB] - Checked: 2013-05-06 (RLVa-1.4.9)
// [RLVa:KB] - Checked: RLVa-1.4.9
bool nearby_tab_active = (cur_tab == NEARBY_TAB_NAME);
// [/RLVa:KB]
bool friends_tab_active = (cur_tab == FRIENDS_TAB_NAME);
@ -1060,7 +1060,7 @@ void LLPanelPeople::updateButtons()
//if (cur_panel->hasChild("add_friend_btn", TRUE))
// cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self);
if (!nearby_tab_active && cur_panel->hasChild("add_friend_btn", TRUE))
cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self && RlvActions::canShowName(RlvActions::SNC_DEFAULT, selected_id));
// </FS:Ansariel> RLVa check
if (friends_tab_active)
@ -1078,10 +1078,13 @@ void LLPanelPeople::updateButtons()
}
}
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) | Modified: RLVa-1.2.0d
if ( (nearby_tab_active) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (nearby_tab_active) && (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) )
{
item_selected = multiple_selected = false;
bool fCanShowNames = true;
std::for_each(selected_uuids.begin(), selected_uuids.end(), [&fCanShowNames](const LLUUID& idAgent) { fCanShowNames &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); });
if (!fCanShowNames)
item_selected = multiple_selected = false;
}
// [/RLBa:KB]
}
@ -1318,13 +1321,6 @@ void LLPanelPeople::onTabSelected(const LLSD& param)
void LLPanelPeople::onAvatarListDoubleClicked(LLUICtrl* ctrl)
{
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (NEARBY_TAB_NAME == getActiveTabName()) )
{
return;
}
// [/RLVa:KB]
LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(ctrl);
if(!item)
{
@ -1337,6 +1333,13 @@ void LLPanelPeople::onAvatarListDoubleClicked(LLUICtrl* ctrl)
return;
}
// [RLVa:KB] - Checked: RLVa-2.0.1
if ( (RlvActions::isRlvEnabled()) && (NEARBY_TAB_NAME == getActiveTabName()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, clicked_id)) )
{
return;
}
// [/RLVa:KB]
#if 0 // SJB: Useful for testing, but not currently functional or to spec
LLAvatarActions::showProfile(clicked_id);
#else // spec says open IM window
@ -1451,15 +1454,17 @@ void LLPanelPeople::onGearButtonClicked(LLUICtrl* btn)
void LLPanelPeople::onImButtonClicked()
{
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (NEARBY_TAB_NAME == getActiveTabName()) )
{
return;
}
// [/RLVa:KB]
uuid_vec_t selected_uuids;
getCurrentItemIDs(selected_uuids);
// [RLVa:KB] - Checked: RLVa-2.0.1
if ( (RlvActions::isRlvEnabled()) && (NEARBY_TAB_NAME == getActiveTabName()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) )
{
bool fCanShowNames = true;
std::for_each(selected_uuids.begin(), selected_uuids.end(), [&fCanShowNames](const LLUUID& idAgent) { fCanShowNames &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); });
if (!fCanShowNames)
return;
}
// [/RLVa:KB]
if ( selected_uuids.size() == 1 )
{
// if selected only one person then start up IM

View File

@ -69,7 +69,7 @@ public:
bool mTryToConnectToFacebook;
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
LLAvatarList* getNearbyList() { return mNearbyList; }
// [/RLVa:KB]

View File

@ -43,7 +43,9 @@
#include "llconversationmodel.h"
#include "llviewerobjectlist.h"
#include "llinventorybridge.h" // <FS:CR> CHUI merge
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
// [/RLVa:KB]
namespace LLPanelPeopleMenus
{
@ -194,7 +196,10 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata)
for (;id != uuids_end; ++id)
{
if ( LLAvatarActions::isFriend(*id) )
// if ( LLAvatarActions::isFriend(*id) )
// [RLVa:KB] - Checked: 2014-03-31 (RLVa-2.0.1)
if ( (LLAvatarActions::isFriend(*id)) || (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, *id)) )
// [/RLVa:KB]
{
result = false;
break;
@ -217,7 +222,10 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata)
for (;id != uuids_end; ++id)
{
if ( !LLAvatarActions::isFriend(*id) )
// if ( !LLAvatarActions::isFriend(*id) )
// [RLVa:KB] - Checked: 2014-03-31 (RLVa-2.0.1)
if ( (!LLAvatarActions::isFriend(*id)) || (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, *id)) )
// [/RLVa:KB]
{
result = false;
break;
@ -260,7 +268,7 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata)
// <FS:Ansariel> FIRE-8804: Prevent opening inventory from using share in radar context menu
else if (item == std::string("can_open_inventory"))
{
return (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV));
return (!RlvActions::hasBehaviour(RLV_BHVR_SHOWINV));
}
// </FS:Ansariel>
else if (item == std::string("can_callog"))
@ -292,14 +300,29 @@ void PeopleContextMenu::requestTeleport()
{
// boost::bind cannot recognize overloaded method LLAvatarActions::teleportRequest(),
// so we have to use a wrapper.
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvCanShowName = (!m_fRlvCheck) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mUUIDs.front()));
RlvActions::setShowName(RlvActions::SNC_TELEPORTREQUEST, fRlvCanShowName);
LLAvatarActions::teleportRequest(mUUIDs.front());
RlvActions::setShowName(RlvActions::SNC_TELEPORTREQUEST, true);
// [/RLVa:KB]
// LLAvatarActions::teleportRequest(mUUIDs.front());
}
void PeopleContextMenu::offerTeleport()
{
// boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(),
// so we have to use a wrapper.
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvCanShowName = true;
if ( (m_fRlvCheck) && (RlvActions::isRlvEnabled()) )
std::for_each(mUUIDs.begin(), mUUIDs.end(), [&fRlvCanShowName](const LLUUID& idAgent) { fRlvCanShowName &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); });
RlvActions::setShowName(RlvActions::SNC_TELEPORTOFFER, fRlvCanShowName);
LLAvatarActions::offerTeleport(mUUIDs);
RlvActions::setShowName(RlvActions::SNC_TELEPORTOFFER, true);
// [/RLVa:KB]
// LLAvatarActions::offerTeleport(mUUIDs);
}
void PeopleContextMenu::startConference()
@ -329,7 +352,29 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
menuentry_vec_t items;
menuentry_vec_t disabled_items;
if (flags & ITEM_IN_MULTI_SELECTION)
// [RLVa:KB] - Checked: RLVa-1.5.0
bool fRlvCanShowName = true;
if ( (m_fRlvCheck) && (RlvActions::isRlvEnabled()) )
std::for_each(mUUIDs.begin(), mUUIDs.end(), [&fRlvCanShowName](const LLUUID& idAgent) { fRlvCanShowName &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); });
if (!fRlvCanShowName)
{
if (flags & ITEM_IN_MULTI_SELECTION)
{
items.push_back(std::string("offer_teleport"));
}
else
{
items.push_back(std::string("offer_teleport"));
items.push_back(std::string("request_teleport"));
items.push_back(std::string("separator_invite_to_group"));
items.push_back(std::string("zoom_in"));
items.push_back(std::string("block_unblock"));
}
}
else if (flags & ITEM_IN_MULTI_SELECTION)
// [/RLVa:KB]
// if (flags & ITEM_IN_MULTI_SELECTION)
{
items.push_back(std::string("add_friends"));
items.push_back(std::string("remove_friends"));

View File

@ -38,6 +38,9 @@ namespace LLPanelPeopleMenus
class PeopleContextMenu : public LLListContextMenu
{
public:
// [RLVa:KB] - Checked: RLVa-1.5.0
PeopleContextMenu() : m_fRlvCheck(false) {}
// [/RLVa:KB]
/*virtual*/ LLContextMenu* createMenu();
protected:
@ -52,6 +55,10 @@ private:
// <FS:Ansariel> Add to contact set
void addToContactSet();
// [RLVa:KB] - Checked: RLVa-1.5.0
protected:
bool m_fRlvCheck;
// [/RLVa:KB]
};
/**
@ -59,6 +66,10 @@ private:
*/
class NearbyPeopleContextMenu : public PeopleContextMenu
{
// [RLVa:KB] - Checked: RLVa-1.5.0
public:
NearbyPeopleContextMenu() : PeopleContextMenu() { m_fRlvCheck = true; }
// [/RLVa:KB]
protected:
/*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags);
};

View File

@ -65,7 +65,8 @@
#include "lltrans.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a)
#include "llslurl.h"
#include "rlvhandler.h"
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
// <FS:CR> For OpenSim export permisson
#include "lfsimfeaturehandler.h"
@ -462,15 +463,15 @@ void LLPanelPermissions::refresh()
// getChildView("Owner Name")->setEnabled(TRUE);
// [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
// [RLVa:KB] - Checked: RLVa-2.0.1
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) )
{
// Only anonymize the creator if all of the selection was created by the same avie who's also the owner or they're a nearby avie
if ( (creators_identical) && (mCreatorID != gAgent.getID()) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) )
if ( (creators_identical) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, mCreatorID)) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) )
creator_name = LLSLURL("agent", mCreatorID, "rlvanonym").getSLURLString();
// Only anonymize the owner name if all of the selection is owned by the same avie and isn't group owned
if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (mOwnerID != gAgent.getID()) )
if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, mOwnerID)) )
owner_name = LLSLURL("agent", mOwnerID, "rlvanonym").getSLURLString();
// Only anonymize the last owner name if all of the selection was last owned by the same avie

View File

@ -99,6 +99,7 @@
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a)
#include "rlvactions.h"
#include "rlvhandler.h"
#include "rlvhelper.h"
// [/RLVa:KB]
// <FS:CR> Aurora Sim
#include "llviewernetwork.h"
@ -4402,7 +4403,7 @@ void LLSelectMgr::deselectAllIfTooFar()
bool apply(LLSelectNode* pNode)
{
const LLViewerObject* pObj = pNode->getObject();
return (!pNode->isTransient()) && (pObj) && (!gRlvHandler.canEdit(pObj)) && (pObj->getID() != LLViewerMediaFocus::getInstance()->getFocusedObjectID());
return (!pNode->isTransient()) && (pObj) && (!RlvActions::canEdit(pObj)) && (pObj->getID() != LLViewerMediaFocus::getInstance()->getFocusedObjectID());
}
} f;
if (mSelectedObjects->getFirstRootNode(&f, TRUE))
@ -4434,6 +4435,8 @@ void LLSelectMgr::deselectAllIfTooFar()
LLVector3d selectionCenter = getSelectionCenterGlobal();
// if (gSavedSettings.getBOOL("LimitSelectDistance")
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-0.2.0f
static RlvCachedBehaviourModifier<float> s_nFartouchDist(RLV_MODIFIER_FARTOUCHDIST);
BOOL fRlvFartouch = gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH) && gFloaterTools->getVisible();
if ( (gSavedSettings.getBOOL("LimitSelectDistance") || (fRlvFartouch) )
// [/RLVa:KB]
@ -4444,7 +4447,7 @@ void LLSelectMgr::deselectAllIfTooFar()
{
// 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;
F32 deselect_dist = (!fRlvFartouch) ? gSavedSettings.getF32("MaxSelectDistance") : s_nFartouchDist;
// [/RLVa:KB]
F32 deselect_dist_sq = deselect_dist * deselect_dist;

View File

@ -46,8 +46,9 @@
#include "llviewerobjectlist.h"
#include "llexperiencecache.h"
#include "lltrans.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -361,13 +362,16 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
// std::string name =
// LLSLURL("agent", creator_id, "completename").getSLURLString();
// getChildView("BtnCreator")->setEnabled(TRUE);
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-2.0.1
// If the object creator matches the object owner we need to anonymize the creator field as well
bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == creator_id) && (perm.getOwner() != gAgent.getID())) ||
(RlvUtil::isNearbyAgent(item->getCreatorUUID())) );
std::string name = LLSLURL("agent", creator_id, (!fRlvFilterCreator) ? "completename" : "rlvanonym").getSLURLString();
getChildView("BtnCreator")->setEnabled(!fRlvFilterCreator);
bool fRlvCanShowCreator = true;
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, creator_id)) &&
( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == creator_id) ) || (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) )
{
fRlvCanShowCreator = false;
}
std::string name = LLSLURL("agent", creator_id, (fRlvCanShowCreator) ? "completename" : "rlvanonym").getSLURLString();
getChildView("BtnCreator")->setEnabled(fRlvCanShowCreator);
// [/RLVa:KB]
getChildView("LabelCreatorTitle")->setEnabled(TRUE);
getChildView("LabelCreatorName")->setEnabled(FALSE);
@ -386,6 +390,9 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
////////////////
if(perm.isOwned())
{
// [RLVa:KB] - Checked: RVLa-2.0.1
bool fRlvCanShowOwner = true;
// [/RLVa:KB]
std::string name;
if (perm.isGroupOwned())
{
@ -395,14 +402,14 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
{
LLUUID owner_id = perm.getOwner();
// name = LLSLURL("agent", owner_id, "completename").getSLURLString();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (owner_id != gAgent.getID());
name = LLSLURL("agent", owner_id, (!fRlvFilterOwner) ? "completename" : "rlvanonym").getSLURLString();
// [RLVa:KB] - Checked: RLVa-2.0.1
fRlvCanShowOwner = RlvActions::canShowName(RlvActions::SNC_DEFAULT, owner_id);
name = LLSLURL("agent", owner_id, (fRlvCanShowOwner) ? "completename" : "rlvanonym").getSLURLString();
// [/RLVa:KB]
}
// getChildView("BtnOwner")->setEnabled(TRUE);
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Added: RLVa-1.0.0e
getChildView("BtnOwner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [RLVa:KB] - Checked: RLVa-2.0.1
getChildView("BtnOwner")->setEnabled(fRlvCanShowOwner);
// [/RLVa:KB]
getChildView("LabelOwnerTitle")->setEnabled(TRUE);
getChildView("LabelOwnerName")->setEnabled(FALSE);
@ -760,12 +767,12 @@ void LLSidepanelItemInfo::onClickCreator()
if(!item) return;
if(!item->getCreatorUUID().isNull())
{
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Added: RLVa-1.2.1b
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
// [RLVa:KB] - Checked: RLVa-1.2.1
const LLUUID& idCreator = item->getCreatorUUID();
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) )
{
const LLPermissions& perm = item->getPermissions();
if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) && (perm.getOwner() != gAgent.getID())) ||
(RlvUtil::isNearbyAgent(item->getCreatorUUID())) )
if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == idCreator) ) || (RlvUtil::isNearbyAgent(idCreator)) )
{
return;
}
@ -786,8 +793,8 @@ void LLSidepanelItemInfo::onClickOwner()
}
else
{
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (item->getPermissions().getOwner() != gAgent.getID()) )
// [RLVa:KB] - Checked: RLVa-1.0.0
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, item->getPermissions().getOwner())) )
return;
// [/RLVa:KB]
LLAvatarActions::showProfile(item->getPermissions().getOwner());

View File

@ -40,6 +40,7 @@
#include "llviewerwindow.h"
#include "llfloatertools.h"
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e)
#include "rlvactions.h"
#include "rlvhandler.h"
// [/RLVa:KB]
@ -112,7 +113,7 @@ void LLToolFace::pickCallback(const LLPickInfo& pick_info)
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c
if ( (rlv_handler_t::isEnabled()) &&
( (!gRlvHandler.canEdit(hit_obj)) ||
( (!RlvActions::canEdit(hit_obj)) ||
((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(hit_obj, pick_info.mObjectOffset))) ) )
{
return;

View File

@ -74,6 +74,7 @@
#include "llweb.h"
#include "pipeline.h" // setHighlightObject
// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c)
#include "rlvactions.h"
#include "rlvhandler.h"
// [/RLVa:KB]
@ -477,7 +478,7 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object)
// 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))) )
((!rlv_handler_t::isEnabled()) || (RlvActions::canSit(object, LLToolPie::getInstance()->getHoverPick().mObjectOffset))) )
// [/RLVa:KB]
{
cursor = UI_CURSOR_TOOLSIT;
@ -753,10 +754,24 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask)
FALSE /* ignore transparent */,
FALSE /* ignore particles */);
if (!mPick.mPosGlobal.isExactlyZero() // valid coordinates for pick
&& (mPick.mPickType == LLPickInfo::PICK_LAND // we clicked on land
|| mPick.mObjectID.notNull())) // or on an object
// if (!mPick.mPosGlobal.isExactlyZero() // valid coordinates for pick
// && (mPick.mPickType == LLPickInfo::PICK_LAND // we clicked on land
// || mPick.mObjectID.notNull())) // or on an object
// [RLVa:KB] - Checked: RLVa-2.0.0
bool fValidPick = (!mPick.mPosGlobal.isExactlyZero() // valid coordinates for pick
&& (mPick.mPickType == LLPickInfo::PICK_LAND // we clicked on land
|| mPick.mObjectID.notNull())); // or on an object
if ( (fValidPick) && (RlvActions::isRlvEnabled()) && (!RlvActions::canTeleportToLocal(mPick.mPosGlobal)) )
{
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_AUTOPILOT);
fValidPick = false;
}
if (fValidPick)
// [/RLVa:KB]
{
// handle special cases of steering picks
LLViewerObject* avatar_object = mPick.getObject();
@ -851,8 +866,20 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
}
}
if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) ||
(mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero()))
// if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) ||
// (mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero()))
// [RLVa:KB] - Checked: RLVa-2.0.0
bool fValidPick = ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) ||
(mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero()));
if ( (fValidPick) && (RlvActions::isRlvEnabled()) && (!RlvActions::canTeleportToLocal(mPick.mPosGlobal)) )
{
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_AUTOPILOT);
fValidPick = false;
}
if (fValidPick)
// [/RLVa:KB]
{
walkToClickedLocation();
return TRUE;
@ -1149,8 +1176,8 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l
if (LLAvatarNameCache::get(hover_object->getID(), &av_name))
{
// final_name = av_name.getCompleteName();
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
final_name = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [RLVa:KB] - Checked: RLVa-1.2.2
final_name = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, hover_object->getID())) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB]
// <FS:Zi> Make sure group title gets added to the tool tip. This is done separately to
// the RLVa code to prevent this change from getting lost in future RLVa merges
@ -1167,9 +1194,9 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l
// *HACK: We may select this object, so pretend it was clicked
mPick = mHoverPick;
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.2a) | Added: RLVa-1.2.0e
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (!rlv_handler_t::isEnabled()) ||
( (gRlvHandler.canTouch(hover_object, mHoverPick.mObjectOffset)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) )
( (gRlvHandler.canTouch(hover_object, mHoverPick.mObjectOffset)) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, hover_object->getID())) ) )
{
// [/RLVa:KB]
LLInspector::Params p;

View File

@ -45,6 +45,7 @@
#include "llui.h"
// [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0a)
#include "rlvhandler.h"
#include "rlvhelper.h"
// [/RLVa:KB]
//Headers added for functions moved from viewer.cpp
@ -166,9 +167,11 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj,
// [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) )
if (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))
{
return FALSE;
static RlvCachedBehaviourModifier<float> s_nFartouchDist(RLV_MODIFIER_FARTOUCHDIST);
if (dist_vec_squared(gAgent.getPositionGlobal(), pick.mPosGlobal) > s_nFartouchDist * s_nFartouchDist)
return FALSE;
}
// [/RLVa:KB]

View File

@ -47,8 +47,9 @@
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "llworld.h"
// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.0
#include "rlvactions.h"
#include "rlvhelper.h"
#include "llfloaterreg.h"
// [/RLVa:KB]
@ -86,22 +87,23 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi
}
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c
if ( (object) && (rlv_handler_t::isEnabled()) )
if ( (object) && (RlvActions::isRlvEnabled()) )
{
if (!gRlvHandler.canEdit(object))
if (!RlvActions::canEdit(object))
{
if (!temp_select)
return LLSelectMgr::getInstance()->getSelection();
else if (LLToolMgr::instance().inBuildMode())
LLToolMgr::instance().toggleBuildMode(LLSD("toggleonly"));
}
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) &&
(dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion()) > 1.5f * 1.5f) )
if ( (RlvActions::hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) )
{
// 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)
static RlvCachedBehaviourModifier<float> s_nFartouchDist(RLV_MODIFIER_FARTOUCHDIST);
float nFartouchDistSq = s_nFartouchDist * s_nFartouchDist;
// NOTE: recheck why we did it this way, might be able to simplify
if ( (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion()) > nFartouchDistSq) &&
(dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > nFartouchDistSq) )
{
if ( (LLFloaterReg::instanceVisible("build")) && (pick.mKeyMask != MASK_SHIFT) && (pick.mKeyMask != MASK_CONTROL) )
LLSelectMgr::getInstance()->deselectAll();

View File

@ -41,7 +41,8 @@
#include "llworld.h"
#include "lltoolmgr.h"
#include "llviewerjoystick.h"
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e)
// [RLVa:KB] - RLVa-2.0.0
#include "rlvactions.h"
#include "rlvhandler.h"
// [/RLVa:KB]
@ -356,15 +357,17 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
if (limit_select_distance)
{
// ...select distance from control
// 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]
z_far = gSavedSettings.getF32("MaxSelectDistance");
}
else
{
z_far = gAgentCamera.mDrawDistance;
}
// [RLVa:KB] - Checked: RLVa-2.0.0
if (RlvActions::hasBehaviour(RLV_BHVR_FARTOUCH))
z_far = RlvActions::getModifierValue<float>(RLV_MODIFIER_FARTOUCHDIST);
// [/RLVa:KB]
}
else
{
@ -882,6 +885,12 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts)
void LLViewerCamera::setDefaultFOV(F32 vertical_fov_rads)
{
// [RLVa:KB] - Checked: RLVa-2.0.0
F32 nCamFOVMin, nCamFOVMax;
if ( (RlvActions::isRlvEnabled()) && (RlvActions::getCameraFOVLimits(nCamFOVMin, nCamFOVMax)) )
vertical_fov_rads = llclamp(vertical_fov_rads, nCamFOVMin, nCamFOVMax);
// [/RLVa:KB]
vertical_fov_rads = llclamp(vertical_fov_rads, getMinView(), getMaxView());
setView(vertical_fov_rads);
mCameraFOVDefault = vertical_fov_rads;

View File

@ -1363,13 +1363,22 @@ class LLAdvancedToggleWireframe : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
// [RLVa:KB] - Checked: 2013-05-11 (RLVa-1.4.9)
// [RLVa:KB] - Checked: RLVa-2.0.0
bool fRlvBlockWireframe = gRlvAttachmentLocks.hasLockedHUD();
if ( (!gUseWireframe) && (fRlvBlockWireframe) )
{
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_WIREFRAME);
}
gUseWireframe = (!gUseWireframe) && (!fRlvBlockWireframe);
set_use_wireframe( (!gUseWireframe) && (!fRlvBlockWireframe) );
return true;
}
};
// Called from rlvhandler.cpp
void set_use_wireframe(BOOL useWireframe)
{
if (gUseWireframe == useWireframe)
return;
gUseWireframe = useWireframe;
// [/RLVa:KB]
// gUseWireframe = !(gUseWireframe);
@ -1390,9 +1399,9 @@ class LLAdvancedToggleWireframe : public view_listener_t
LLViewerShaderMgr::instance()->setShaders();
}
return true;
// return true;
}
};
//};
class LLAdvancedCheckWireframe : public view_listener_t
{
@ -3573,15 +3582,15 @@ bool enable_object_mute()
lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden");
bool is_self = avatar->isSelf();
// 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] - Checked: RLVa-1.2.1
// return !is_linden && !is_self && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID()));
// [/RLVa:KB]
// <FS:Zi> Make enable/disable of block/unblock menu items work for avatars
if(is_linden || is_self)
return false;
if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID()))
return false;
LLNameValue *firstname = avatar->getNVPair("FirstName");
@ -3741,14 +3750,14 @@ 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))
id = avatar->getID();
// [RLVa:KB] - Checked: RLVa-1.0.0
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, id))
return true;
// [/RLVa:KB]
avatar->mNeedsImpostorUpdate = TRUE;
id = avatar->getID();
LLNameValue *firstname = avatar->getNVPair("FirstName");
LLNameValue *lastname = avatar->getNVPair("LastName");
@ -3916,8 +3925,8 @@ void handle_avatar_freeze(const LLSD& avatar_id)
// {
// LLSD args;
// args["AVATAR_NAME"] = fullname;
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e
// args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname);
// [RLVa:KB] - Checked: RLVa-1.0.0
// args["AVATAR_NAME"] = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ? fullname : RlvStrings::getAnonym(fullname);
// [/RLVa:KB]
// LLNotificationsUtil::add("FreezeAvatarFullname",
// args,
@ -4064,8 +4073,8 @@ void handle_avatar_eject(const LLSD& avatar_id)
// {
// LLSD args;
// args["AVATAR_NAME"] = fullname;
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e
// args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname);
// [RLVa:KB] - Checked: RLVa-1.0.0
// args["AVATAR_NAME"] = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ? fullname : RlvStrings::getAnonym(fullname);
// [/RLVa:KB]
// LLNotificationsUtil::add("EjectAvatarFullname",
// args,
@ -4087,8 +4096,8 @@ void handle_avatar_eject(const LLSD& avatar_id)
// {
// LLSD args;
// args["AVATAR_NAME"] = fullname;
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e
// args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname);
// [RLVa:KB] - Checked: RLVa-1.0.0
// args["AVATAR_NAME"] = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ? fullname : RlvStrings::getAnonym(fullname);
// [/RLVa:KB]
// LLNotificationsUtil::add("EjectAvatarFullnameNoBan",
// args,
@ -4878,8 +4887,8 @@ class LLAvatarEnableAddFriend : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
// 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] - Checked: RLVa-1.2.0
bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID()));
// [/RLVa:KB]
return new_value;
}
@ -4957,7 +4966,7 @@ bool is_object_sittable()
if (rlv_handler_t::isEnabled())
{
const LLPickInfo& pick = LLToolPie::getInstance()->getPick();
if ( (pick.mObjectID.notNull()) && (!gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset)) )
if ( (pick.mObjectID.notNull()) && (!RlvActions::canSit(pick.getObject(), pick.mObjectOffset)) )
return false;
}
// [/RLVa:KB]
@ -4996,7 +5005,7 @@ void handle_object_sit_or_stand()
// 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))) )
((!rlv_handler_t::isEnabled()) || (RlvActions::canSit(object, pick.mObjectOffset))) )
// [/RLVa:KB]
{
// [RLVa:KB] - Checked: 2010-08-29 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
@ -7280,8 +7289,8 @@ class LLAvatarInviteToGroup : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// 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] - Checked: RLVa-1.2.0
if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) )
// [/RLVa:KB]
{
LLAvatarActions::inviteToGroup(avatar->getID());
@ -7296,8 +7305,8 @@ class LLAvatarAddFriend : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// 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] - Checked: RLVa-1.2.0
if ( (avatar && !LLAvatarActions::isFriend(avatar->getID())) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) )
// [/RLVa:KB]
{
request_friendship(avatar->getID());
@ -7340,8 +7349,8 @@ class LLAvatarAddContact : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// 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] - Checked: RLVa-1.2.0
if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) )
// [/RLVa:KB]
{
create_inventory_callingcard(avatar->getID());
@ -7407,8 +7416,8 @@ bool enable_pay_avatar()
LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
LLVOAvatar* avatar = find_avatar_from_object(obj);
// 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] - Checked: RLVa-1.2.1
return (avatar != NULL) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID()));
// [/RLVa:KB]
}
@ -7464,7 +7473,7 @@ bool enable_object_sit(LLUICtrl* ctrl)
{
const LLPickInfo& pick = LLToolPie::getInstance()->getPick();
if (pick.mObjectID.notNull())
sitting_on_sel = !gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset);
sitting_on_sel = !RlvActions::canSit(pick.getObject(), pick.mObjectOffset);
}
// [/RLVa:KB]
@ -7799,8 +7808,8 @@ class LLShowAgentProfile : public view_listener_t
LLVOAvatar* avatar = find_avatar_from_object(agent_id);
// 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] - Checked: RLVa-1.2.0
if ( (avatar) && ((RlvActions::canShowName(RlvActions::SNC_DEFAULT, agent_id)) || (gAgent.getID() == agent_id)) )
// [/RLVa:KB]
{
LLAvatarActions::showProfile(avatar->getID());
@ -8533,8 +8542,8 @@ class LLAvatarSendIM : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// 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] - Checked: RLVa-1.2.0
if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) )
// [/RLVa:KB]
{
LLAvatarActions::startIM(avatar->getID());
@ -8549,8 +8558,8 @@ class LLAvatarCall : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// 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] - Checked: RLVa-1.2.0
if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) )
// [/RLVa:KB]
{
LLAvatarActions::startCall(avatar->getID());
@ -8559,10 +8568,16 @@ class LLAvatarCall : public view_listener_t
}
};
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
// [RLVa:KB] - Checked: RLVa-1.2.1
bool enable_avatar_call()
{
return (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (LLAvatarActions::canCall());
if (RlvActions::isRlvEnabled())
{
const LLVOAvatar* pAvatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
if ((!pAvatar) || (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, pAvatar->getID())))
return false;
}
return LLAvatarActions::canCall();
}
// [/RLVa:KB]
@ -11331,10 +11346,11 @@ void initialize_menus()
view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints");
// [RLVa:KB] - Checked: 2010-04-23 (RLVa-1.2.0g) | Added: RLVa-1.2.0
// [RLVa:KB] - Checked: RLVa-2.0.0
enable.add("RLV.MainToggleVisible", boost::bind(&rlvMenuMainToggleVisible, _1));
if (rlv_handler_t::isEnabled())
if (RlvActions::isRlvEnabled())
{
enable.add("RLV.CanShowName", boost::bind(&rlvMenuCanShowName));
enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2));
}
// [/RLVa:KB]

View File

@ -39,6 +39,10 @@ class LLObjectSelection;
class LLSelectNode;
class PieMenu; // ## Zi: Pie Menu
// [RLVa:KB] - Checked: RLVa-2.0.0
void set_use_wireframe(BOOL useWireframe);
// [/RLVa:KB]
void initialize_edit_menu();
void initialize_spellcheck_menu();
void initialize_volume_controls_callbacks(); //<FS:KC> Centralize a some of these volume panel callbacks

View File

@ -1626,13 +1626,12 @@ void LLOfferInfo::send_auto_receive_response(void)
{
// add buddy to recent people list
// LLRecentPeople::instance().add(mFromID);
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0f
// RELEASE-RLVa: [RLVa-1.2.2] Make sure this stays in sync with the condition in inventory_offer_handler()
if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (!RlvUtil::isNearbyAgent(mFromID)) ||
(RlvUIEnabler::hasOpenIM(mFromID)) || ((RlvUIEnabler::hasOpenProfile(mFromID))) )
{
// [RLVa:KB] - Checked: RLVa-2.0.1
// RELEASE-RLVa: [RLVa-2.0.1] Make sure this stays in sync with the condition in inventory_offer_handler()
bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, mFromID)) || (!RlvUtil::isNearbyAgent(mFromID)) || (RlvUIEnabler::hasOpenIM(mFromID)) || (RlvUIEnabler::hasOpenProfile(mFromID));
if (fRlvCanShowName)
LLRecentPeople::instance().add(mFromID);
}
// [/RLVa:KB]
}
}
@ -1991,9 +1990,11 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
// [SL:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
std::string name_slurl = LLSLURL("agent", mFromID, "about").getSLURLString();
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// RELEASE-RLVa: [RLVa-1.2.2] Make sure this stays in sync with the condition in inventory_offer_handler()
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(mFromID)) )
// [RLVa:KB] - Checked: RLVa-2.0.1
// RELEASE-RLVa: [RLVa-2.0.1] Make sure this stays in sync with the condition in inventory_offer_handler()
bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, mFromID)) || (!RlvUtil::isNearbyAgent(mFromID)) || (RlvUIEnabler::hasOpenIM(mFromID)) || (RlvUIEnabler::hasOpenProfile(mFromID));
if (!fRlvCanShowName)
name_slurl = LLSLURL("agent", mFromID, "rlvanonym").getSLURLString();
// [/RLVa:KB]
@ -2273,9 +2274,9 @@ void inventory_offer_handler(LLOfferInfo* info)
// Object -> Agent Inventory Offer
if (info->mFromObject && !bAutoAccept)
{
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
// Only filter if the object owner is a nearby agent
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) )
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, info->mFromID)) && (RlvUtil::isNearbyAgent(info->mFromID)) )
{
payload["rlv_shownames"] = TRUE;
args["NAME_SLURL"] = LLSLURL("agent", info->mFromID, "rlvanonym").getSLURLString();
@ -2296,10 +2297,11 @@ void inventory_offer_handler(LLOfferInfo* info)
}
else // Agent -> Agent Inventory Offer
{
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-2.0.1
// 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)) )
bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, info->mFromID)) || (!RlvUtil::isNearbyAgent(info->mFromID)) || (RlvUIEnabler::hasOpenIM(info->mFromID)) || (RlvUIEnabler::hasOpenProfile(info->mFromID));
if (!fRlvCanShowName)
{
payload["rlv_shownames"] = TRUE;
args["NAME"] = RlvStrings::getAnonym(info->mFromName);
@ -3512,11 +3514,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_INVENTORY_ACCEPTED:
{
// args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();;
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
// Only anonymize the name if the agent is nearby, there isn't an open IM session to them and their profile isn't open
bool fRlvFilterName = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(from_id)) &&
(!RlvUIEnabler::hasOpenProfile(from_id)) && (!RlvUIEnabler::hasOpenIM(from_id));
args["NAME"] = LLSLURL("agent", from_id, (!fRlvFilterName) ? "completename" : "rlvanonym").getSLURLString();;
bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, from_id)) || (!RlvUtil::isNearbyAgent(from_id)) || (RlvUIEnabler::hasOpenProfile(from_id)) || (RlvUIEnabler::hasOpenIM(from_id));
args["NAME"] = LLSLURL("agent", from_id, (fRlvCanShowName) ? "completename" : "rlvanonym").getSLURLString();;
// [/RLVa:KB]
LLSD payload;
payload["from_id"] = from_id;
@ -3529,11 +3531,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_INVENTORY_DECLINED:
{
// args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();;
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
// Only anonymize the name if the agent is nearby, there isn't an open IM session to them and their profile isn't open
bool fRlvFilterName = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(from_id)) &&
(!RlvUIEnabler::hasOpenProfile(from_id)) && (!RlvUIEnabler::hasOpenIM(from_id));
args["NAME"] = LLSLURL("agent", from_id, (!fRlvFilterName) ? "completename" : "rlvanonym").getSLURLString();;
bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, from_id)) || (!RlvUtil::isNearbyAgent(from_id)) || (RlvUIEnabler::hasOpenProfile(from_id)) || (RlvUIEnabler::hasOpenIM(from_id));
args["NAME"] = LLSLURL("agent", from_id, (fRlvCanShowName) ? "completename" : "rlvanonym").getSLURLString();;
// [/RLVa:KB]
LLSD payload;
payload["from_id"] = from_id;
@ -3608,18 +3610,18 @@ 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())
// [RLVa:KB] - Checked: RLVa-1.2.0
if (RlvActions::isRlvEnabled())
{
// NOTE: the chat message itself will be filtered in LLNearbyChatHandler::processChat()
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) )
if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) )
{
query_string["rlv_shownames"] = TRUE;
RlvUtil::filterNames(name);
chat.mFromName = name;
}
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
if (!RlvActions::canShowLocation())
{
std::string::size_type idxPos = location.find('/');
if ( (std::string::npos != idxPos) && (RlvUtil::isNearbyRegion(location.substr(0, idxPos))) )
@ -4625,7 +4627,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
// Filtering "rules":
// avatar => filter only their name (unless it's this avie)
// other => filter everything
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT))
{
if (CHAT_SOURCE_AGENT != chat.mSourceType)
{
@ -4635,19 +4637,19 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
{
chat.mFromName = RlvStrings::getAnonym(chat.mFromName);
chat.mRlvNamesFiltered = TRUE;
}
}
}
// Create an "objectim" URL for objects if we're either @shownames or @showloc restricted
// (we need to do this now because we won't be have enough information to do it later on)
if ( (CHAT_SOURCE_OBJECT == chat.mSourceType) &&
((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))) )
if ( (CHAT_SOURCE_OBJECT == chat.mSourceType) &&
( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) || (!RlvActions::canShowLocation()) ) )
{
LLSD sdQuery;
sdQuery["name"] = chat.mFromName;
sdQuery["owner"] = owner_id;
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!is_owned_by_me) )
if ( (!RlvActions::canShowName(RlvActions::SNC_COUNT, owner_id)) && (!is_owned_by_me) )
sdQuery["rlv_shownames"] = true;
const LLViewerRegion* pRegion = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent);
@ -7866,12 +7868,12 @@ void process_alert_core(const std::string& message, BOOL modal)
}
std::string new_msg =LLNotifications::instance().getGlobalString(text);
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
if ( (new_msg == text) && (rlv_handler_t::isEnabled()) )
// [RLVa:KB] - Checked: RLVa-1.4.5
if ( (new_msg == text) && (RlvActions::isRlvEnabled()) )
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
if (!RlvActions::canShowLocation())
RlvUtil::filterLocation(new_msg);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT))
RlvUtil::filterNames(new_msg);
}
// [/RLVa:KB]
@ -7882,12 +7884,12 @@ void process_alert_core(const std::string& message, BOOL modal)
{
LLSD args;
std::string new_msg =LLNotifications::instance().getGlobalString(message);
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
if ( (new_msg == message) && (rlv_handler_t::isEnabled()) )
// [RLVa:KB] - Checked: RLVa-1.4.5
if ( (new_msg == message) && (RlvActions::isRlvEnabled()) )
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
if (!RlvActions::canShowLocation())
RlvUtil::filterLocation(new_msg);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT))
RlvUtil::filterNames(new_msg);
}
// [/RLVa:KB]
@ -7906,12 +7908,12 @@ void process_alert_core(const std::string& message, BOOL modal)
std::string localized_msg;
bool is_message_localized = LLTrans::findString(localized_msg, new_msg);
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
if ( (new_msg == message) && (rlv_handler_t::isEnabled()) )
// [RLVa:KB] - Checked: RLVa-1.4.5
if ( (new_msg == message) && (RlvActions::isRlvEnabled()) )
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
if (!RlvActions::canShowLocation())
RlvUtil::filterLocation(new_msg);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT))
RlvUtil::filterNames(new_msg);
}
// [/RLVa:KB]
@ -8975,8 +8977,8 @@ void send_lures(const LLSD& notification, const LLSD& response)
// Record the offer.
{
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
bool fRlvHideName = notification["payload"]["rlv_shownames"].asBoolean();
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvCanShowName = (!notification["payload"].has("rlv_shownames")) ? true : !notification["payload"]["rlv_shownames"].asBoolean();
// [/RLVa:KB]
// <FS:Ansariel> Show complete name for TP lures
//std::string target_name;
@ -8984,7 +8986,7 @@ void send_lures(const LLSD& notification, const LLSD& response)
LLSD args;
//args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();;
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
args["TO_NAME"] = LLSLURL("agent", target_id, (!fRlvHideName) ? "completename" : "rlvanonym").getSLURLString();;
args["TO_NAME"] = LLSLURL("agent", target_id, (fRlvCanShowName) ? "completename" : "rlvanonym").getSLURLString();;
// [/RLVa:KB]
// args["TO_NAME"] = LLSLURL("agent", target_id, "completename").getSLURLString();
// </FS:Ansariel>
@ -8997,8 +8999,8 @@ void send_lures(const LLSD& notification, const LLSD& response)
LLNotificationsUtil::add("TeleportOfferSent", args, payload);
// Add the recepient to the recent people list.
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
if (!fRlvHideName)
// [RLVa:KB] - Checked: RLVa-2.0.1
if (fRlvCanShowName)
LLRecentPeople::instance().add(target_id);
// [/RLVa:KB]
// LLRecentPeople::instance().add(target_id);
@ -9052,25 +9054,32 @@ void handle_lure(const uuid_vec_t& ids)
// edit_args["REGION"] = gAgent.getRegion()->getName();
LLSD payload;
for (std::vector<LLUUID>::const_iterator it = ids.begin();
it != ids.end();
++it)
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvShouldHideNames = false;
for (const LLUUID& idAgent : ids)
{
// [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)) &&
const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(idAgent);
if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, idAgent, RLV_CHECK_PERMISSIVE)) &&
((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) )
{
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT_OFFER);
return;
}
}
payload["rlv_shownames"] = !RlvActions::canShowName(RlvActions::SNC_TELEPORTOFFER);
// [/RLVa:KB]
payload["ids"].append(*it);
fRlvShouldHideNames |= !RlvActions::canShowName(RlvActions::SNC_TELEPORTOFFER, idAgent);
payload["ids"].append(idAgent);
}
payload["rlv_shownames"] = fRlvShouldHideNames;
// [/RLVa:KB]
// for (std::vector<LLUUID>::const_iterator it = ids.begin();
// it != ids.end();
// ++it)
// {
// payload["ids"].append(*it);
// }
if (gAgent.isGodlike())
{
LLNotificationsUtil::add("OfferTeleportFromGod", edit_args, payload, handle_lure_callback);

View File

@ -103,6 +103,7 @@
#include "llfloaterperms.h"
#include "llvocache.h"
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a)
#include "rlvactions.h"
#include "rlvhandler.h"
#include "rlvlocks.h"
// [/RLVa:KB]
@ -5890,7 +5891,7 @@ BOOL LLViewerObject::permTransfer() const
BOOL LLViewerObject::allowOpen() const
{
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c
return !flagInventoryEmpty() && (permYouOwner() || permModify()) && ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canEdit(this)));
return !flagInventoryEmpty() && (permYouOwner() || permModify()) && ((!RlvActions::isRlvEnabled()) || (RlvActions::canEdit(this)));
// [/RLVa:KB]
// return !flagInventoryEmpty() && (permYouOwner() || permModify());
}

View File

@ -766,6 +766,29 @@ void LLViewerObjectList::dirtyAllObjectInventory()
}
}
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
void LLViewerObjectList::setAllObjectDefaultTextures(U32 nChannel, bool fShowDefault)
{
LLPipeline::sRenderTextures = !fShowDefault;
for (LLViewerObject* pObj : mObjects)
{
LLDrawable* pDrawable = pObj->mDrawable;
if ( (pDrawable) && (!pDrawable->isDead()) )
{
for (int idxFace = 0, cntFace = pDrawable->getNumFaces(); idxFace < cntFace; idxFace++)
{
if (LLFace* pFace = pDrawable->getFace(idxFace))
pFace->setDefaultTexture(nChannel, fShowDefault);
}
if (LLVOVolume* pVoVolume = pDrawable->getVOVolume())
pVoVolume->markForUpdate(true);
}
}
}
// [/SL:KB]
void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
{
S32 i;

View File

@ -124,6 +124,9 @@ public:
void resetObjectBeacons();
void dirtyAllObjectInventory();
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
void setAllObjectDefaultTextures(U32 nChannel, bool fShowDefault);
// [/SL:KB]
void removeFromActiveList(LLViewerObject* objectp);
void updateActive(LLViewerObject *objectp);

View File

@ -85,6 +85,9 @@ LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sWhiteImagep = NULL;
LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sDefaultImagep = NULL;
LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sSmokeImagep = NULL;
LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sFlatNormalImagep = NULL;
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sDefaultDiffuseImagep = NULL;
// [/SL:KB]
LLViewerMediaTexture::media_map_t LLViewerMediaTexture::sMediaMap;
LLTexturePipelineTester* LLViewerTextureManager::sTesterp = NULL;
const std::string sTesterName("TextureTester");

View File

@ -561,6 +561,9 @@ public:
static LLPointer<LLViewerFetchedTexture> sDefaultImagep; // "Default" texture for error cases, the only case of fetched texture which is generated in local.
static LLPointer<LLViewerFetchedTexture> sSmokeImagep; // Old "Default" translucent texture
static LLPointer<LLViewerFetchedTexture> sFlatNormalImagep; // Flat normal map denoting no bumpiness on a surface
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
static LLPointer<LLViewerFetchedTexture> sDefaultDiffuseImagep;
// [/SL:KB]
};
//

View File

@ -98,7 +98,8 @@
#include "llanimstatelabels.h"
#include "lltrans.h"
#include "llappearancemgr.h"
// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c)
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvhandler.h"
// [/RLVa:KB]
@ -2794,8 +2795,13 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
const F32 time_visible = mTimeVisible.getElapsedTimeF32();
const F32 NAME_SHOW_TIME = F32(renderNameShowTime); // seconds
const F32 FADE_DURATION = F32(renderNameFadeDuration); // seconds
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b
bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvShowAvTag = true, fRlvShowAvName = true;
if (RlvActions::isRlvEnabled())
{
fRlvShowAvTag = RlvActions::canShowName(RlvActions::SNC_NAMETAG, getID());
fRlvShowAvName = (fRlvShowAvTag) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, getID()));
}
// [/RLVa:KB]
BOOL visible_avatar = isVisible() || mNeedsAnimUpdate;
BOOL visible_chat = useChatBubbles && (mChats.size() || mTyping);
@ -2803,8 +2809,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
BOOL render_name = visible_chat ||
visible_typing ||
(visible_avatar &&
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-1.0.0h
( (!fRlvShowNames) || (RlvSettings::getShowNameTags()) ) &&
// [RLVa:KB] - Checked: RLVa-2.0.1
(fRlvShowAvTag) &&
// [/RLVa:KB]
((sRenderName == RENDER_NAME_ALWAYS) ||
(sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME)));
@ -2842,8 +2848,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
new_name = TRUE;
}
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b
if (fRlvShowNames)
// [RLVa:KB] - Checked: RLVa-0.2.0
if (!fRlvShowAvName)
{
if (mRenderGroupTitles)
{
@ -2928,8 +2934,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
static const F32 chat_range_shout_squared = LFSimFeatureHandler::getInstance()->shoutRange() * LFSimFeatureHandler::getInstance()->shoutRange();
// </FS:Ansariel>
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvShowAvName = RlvActions::canShowName(RlvActions::SNC_DEFAULT, getID());
// [/RLVa:KB]
// <FS:Ansariel> Show auto-response in nametag
static LLCachedControl<bool> fsAutorespondMode(gSavedPerAccountSettings, "FSAutorespondMode");
@ -2954,8 +2960,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
is_muted = isInMuteList();
}
// bool is_friend = LLAvatarTracker::instance().isBuddy(getID());
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
bool is_friend = (!fRlvShowNames) && (LLAvatarTracker::instance().isBuddy(getID()));
// [RLVa:KB] - Checked: RLVa-1.2.2
bool is_friend = (fRlvShowAvName) && (LLAvatarTracker::instance().isBuddy(getID()));
// [/RLVa:KB]
bool is_cloud = getIsCloud();
@ -3128,8 +3134,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
}
// if (sRenderGroupTitles
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
if (sRenderGroupTitles && !fRlvShowNames
// [RLVa:KB] - Checked: RLVa-1.2.2
if (sRenderGroupTitles && fRlvShowAvName
// [/RLVa:KB]
&& title && title->getString() && title->getString()[0] != '\0')
{
@ -3154,8 +3160,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
clearNameTag();
}
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
if ( (!fRlvShowNames) || (isSelf()) )
// [RLVa:KB] - Checked: RLVa-1.2.2
if ( (fRlvShowAvName) || (isSelf()) )
{
// [/RLVa:KB]
// Might be blank if name not available yet, that's OK
@ -3192,7 +3198,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
addNameTagLine(username, username_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall());
}
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
}
else
{
@ -3204,8 +3210,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
{
const LLFontGL* font = LLFontGL::getFontSansSerif();
std::string full_name = LLCacheName::buildFullName( firstname->getString(), lastname->getString() );
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
if ( (fRlvShowNames) && (!isSelf()) )
// [RLVa:KB] - Checked: RLVa-1.2.2
if ( (!fRlvShowAvName) && (!isSelf()) )
{
full_name = RlvStrings::getAnonym(full_name);
addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, font, true);

View File

@ -78,8 +78,9 @@
#include "llstartup.h"
#include "llsdserialize.h"
#include "llcorehttputil.h"
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a)
// [RLVa:KB] - Checked: RLVa-2.0.2
#include "rlvhandler.h"
#include "rlvhelper.h"
#include "rlvlocks.h"
// [/RLVa:KB]
@ -1266,12 +1267,25 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode)
}
else
{
// [RLVa:KB] - Checked: RLVa-2.0.2
bool fRlvCanShowAttachment = true;
if (rlv_handler_t::isEnabled())
{
fRlvCanShowAttachment =
(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWSELF)) &&
( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWSELFHEAD)) || (RLV_ATTACHGROUP_HEAD != rlvAttachGroupFromIndex(attachment->getGroup())) );
}
// [/RLVa:KB]
switch (camera_mode)
{
case CAMERA_MODE_MOUSELOOK:
if (LLVOAvatar::sVisibleInFirstPerson && attachment->getVisibleInFirstPerson())
{
attachment->setAttachmentVisibility(TRUE);
// [RLVa:KB] - Checked: RLVa-2.0.2
attachment->setAttachmentVisibility(fRlvCanShowAttachment);
// [/RLVa:KB]
// attachment->setAttachmentVisibility(TRUE);
}
else
{
@ -1279,7 +1293,10 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode)
}
break;
default:
attachment->setAttachmentVisibility(TRUE);
// [RLVa:KB] - Checked: RLVa-2.0.2
attachment->setAttachmentVisibility(fRlvCanShowAttachment);
// [/RLVa:KB]
// attachment->setAttachmentVisibility(TRUE);
break;
}
}

View File

@ -77,8 +77,8 @@
#include "llvoavatar.h"
#include "llvocache.h"
#include "llmaterialmgr.h"
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.0
#include "rlvactions.h"
#include "rlvlocks.h"
// [/RLVa:KB]
@ -4554,10 +4554,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
// if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects)
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c
const LLViewerObject* pObj = facep->getViewerObject();
if ( (pObj->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) &&
( (!rlv_handler_t::isEnabled()) ||
( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) &&
(gRlvHandler.canEdit(pObj)) ) ) )
if ( (pObj->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) &&
( (!RlvActions::isRlvEnabled()) ||
( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) &&
(RlvActions::canEdit(pObj)) ) ) )
// [/RVLa:KB]
{
return;

View File

@ -1855,6 +1855,35 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
}
}
// [RLVa:KB] - Checked: RLVa-2.0.1
bool LLWorld::getAvatar(const LLUUID& idAvatar, LLVector3d& posAvatar) const
{
for (const LLCharacter* pCharacter : LLCharacter::sInstances)
{
const LLVOAvatar* pAvatar = static_cast<const LLVOAvatar*>(pCharacter);
if ( (!pAvatar->isDead()) && (!pAvatar->mIsDummy) && (!pAvatar->isOrphaned()) && (idAvatar == pAvatar->getID()) )
{
posAvatar = pAvatar->getPositionGlobal();
return true;
}
}
for (const LLViewerRegion* pRegion : LLWorld::getInstance()->getRegionList())
{
for (S32 idxAgent = 0, cntAgent = pRegion->mMapAvatarIDs.size(); idxAgent < cntAgent; ++idxAgent)
{
if (idAvatar == pRegion->mMapAvatarIDs[idxAgent])
{
posAvatar = unpackLocalToGlobalPosition(pRegion->mMapAvatars[idxAgent], pRegion->getOriginGlobal());
return true;
}
}
}
return false;
}
// [/RLVa:KB]
bool LLWorld::isRegionListed(const LLViewerRegion* region) const
{
region_list_t::const_iterator it = find(mRegionList.begin(), mRegionList.end(), region);

View File

@ -235,6 +235,9 @@ public:
// <FS:Ansariel> Make radar more exact and prevent false region crossing notifications
//const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX) const;
const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX, std::map<LLUUID, LLUUID>* region_assignments = NULL) const;
// [RLVa:KB] - Checked: RLVa-2.0.1
bool getAvatar(const LLUUID& idAvatar, LLVector3d& posAvatar) const;
// [/RLVa:KB]
// Returns 'true' if the region is in mRegionList,
// 'false' if the region has been removed due to region change

View File

@ -114,8 +114,8 @@
#include "llpathfindingpathtool.h"
#include "llscenemonitor.h"
#include "llprogressview.h"
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.0
#include "rlvactions.h"
#include "rlvlocks.h"
// [/RLVa:KB]
#include "exopostprocess.h" // <FS:CR> Import Vignette from Exodus
@ -408,6 +408,9 @@ BOOL LLPipeline::sRenderingHUDs;
F32 LLPipeline::sVolumeSAFrame = 0.f; // ZK LBG
bool LLPipeline::sRenderParticles; // <FS:LO> flag to hold correct, user selected, status of particles
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
bool LLPipeline::sRenderTextures = true;
// [/SL:KB]
// EventHost API LLPipeline listener.
static LLPipelineListener sPipelineListener;
@ -3618,9 +3621,9 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera)
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f
const LLViewerObject* pObj = drawablep->getVObj();
if ( (pObj) && (pObj->isSelected()) &&
( (!rlv_handler_t::isEnabled()) ||
( (!RlvActions::isRlvEnabled()) ||
( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) &&
(gRlvHandler.canEdit(pObj)) ) ) )
(RlvActions::canEdit(pObj)) ) ) )
// [/RVLa:KB]
{
return;

View File

@ -591,6 +591,9 @@ public:
static F32 sVolumeSAFrame;
static bool sRenderParticles; // <FS:LO> flag to hold correct, user selected, status of particles
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
static bool sRenderTextures;
// [/SL:KB]
static LLTrace::EventStatHandle<S64> sStatBatchSize;

View File

@ -1,70 +1,209 @@
/**
/**
*
* Copyright (c) 2009-2013, Kitty Barnett
*
* The source code in this file is provided to you under the terms of the
* Copyright (c) 2009-2016, Kitty Barnett
*
* The source code in this file is provided to you under the terms of the
* GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt
* in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt
*
*
* By copying, modifying or distributing this software, you acknowledge that
* you have read and understood your obligations described above, and agree to
* you have read and understood your obligations described above, and agree to
* abide by those obligations.
*
*
*/
#include "llviewerprecompiledheaders.h"
#include "llagent.h"
#include "llimview.h"
#include "llviewercamera.h"
#include "llvoavatarself.h"
#include "llworld.h"
#include "rlvactions.h"
#include "rlvhelper.h"
#include "rlvhandler.h"
// ============================================================================
// Camera
//
bool RlvActions::canChangeCameraFOV(const LLUUID& idRlvObject)
{
// NOTE: if an object has exclusive camera control then all other objects are locked out
return (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) || (gRlvHandler.hasBehaviour(idRlvObject, RLV_BHVR_SETCAM));
}
bool RlvActions::canChangeCameraPreset(const LLUUID& idRlvObject)
{
// NOTE: if an object has exclusive camera control then all other objects are locked out
return
( (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) || (gRlvHandler.hasBehaviour(idRlvObject, RLV_BHVR_SETCAM)) ) &&
(!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_EYEOFFSET)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOCUSOFFSET));
}
bool RlvActions::canChangeToMouselook()
{
// User can switch to mouselook if:
// - not specifically prevented from going into mouselook (NOTE: if an object has exclusive camera control only that object can prevent mouselook)
// - there is no minimum camera distance defined (or it's higher than > 0m)
const RlvBehaviourModifier* pCamDistMinModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_AVDISTMIN);
return
( (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) ? !gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_MOUSELOOK) : !gRlvHandler.hasBehaviour(pCamDistMinModifier->getPrimaryObject(), RLV_BHVR_SETCAM_MOUSELOOK) ) &&
( (!pCamDistMinModifier->hasValue()) || (pCamDistMinModifier->getValue<float>() == 0.f) );
}
bool RlvActions::isCameraDistanceClamped()
{
return
(gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_AVDISTMIN)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_AVDISTMAX)) ||
(gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_ORIGINDISTMIN)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_ORIGINDISTMAX));
}
bool RlvActions::isCameraFOVClamped()
{
return (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOVMIN)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOVMAX));
}
bool RlvActions::isCameraPresetLocked()
{
return (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_EYEOFFSET)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOCUSOFFSET));
}
bool RlvActions::getCameraAvatarDistanceLimits(float& nDistMin, float& nDistMax)
{
bool fDistMin = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_AVDISTMIN), fDistMax = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_AVDISTMAX);
if ( (fDistMin) || (fDistMax) )
{
static RlvCachedBehaviourModifier<float> sCamDistMin(RLV_MODIFIER_SETCAM_AVDISTMIN);
static RlvCachedBehaviourModifier<float> sCamDistMax(RLV_MODIFIER_SETCAM_AVDISTMAX);
nDistMax = (fDistMax) ? sCamDistMax : F32_MAX;
nDistMin = (fDistMin) ? sCamDistMin : 0.0;
return true;
}
return false;
}
bool RlvActions::getCameraOriginDistanceLimits(float& nDistMin, float& nDistMax)
{
bool fDistMin = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_ORIGINDISTMIN), fDistMax = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_ORIGINDISTMAX);
if ( (fDistMin) || (fDistMax) )
{
static RlvCachedBehaviourModifier<float> sCamDistMin(RLV_MODIFIER_SETCAM_ORIGINDISTMIN);
static RlvCachedBehaviourModifier<float> sCamDistMax(RLV_MODIFIER_SETCAM_ORIGINDISTMAX);
nDistMax = (fDistMax) ? sCamDistMax : F32_MAX;
nDistMin = (fDistMin) ? sCamDistMin : 0.0;
return true;
}
return false;
}
bool RlvActions::getCameraFOVLimits(F32& nFOVMin, F32& nFOVMax)
{
bool fClampMin = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOVMIN), fClampMax = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOVMAX);
if ( (fClampMin) || (fClampMax) )
{
static RlvCachedBehaviourModifier<float> sCamFovMin(RLV_MODIFIER_SETCAM_FOVMIN);
static RlvCachedBehaviourModifier<float> sCamFovMax(RLV_MODIFIER_SETCAM_FOVMAX);
nFOVMin = (fClampMin) ? sCamFovMin : LLViewerCamera::getInstance()->getMinView();
nFOVMax = (fClampMax) ? sCamFovMax : LLViewerCamera::getInstance()->getMaxView();
return true;
}
return false;
}
// ============================================================================
// Communication/Avatar interaction
//
//
bool RlvActions::s_BlockNamesContexts[SNC_COUNT] = { 0 };
// Checked: 2010-11-30 (RLVa-1.3.0)
// Little helper function to check the IM exclusion range for @recvim, @sendim and @startim (returns: min_dist <= (pos user - pos target) <= max_dist)
static bool rlvCheckAvatarIMDistance(const LLUUID& idAvatar, ERlvBehaviourModifier eModDistMin, ERlvBehaviourModifier eModDistMax)
{
LLVector3d posAgent;
const RlvBehaviourModifier *pBhvrModDistMin = RlvBehaviourDictionary::instance().getModifier(eModDistMin), *pBhvrModDistMax = RlvBehaviourDictionary::instance().getModifier(eModDistMax);
if ( ((pBhvrModDistMin->hasValue()) || (pBhvrModDistMax->hasValue())) && (LLWorld::getInstance()->getAvatar(idAvatar, posAgent)) )
{
float nDist = llabs(dist_vec_squared(gAgent.getPositionGlobal(), posAgent));
return (nDist >= pBhvrModDistMin->getValue<float>()) && (nDist <= pBhvrModDistMax->getValue<float>());
}
return false;
}
bool RlvActions::canReceiveIM(const LLUUID& idSender)
{
// User can receive an IM from "sender" (could be an agent or a group) if:
// - not generally restricted from receiving IMs (or the sender is an exception)
// - not generally restricted from receiving IMs (or the sender is an exception or inside the exclusion range)
// - not specifically restricted from receiving an IM from the sender
return
(!rlv_handler_t::isEnabled()) ||
( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, idSender)) ) &&
return
(!isRlvEnabled()) ||
( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, idSender)) || (rlvCheckAvatarIMDistance(idSender, RLV_MODIFIER_RECVIMDISTMIN, RLV_MODIFIER_RECVIMDISTMAX)) ) &&
( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIMFROM)) || (!gRlvHandler.isException(RLV_BHVR_RECVIMFROM, idSender)) ) );
}
// Checked: 2010-11-30 (RLVa-1.3.0)
bool RlvActions::canPlayGestures()
{
return (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDGESTURE));
}
bool RlvActions::canSendChannel(int nChannel)
{
return
( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHANNEL)) || (gRlvHandler.isException(RLV_BHVR_SENDCHANNEL, nChannel)) ) &&
( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHANNELEXCEPT)) || (!gRlvHandler.isException(RLV_BHVR_SENDCHANNELEXCEPT, nChannel)) );
}
bool RlvActions::canSendIM(const LLUUID& idRecipient)
{
// User can send an IM to "recipient" (could be an agent or a group) if:
// - not generally restricted from sending IMs (or the recipient is an exception)
// - not generally restricted from sending IMs (or the recipient is an exception or inside the exclusion range)
// - not specifically restricted from sending an IM to the recipient
return
(!rlv_handler_t::isEnabled()) ||
( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.isException(RLV_BHVR_SENDIM, idRecipient)) ) &&
return
(!isRlvEnabled()) ||
( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.isException(RLV_BHVR_SENDIM, idRecipient)) || (rlvCheckAvatarIMDistance(idRecipient, RLV_MODIFIER_SENDIMDISTMIN, RLV_MODIFIER_SENDIMDISTMAX)) ) &&
( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIMTO)) || (!gRlvHandler.isException(RLV_BHVR_SENDIMTO, idRecipient)) ) );
}
bool RlvActions::canStartIM(const LLUUID& idRecipient)
{
// User can start an IM session with "recipient" (could be an agent or a group) if:
// - not generally restricted from starting IM sessions (or the recipient is an exception)
// - not generally restricted from starting IM sessions (or the recipient is an exception or inside the exclusion range)
// - not specifically restricted from starting an IM session with the recipient
// - the session already exists
return
(!rlv_handler_t::isEnabled()) ||
( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIM)) || (gRlvHandler.isException(RLV_BHVR_STARTIM, idRecipient)) ) &&
return
(!isRlvEnabled()) ||
( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIM)) || (gRlvHandler.isException(RLV_BHVR_STARTIM, idRecipient)) || (rlvCheckAvatarIMDistance(idRecipient, RLV_MODIFIER_STARTIMDISTMIN, RLV_MODIFIER_STARTIMDISTMAX)) ) &&
( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIMTO)) || (!gRlvHandler.isException(RLV_BHVR_STARTIMTO, idRecipient)) ) ) ||
( (hasOpenP2PSession(idRecipient)) || (hasOpenGroupSession(idRecipient)) );
}
bool RlvActions::canShowName(EShowNamesContext eContext, const LLUUID& idAgent)
{
// Handle most common case upfront
if (!s_BlockNamesContexts[eContext])
return true;
if (idAgent.notNull())
{
switch (eContext)
{
// Show/hide avatar nametag
case SNC_NAMETAG:
return (gRlvHandler.isException(RLV_BHVR_SHOWNAMETAGS, idAgent)) || (gAgentID == idAgent);
// Show/hide avatar name
case SNC_DEFAULT:
case SNC_TELEPORTOFFER:
case SNC_TELEPORTREQUEST:
return gRlvHandler.isException(RLV_BHVR_SHOWNAMES, idAgent);
}
}
return false;
}
// ============================================================================
// Movement
//
@ -93,28 +232,76 @@ bool RlvActions::autoAcceptTeleportRequest(const LLUUID& idRequester)
// Teleporting
//
bool RlvActions::canTeleportToLocal()
bool RlvActions::canTeleportToLocal(const LLVector3d& posGlobal)
{
return (!gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_TPLOCAL)) && (RlvActions::canStand());
// User can initiate a local teleport if:
// - not restricted from "sit teleporting" (or the destination is within the allowed xy-radius)
// - not restricted from teleporting locally (or the destination is within the allowed xy-radius)
// - can stand up (or isn't sitting)
// NOTE: if we're teleporting due to an active command we should disregard any restrictions from the same object
const LLUUID& idRlvObjExcept = gRlvHandler.getCurrentObject();
bool fCanStand = RlvActions::canStand(idRlvObjExcept);
if ( (fCanStand) && ((gRlvHandler.hasBehaviourExcept(RLV_BHVR_SITTP, gRlvHandler.getCurrentObject())) || (gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOCAL, gRlvHandler.getCurrentObject()))) )
{
// User can stand up but is either @sittp or @tplocal restricted so we need to distance check
const F32 nDistSq = (LLVector2(posGlobal.mdV[0], posGlobal.mdV[1]) - LLVector2(gAgent.getPositionGlobal().mdV[0], gAgent.getPositionGlobal().mdV[1])).lengthSquared();
F32 nMaxDist = llmin(RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_TPLOCALDIST)->getValue<float>(), RLV_MODIFIER_TPLOCAL_DEFAULT);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))
nMaxDist = llmin(nMaxDist, RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SITTPDIST)->getValue<F32>());
return (nDistSq < nMaxDist * nMaxDist);
}
return fCanStand;
}
bool RlvActions::canTeleportToLocation()
{
// NOTE: if we're teleporting due to an active command we should disregard any restrictions from the same object
const LLUUID& idRlvObjExcept = gRlvHandler.getCurrentObject();
return (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOC, idRlvObjExcept)) && (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOCAL, idRlvObjExcept)) && (RlvActions::canStand(idRlvObjExcept));
return (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOC, idRlvObjExcept)) && (RlvActions::canStand(idRlvObjExcept));
}
bool RlvActions::isLocalTp(const LLVector3d& posGlobal)
{
F32 nDistSq = (LLVector2(posGlobal.mdV[0], posGlobal.mdV[1]) - LLVector2(gAgent.getPositionGlobal().mdV[0], gAgent.getPositionGlobal().mdV[1])).lengthSquared();
return nDistSq < RLV_TELEPORT_LOCAL_RADIUS * RLV_TELEPORT_LOCAL_RADIUS;
const F32 nDistSq = (LLVector2(posGlobal.mdV[0], posGlobal.mdV[1]) - LLVector2(gAgent.getPositionGlobal().mdV[0], gAgent.getPositionGlobal().mdV[1])).lengthSquared();
return nDistSq < RLV_MODIFIER_TPLOCAL_DEFAULT * RLV_MODIFIER_TPLOCAL_DEFAULT;
}
// ============================================================================
// World interaction
//
bool RlvActions::canEdit(const LLViewerObject* pObj)
{
// User can edit the specified object if:
// - not generally restricted from editing (or the object's root is an exception)
// - not specifically restricted from editing this object's root
return
(pObj) &&
((!hasBehaviour(RLV_BHVR_EDIT)) || (gRlvHandler.isException(RLV_BHVR_EDIT, pObj->getRootEdit()->getID()))) &&
((!hasBehaviour(RLV_BHVR_EDITOBJ)) || (!gRlvHandler.isException(RLV_BHVR_EDITOBJ, pObj->getRootEdit()->getID())));
}
bool RlvActions::canSit(const LLViewerObject* pObj, const LLVector3& posOffset /*= LLVector3::zero*/)
{
// User can sit on the specified object if:
// - not prevented from sitting
// - not prevented from standing up or not currently sitting
// - not standtp restricted or not currently sitting (if the user is sitting and tried to sit elsewhere the tp would just kick in)
// - not a regular sit (i.e. due to @sit:<uuid>=force)
// - not @sittp=n or @fartouch=n restricted or if they clicked on a point within the allowed radius
static RlvCachedBehaviourModifier<float> s_nFarTouchDist(RLV_MODIFIER_FARTOUCHDIST);
static RlvCachedBehaviourModifier<float> s_nSitTpDist(RLV_MODIFIER_SITTPDIST);
return
( (pObj) && (LL_PCODE_VOLUME == pObj->getPCode()) ) &&
(!hasBehaviour(RLV_BHVR_SIT)) &&
( ((!hasBehaviour(RLV_BHVR_UNSIT)) && (!hasBehaviour(RLV_BHVR_STANDTP))) ||
((isAgentAvatarValid()) && (!gAgentAvatarp->isSitting())) ) &&
( ( (NULL != gRlvHandler.getCurrentCommand()) && (RLV_BHVR_SIT == gRlvHandler.getCurrentCommand()->getBehaviourType()) ) ||
( ((!hasBehaviour(RLV_BHVR_SITTP)) || (dist_vec_squared(gAgent.getPositionGlobal(), pObj->getPositionGlobal() + LLVector3d(posOffset)) < s_nSitTpDist * s_nSitTpDist)) &&
((!hasBehaviour(RLV_BHVR_FARTOUCH)) || (dist_vec_squared(gAgent.getPositionGlobal(), pObj->getPositionGlobal() + LLVector3d(posOffset)) < s_nFarTouchDist * s_nFarTouchDist)) ) );
}
bool RlvActions::canStand()
{
// NOTE: return FALSE only if we're @unsit=n restricted and the avie is currently sitting on something and TRUE for everything else
@ -135,7 +322,13 @@ bool RlvActions::canShowLocation()
// ============================================================================
// Helper functions
//
//
template<>
const float& RlvActions::getModifierValue<float>(ERlvBehaviourModifier eBhvrMod)
{
return RlvBehaviourDictionary::instance().getModifier(eBhvrMod)->getValue<float>();
}
// Checked: 2013-05-10 (RLVa-1.4.9)
bool RlvActions::hasBehaviour(ERlvBehaviour eBhvr)

View File

@ -1,17 +1,17 @@
/**
/**
*
* Copyright (c) 2009-2013, Kitty Barnett
*
* The source code in this file is provided to you under the terms of the
* Copyright (c) 2009-2016, Kitty Barnett
*
* The source code in this file is provided to you under the terms of the
* GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt
* in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt
*
*
* By copying, modifying or distributing this software, you acknowledge that
* you have read and understood your obligations described above, and agree to
* you have read and understood your obligations described above, and agree to
* abide by those obligations.
*
*
*/
#ifndef RLV_ACTIONS_H
@ -25,6 +25,51 @@
class RlvActions
{
// ======
// Camera
// ======
public:
/*
* Returns true if the specified object cannot manipulate the camera FOV
*/
static bool canChangeCameraFOV(const LLUUID& idRlvObject);
/*
* Returns true if the specified object can manipulate the camera offset and/or focus offset values
*/
static bool canChangeCameraPreset(const LLUUID& idRlvObject);
/*
* Returns true if the user can switch to mouselook
*/
static bool canChangeToMouselook();
/*
* Returns true if the camera's distance (from either the avatar of the focus) is currently restricted/clamped
*/
static bool isCameraDistanceClamped();
/*
* Returns true if the camera's FOV is currently restricted/clamped
*/
static bool isCameraFOVClamped();
/*
* Returns true if the camera offset and focus offset are locked (prevents changing the current camera preset)
*/
static bool isCameraPresetLocked();
/*
* Retrieves the current (avatar or focus) camera distance limits
*/
static bool getCameraAvatarDistanceLimits(float& nDistMin, float& nDistMax);
static bool getCameraOriginDistanceLimits(float& nDistMin, float& nDistMax);
/*
* Retrieves the current camera FOV limits - returns isCameraFOVClamped()
*/
static bool getCameraFOVLimits(float& nFOVMin, float& nFOVMax);
// ================================
// Communication/Avatar interaction
// ================================
@ -34,6 +79,16 @@ public:
*/
static bool canReceiveIM(const LLUUID& idSender);
/*
* Returns true if the user is allowed to send/play gestures (whether active ones from the chat bar or using the gesture preview floater)
*/
static bool canPlayGestures();
/*
* Returns true if the user is allowed to chat on the specified channel
*/
static bool canSendChannel(int nChannel);
/*
* Returns true if the user is allowed to send IMs to the specified recipient (can be an avatar or a group)
*/
@ -49,9 +104,9 @@ public:
* (This is used to hide an avatar name in one case but not a near-identical case - such as teleporting a friend vs a nearby agent -
* in a way that limits the amount of code that needs to be changed to carry context from one function to another)
*/
enum EShowNamesContext { SNC_TELEPORTOFFER = 0, SNC_TELEPORTREQUEST, SNC_COUNT };
static bool canShowName(EShowNamesContext eContext) { return (eContext < SNC_COUNT) ? !s_BlockNamesContexts[eContext] : false; }
static void setShowName(EShowNamesContext eContext, bool fShowName) { if ( (eContext < SNC_COUNT) && (isRlvEnabled()) ) { s_BlockNamesContexts[eContext] = !fShowName; } }
enum EShowNamesContext { SNC_DEFAULT = 0, SNC_NAMETAG, SNC_TELEPORTOFFER, SNC_TELEPORTREQUEST, SNC_COUNT };
static bool canShowName(EShowNamesContext eContext, const LLUUID& idAgent = LLUUID::null);
static void setShowName(EShowNamesContext eContext, bool fCanShowName) { if ( (eContext < SNC_COUNT) && (isRlvEnabled()) ) { s_BlockNamesContexts[eContext] = !fCanShowName; } }
protected:
// Backwards logic so that we can initialize to 0 and it won't block when we forget to/don't check if RLVa is disabled
@ -90,7 +145,7 @@ public:
/*
* Returns true if the user can teleport locally (short distances)
*/
static bool canTeleportToLocal();
static bool canTeleportToLocal(const LLVector3d& posGlobal);
/*
* Returns true if the user can teleport to a (remote) location
@ -106,6 +161,16 @@ public:
// World interaction
// =================
public:
/*
* Returns true if the user can edit the specified object
*/
static bool canEdit(const LLViewerObject* pObj);
/*
* Returns true if the user can sit up on the specified object
*/
static bool canSit(const LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero);
/*
* Returns true if the user can stand up (returns true if the user isn't currently sitting)
*/
@ -122,13 +187,18 @@ public:
// ================
public:
/*
* Convenience function to check for a behaviour without having to include rlvhandler.h.
* Convenience function to get the current/active value of a behaviour modifier
*/
template<typename T> static const T& getModifierValue(ERlvBehaviourModifier eBhvrMod);
/*
* Convenience function to check for a behaviour without having to include rlvhandler.h.
* Do NOT call this function if speed is important (i.e. per-frame)
*/
static bool hasBehaviour(ERlvBehaviour eBhvr);
/*
* Returns true if a - P2P or group - IM session is open with the specified UUID.
* Returns true if a - P2P or group - IM session is open with the specified UUID
*/
static bool hasOpenP2PSession(const LLUUID& idAgent);
static bool hasOpenGroupSession(const LLUUID& idGroup);

View File

@ -20,6 +20,7 @@
#include "llavatarnamecache.h"
#include "llinstantmessage.h"
#include "llnotificationsutil.h"
#include "llregionhandle.h"
#include "llsdserialize.h"
#include "lltrans.h"
#include "llviewerparcelmgr.h"
@ -36,6 +37,13 @@
#include "llscriptruntimeperms.h"
#include <boost/algorithm/string.hpp>
// ============================================================================
// Forward declarations
//
// llviewermenu.cpp
LLVOAvatar* find_avatar_from_object(LLViewerObject* object);
// ============================================================================
// RlvNotifications
//
@ -71,7 +79,6 @@ bool RlvSettings::fCompositeFolders = false;
bool RlvSettings::fCanOOC = true;
bool RlvSettings::fLegacyNaming = true;
bool RlvSettings::fNoSetEnv = false;
bool RlvSettings::fShowNameTags = false;
// Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-1.1.0i
void RlvSettings::initClass()
@ -92,10 +99,6 @@ void RlvSettings::initClass()
fCanOOC = rlvGetSetting<bool>(RLV_SETTING_CANOOC, true);
fNoSetEnv = rlvGetSetting<bool>(RLV_SETTING_NOSETENV, false);
fShowNameTags = rlvGetSetting<bool>(RLV_SETTING_SHOWNAMETAGS, false);
if (gSavedSettings.controlExists(RLV_SETTING_SHOWNAMETAGS))
gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fShowNameTags));
// Don't allow toggling RLVaLoginLastLocation from the debug settings floater
if (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION))
gSavedPerAccountSettings.getControl(RLV_SETTING_LOGINLASTLOCATION)->setHiddenFromSettingsEditor(true);
@ -381,7 +384,7 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy)
for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++)
{
LLAvatarName avName;
if (LLAvatarNameCache::get(idAgents[idxAgent], &avName))
if ( (LLAvatarNameCache::get(idAgents[idxAgent], &avName)) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgents[idxAgent])) )
{
const std::string& strDisplayName = avName.getDisplayName();
bool fFilterDisplay = (strDisplayName.length() > 2);
@ -529,6 +532,18 @@ bool RlvUtil::sendChatReply(S32 nChannel, const std::string& strUTF8Text)
return true;
}
void RlvUtil::teleportCallback(U64 hRegion, const LLVector3& posRegion, const LLVector3& vecLookAt)
{
if (hRegion)
{
const LLVector3d posGlobal = from_region_handle(hRegion) + (LLVector3d)posRegion;
if (vecLookAt.isExactlyZero())
gAgent.teleportViaLocation(posGlobal);
else
gAgent.teleportViaLocationLookAt(posGlobal, vecLookAt);
}
}
// ============================================================================
// Generic menu enablers
//
@ -575,6 +590,12 @@ void rlvMenuToggleVisible()
}
}
bool rlvMenuCanShowName()
{
const LLVOAvatar* pAvatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
return (pAvatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, pAvatar->getID()));
}
// Checked: 2010-04-23 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g
bool rlvMenuEnableIfNot(const LLSD& sdParam)
{
@ -625,7 +646,7 @@ bool RlvSelectHasLockedAttach::apply(LLSelectNode* pNode)
bool RlvSelectIsEditable::apply(LLSelectNode* pNode)
{
const LLViewerObject* pObj = pNode->getObject();
return (pObj) && (!gRlvHandler.canEdit(pObj));
return (pObj) && (!RlvActions::canEdit(pObj));
}
// Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a

View File

@ -56,7 +56,7 @@ class RlvObject;
struct RlvException;
typedef boost::variant<std::string, LLUUID, S32, ERlvBehaviour> RlvExceptionOption;
typedef boost::variant<int, float> RlvBehaviourModifierValue;
typedef boost::variant<int, float, LLVector3, LLUUID> RlvBehaviourModifierValue;
class RlvGCTimer;
@ -97,7 +97,6 @@ public:
static bool getHideLockedAttach() { return rlvGetSetting<bool>(RLV_SETTING_HIDELOCKEDATTACH, false); }
static bool getHideLockedInventory() { return rlvGetSetting<bool>(RLV_SETTING_HIDELOCKEDINVENTORY, false); }
static bool getSharedInvAutoRename() { return rlvGetSetting<bool>(RLV_SETTING_SHAREDINVAUTORENAME, true); }
static bool getShowNameTags() { return fShowNameTags; }
static bool getLoginLastLocation() { return rlvGetPerUserSetting<bool>(RLV_SETTING_LOGINLASTLOCATION, true); }
static void updateLoginLastLocation();
@ -114,7 +113,6 @@ protected:
static bool fCanOOC;
static bool fLegacyNaming;
static bool fNoSetEnv;
static bool fShowNameTags;
};
// ============================================================================
@ -174,6 +172,7 @@ public:
static bool sendChatReply(S32 nChannel, const std::string& strUTF8Text);
static bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text);
static void teleportCallback(U64 hRegion, const LLVector3& posRegion, const LLVector3& vecLookAt);
protected:
static bool m_fForceTp; // @standtp
};
@ -199,6 +198,7 @@ typedef bool (RlvExtCommandHandler::*rlvExtCommandHandler)(const RlvCommand& rlv
bool rlvMenuMainToggleVisible(LLUICtrl* pMenuItem);
void rlvMenuToggleVisible();
bool rlvMenuCanShowName();
bool rlvMenuEnableIfNot(const LLSD& sdParam);
// ============================================================================

View File

@ -22,9 +22,9 @@
//
// Version of the specifcation we support
const S32 RLV_VERSION_MAJOR = 2;
const S32 RLV_VERSION_MINOR = 8;
const S32 RLV_VERSION_PATCH = 0;
const S32 RLV_VERSION_MAJOR = 3;
const S32 RLV_VERSION_MINOR = 1;
const S32 RLV_VERSION_PATCH = 4;
const S32 RLV_VERSION_BUILD = 0;
// Implementation version
@ -66,13 +66,15 @@ const S32 RLVa_VERSION_BUILD = 0;
#define RLV_ROOT_FOLDER "#RLV"
#define RLV_CMD_PREFIX '@'
#define RLV_MODIFIER_TPLOCAL_DEFAULT 256.f // Any teleport that's more than a region away is non-local
#define RLV_MODIFIER_FARTOUCH_DEFAULT 1.5f // Specifies the default @fartouch distance
#define RLV_MODIFIER_SITTP_DEFAULT 1.5f // Specifies the default @sittp distance
#define RLV_OPTION_SEPARATOR ";" // Default separator used in command options
#define RLV_PUTINV_PREFIX "#RLV/~"
#define RLV_PUTINV_SEPARATOR "/"
#define RLV_PUTINV_MAXDEPTH 4
#define RLV_SETROT_OFFSET F_PI_BY_TWO // @setrot is off by 90° with the rest of SL
#define RLV_STRINGS_FILE "rlva_strings.xml"
#define RLV_TELEPORT_LOCAL_RADIUS 256 // Any teleport that's more than a region away is non-local
#define RLV_FOLDER_FLAG_NOSTRIP "nostrip"
#define RLV_FOLDER_PREFIX_HIDDEN '.'
@ -104,13 +106,15 @@ enum ERlvBehaviour {
RLV_BHVR_CHATWHISPER, // "chatwhisper"
RLV_BHVR_CHATNORMAL, // "chatnormal"
RLV_BHVR_CHATSHOUT, // "chatshout"
RLV_BHVR_SENDCHANNEL, // "sendchannel"
RLV_BHVR_SENDCHANNEL,
RLV_BHVR_SENDCHANNELEXCEPT,
RLV_BHVR_SENDIM, // "sendim"
RLV_BHVR_SENDIMTO, // "sendimto"
RLV_BHVR_RECVIM, // "recvim"
RLV_BHVR_RECVIMFROM, // "recvimfrom"
RLV_BHVR_STARTIM, // "startim"
RLV_BHVR_STARTIMTO, // "startimto"
RLV_BHVR_SENDGESTURE,
RLV_BHVR_PERMISSIVE, // "permissive"
RLV_BHVR_NOTIFY, // "notify"
RLV_BHVR_SHOWINV, // "showinv"
@ -118,10 +122,13 @@ enum ERlvBehaviour {
RLV_BHVR_SHOWWORLDMAP, // "showworldmap"
RLV_BHVR_SHOWLOC, // "showloc"
RLV_BHVR_SHOWNAMES, // "shownames"
RLV_BHVR_SHOWNAMETAGS, // "shownametags"
RLV_BHVR_SHOWHOVERTEXT, // "showhovertext"
RLV_BHVR_SHOWHOVERTEXTHUD, // "showhovertexthud"
RLV_BHVR_SHOWHOVERTEXTWORLD, // "showhovertextworld"
RLV_BHVR_SHOWHOVERTEXTALL, // "showhovertextall"
RLV_BHVR_SHOWSELF,
RLV_BHVR_SHOWSELFHEAD,
RLV_BHVR_TPLM, // "tplm"
RLV_BHVR_TPLOC, // "tploc"
RLV_BHVR_TPLOCAL,
@ -188,13 +195,59 @@ enum ERlvBehaviour {
RLV_BHVR_GETSTATUSALL, // "getstatusall"
RLV_CMD_FORCEWEAR, // Internal representation of all force wear commands
// Camera (behaviours)
RLV_BHVR_SETCAM, // Gives an object exclusive control of the user's camera
RLV_BHVR_SETCAM_AVDISTMIN, // Enforces a minimum distance from the avatar (in m)
RLV_BHVR_SETCAM_AVDISTMAX, // Enforces a maximum distance from the avatar (in m)
RLV_BHVR_SETCAM_ORIGINDISTMIN, // Enforces a minimum distance from the camera origin (in m)
RLV_BHVR_SETCAM_ORIGINDISTMAX, // Enforces a maximum distance from the camera origin (in m)
RLV_BHVR_SETCAM_EYEOFFSET, // Changes the default camera offset
RLV_BHVR_SETCAM_FOCUSOFFSET, // Changes the default camera focus offset
RLV_BHVR_SETCAM_FOCUS, // Forces the camera focus and/or position to a specific object, avatar or position
RLV_BHVR_SETCAM_FOV, // Changes the current - vertical - field of view
RLV_BHVR_SETCAM_FOVMIN, // Enforces a minimum - vertical - FOV (in degrees)
RLV_BHVR_SETCAM_FOVMAX, // Enforces a maximum - vertical - FOV (in degrees)
RLV_BHVR_SETCAM_MOUSELOOK, // Prevent the user from going into mouselook
RLV_BHVR_SETCAM_TEXTURES, // Replaces all textures with the specified texture (or the default unrezzed one)
RLV_BHVR_SETCAM_UNLOCK, // Forces the camera focus to the user's avatar
// Camera (behaviours - deprecated)
RLV_BHVR_CAMZOOMMIN, // Enforces a minimum - vertical - FOV angle of 60° / multiplier
RLV_BHVR_CAMZOOMMAX, // Enforces a maximum - vertical - FOV angle of 60° / multiplier
// Camera (reply)
RLV_BHVR_GETCAM_AVDIST, // Returns the current minimum distance between the camera and the user's avatar
RLV_BHVR_GETCAM_AVDISTMIN, // Returns the active (if any) minimum distance between the camera and the user's avatar
RLV_BHVR_GETCAM_AVDISTMAX, // Returns the active (if any) maxmimum distance between the camera and the user's avatar
RLV_BHVR_GETCAM_FOV, // Returns the current field of view angle (in radians)
RLV_BHVR_GETCAM_FOVMIN, // Returns the active (if any) minimum field of view angle (in radians)
RLV_BHVR_GETCAM_FOVMAX, // Enforces a maximum (if any) maximum field of view angle (in radians)
RLV_BHVR_GETCAM_TEXTURES, // Returns the active (if any) replace texture UUID
// Camera (force)
RLV_BHVR_SETCAM_MODE, // Switch the user's camera into the specified mode (e.g. mouselook or thirdview)
RLV_BHVR_COUNT,
RLV_BHVR_UNKNOWN
};
enum ERlvBehaviourModifier
{
RLV_MODIFIER_PLACEHOLDER,
RLV_MODIFIER_FARTOUCHDIST, // Radius of a sphere around the user in which they can interact with the world
RLV_MODIFIER_RECVIMDISTMIN, // Minimum distance to receive an IM from an otherwise restricted sender (squared value)
RLV_MODIFIER_RECVIMDISTMAX, // Maximum distance to receive an IM from an otherwise restricted sender (squared value)
RLV_MODIFIER_SENDIMDISTMIN, // Minimum distance to send an IM to an otherwise restricted recipient (squared value)
RLV_MODIFIER_SENDIMDISTMAX, // Maximum distance to send an IM to an otherwise restricted recipient (squared value)
RLV_MODIFIER_STARTIMDISTMIN, // Minimum distance to start an IM to an otherwise restricted recipient (squared value)
RLV_MODIFIER_STARTIMDISTMAX, // Maximum distance to start an IM to an otherwise restricted recipient (squared value)
RLV_MODIFIER_SETCAM_AVDISTMIN, // Minimum distance between the camera position and the user's avatar (normal value)
RLV_MODIFIER_SETCAM_AVDISTMAX, // Maximum distance between the camera position and the user's avatar (normal value)
RLV_MODIFIER_SETCAM_ORIGINDISTMIN, // Minimum distance between the camera position and the origin point (normal value)
RLV_MODIFIER_SETCAM_ORIGINDISTMAX, // Maximum distance between the camera position and the origin point (normal value)
RLV_MODIFIER_SETCAM_EYEOFFSET, // Specifies the default camera's offset from the camera (vector)
RLV_MODIFIER_SETCAM_FOCUSOFFSET, // Specifies the default camera's focus (vector)
RLV_MODIFIER_SETCAM_FOVMIN, // Minimum value for the camera's field of view (angle in radians)
RLV_MODIFIER_SETCAM_FOVMAX, // Maximum value for the camera's field of view (angle in radians)
RLV_MODIFIER_SETCAM_TEXTURE, // Specifies the UUID of the texture used to texture the world view
RLV_MODIFIER_SITTPDIST,
RLV_MODIFIER_TPLOCALDIST,
RLV_MODIFIER_COUNT,
RLV_MODIFIER_UNKNOWN
@ -294,7 +347,6 @@ enum ERlvAttachGroupType
#define RLV_SETTING_LOGINLASTLOCATION "RLVaLoginLastLocation"
#define RLV_SETTING_SHAREDINVAUTORENAME "RLVaSharedInvAutoRename"
#define RLV_SETTING_SHOWASSERTIONFAIL "RLVaShowAssertionFailures"
#define RLV_SETTING_SHOWNAMETAGS "RLVaShowNameTags"
#define RLV_SETTING_TOPLEVELMENU "RLVaTopLevelMenu"
#define RLV_SETTING_WEARREPLACEUNLOCKED "RLVaWearReplaceUnlocked"
@ -309,6 +361,7 @@ enum ERlvAttachGroupType
#define RLV_STRING_HIDDEN_PARCEL "hidden_parcel"
#define RLV_STRING_HIDDEN_REGION "hidden_region"
#define RLV_STRING_BLOCKED_AUTOPILOT "blocked_autopilot"
#define RLV_STRING_BLOCKED_GENERIC "blocked_generic"
#define RLV_STRING_BLOCKED_PERMATTACH "blocked_permattach"
#define RLV_STRING_BLOCKED_PERMTELEPORT "blocked_permteleport"
@ -318,6 +371,7 @@ enum ERlvAttachGroupType
#define RLV_STRING_BLOCKED_STARTCONF "blocked_startconf"
#define RLV_STRING_BLOCKED_STARTIM "blocked_startim"
#define RLV_STRING_BLOCKED_TELEPORT "blocked_teleport"
#define RLV_STRING_BLOCKED_TELEPORT_OFFER "blocked_teleport_offer"
#define RLV_STRING_BLOCKED_TPLUREREQ_REMOTE "blocked_tplurerequest_remote"
#define RLV_STRING_BLOCKED_VIEWXXX "blocked_viewxxx"
#define RLV_STRING_BLOCKED_WIREFRAME "blocked_wireframe"

View File

@ -74,20 +74,26 @@ std::string rlvGetItemType(const LLViewerInventoryItem* pItem)
return "Unknown";
}
// Checked: 2010-03-11 (RLVa-1.2.0a) | Modified: RLVa-1.2.0g
std::string rlvGetItemNameFromObjID(const LLUUID& idObj, bool fIncludeAttachPt = true)
{
const LLViewerObject* pObj = gObjectList.findObject(idObj);
if ( (pObj) && (pObj->isAvatar()) )
{
LLAvatarName avName;
if (LLAvatarNameCache::get(pObj->getID(), &avName))
return avName.getCompleteName();
return ((LLVOAvatar*)pObj)->getFullname();
}
const LLViewerObject* pObjRoot = (pObj) ? pObj->getRootEdit() : NULL;
const LLViewerInventoryItem* pItem = ((pObjRoot) && (pObjRoot->isAttachment())) ? gInventory.getItem(pObjRoot->getAttachmentItemID()) : NULL;
std::string strItemName = (pItem) ? pItem->getName() : idObj.asString();
const std::string strItemName = (pItem) ? pItem->getName() : idObj.asString();
if ( (!fIncludeAttachPt) || (!pObj) || (!pObj->isAttachment()) || (!isAgentAvatarValid()) )
return strItemName;
const LLViewerJointAttachment* pAttachPt =
get_if_there(gAgentAvatarp->mAttachmentPoints, RlvAttachPtLookup::getAttachPointIndex(pObjRoot), (LLViewerJointAttachment*)NULL);
std::string strAttachPtName = (pAttachPt) ? pAttachPt->getName() : std::string("Unknown");
const LLViewerJointAttachment* pAttachPt = get_if_there(gAgentAvatarp->mAttachmentPoints, RlvAttachPtLookup::getAttachPointIndex(pObjRoot), (LLViewerJointAttachment*)NULL);
const std::string strAttachPtName = (pAttachPt) ? pAttachPt->getName() : std::string("Unknown");
return llformat("%s (%s%s)", strItemName.c_str(), strAttachPtName.c_str(), (pObj == pObjRoot) ? "" : ", child");
}
@ -105,6 +111,8 @@ bool rlvGetShowException(ERlvBehaviour eBhvr)
case RLV_BHVR_TPREQUEST:
case RLV_BHVR_ACCEPTTP:
case RLV_BHVR_ACCEPTTPREQUEST:
case RLV_BHVR_SHOWNAMES:
case RLV_BHVR_SHOWNAMETAGS:
return true;
default:
return false;
@ -275,15 +283,16 @@ BOOL RlvFloaterBehaviours::postBuild()
return TRUE;
}
// Checked: 2011-05-23 (RLVa-1.3.1c) | Modified: RLVa-1.3.1c
void RlvFloaterBehaviours::refreshAll()
{
LLCtrlListInterface* pBhvrList = childGetListInterface("behaviour_list");
LLCtrlListInterface* pExceptList = childGetListInterface("exception_list");
if ( (!pBhvrList) || (!pExceptList) )
LLCtrlListInterface* pModifierList = childGetListInterface("modifier_list");
if ( (!pBhvrList) || (!pExceptList) || (!pModifierList) )
return;
pBhvrList->operateOnAll(LLCtrlListInterface::OP_DELETE);
pExceptList->operateOnAll(LLCtrlListInterface::OP_DELETE);
pModifierList->operateOnAll(LLCtrlListInterface::OP_DELETE);
if (!isAgentAvatarValid())
return;
@ -300,6 +309,11 @@ void RlvFloaterBehaviours::refreshAll()
sdExceptColumns[1] = LLSD().with("column", "option").with("type", "text");
sdExceptColumns[2] = LLSD().with("column", "issuer").with("type", "text");
LLSD sdModifierRow; LLSD& sdModifierColumns = sdModifierRow["columns"];
sdModifierColumns[0] = LLSD().with("column", "modifier").with("type", "text");
sdModifierColumns[1] = LLSD().with("column", "value").with("type", "text");
sdModifierColumns[2] = LLSD().with("column", "primary").with("type", "text");
//
// List behaviours
//
@ -353,6 +367,35 @@ void RlvFloaterBehaviours::refreshAll()
}
}
}
//
// List modifiers
//
for (int idxModifier = 0; idxModifier < RLV_MODIFIER_COUNT; idxModifier++)
{
const RlvBehaviourModifier* pBhvrModifier = RlvBehaviourDictionary::instance().m_BehaviourModifiers[idxModifier];
if (pBhvrModifier)
{
sdModifierRow["enabled"] = (pBhvrModifier->hasValue());
sdModifierColumns[0]["value"] = pBhvrModifier->getName();
if (pBhvrModifier->hasValue())
{
const RlvBehaviourModifierValue& modValue = pBhvrModifier->getValue();
if (typeid(float) == modValue.type())
sdModifierColumns[1]["value"] = llformat("%f", boost::get<float>(modValue));
else if (typeid(int) == modValue.type())
sdModifierColumns[1]["value"] = llformat("%d", boost::get<int>(modValue));
}
else
{
sdModifierColumns[1]["value"] = "(default)";
}
sdModifierColumns[2]["value"] = (pBhvrModifier->getPrimaryObject().notNull()) ? rlvGetItemNameFromObjID(pBhvrModifier->getPrimaryObject()) : LLStringUtil::null;
pModifierList->addElement(sdModifierRow, ADD_BOTTOM);
}
}
}
// ============================================================================
@ -703,6 +746,11 @@ BOOL RlvFloaterConsole::postBuild()
return TRUE;
}
void RlvFloaterConsole::onClose(bool fQuitting)
{
gRlvHandler.processCommand(gAgent.getID(), "clear", true);
}
void RlvFloaterConsole::addCommandReply(const std::string& strCommand, const std::string& strReply)
{
m_pOutputText->appendText(llformat("%s: ", strCommand.c_str()), true);

View File

@ -142,6 +142,7 @@ private:
*/
public:
BOOL postBuild() override;
void onClose(bool fQuitting) override;
/*
* Member functions

View File

@ -24,21 +24,32 @@
#include "llmoveview.h"
#include "llstartup.h"
#include "llviewermessage.h"
#include "llviewermenu.h"
#include "llviewerobjectlist.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
// Command specific includes
#include "llagentcamera.h" // @setcam and related
#include "llavatarnamecache.h" // @shownames
#include "llavatarlist.h" // @shownames
#include "llenvmanager.h" // @setenv
#include "llfloatersidepanelcontainer.h"// @shownames
#include "lloutfitslist.h" // @showinv - "Appearance / My Outfits" panel
#include "llpaneloutfitsinventory.h" // @showinv - "Appearance" floater
#include "llpanelpeople.h" // @shownames
#include "llpanelwearing.h" // @showinv - "Appearance / Current Outfit" panel
#include "llsidepanelappearance.h" // @showinv - "Appearance / Edit appearance" panel
#include "lltabcontainer.h" // @showinv - Tab container control for inventory tabs
#include "lltoolmgr.h" // @edit
#include "llviewercamera.h" // @setcam and related
#include "llworldmapmessage.h" // @tpto
#include "llviewertexturelist.h" // @setcam_texture
// RLVa includes
#include "rlvactions.h"
#include "rlvfloaters.h"
#include "rlvactions.h"
#include "rlvhandler.h"
#include "rlvhelper.h"
#include "rlvinventory.h"
@ -135,6 +146,23 @@ RlvHandler::~RlvHandler()
// Behaviour related functions
//
bool RlvHandler::findBehaviour(ERlvBehaviour eBhvr, std::list<const RlvObject*>& lObjects) const
{
lObjects.clear();
for (const auto& objEntry : m_Objects)
if (objEntry.second.hasBehaviour(eBhvr, false))
lObjects.push_back(&objEntry.second);
return !lObjects.empty();
}
bool RlvHandler::hasBehaviour(const LLUUID& idRlvObj, ERlvBehaviour eBhvr, const std::string& strOption) const
{
rlv_object_map_t::const_iterator itObj = m_Objects.find(idRlvObj);
if (m_Objects.end() != itObj)
return itObj->second.hasBehaviour(eBhvr, strOption, false);
return false;
}
bool RlvHandler::hasBehaviourExcept(ERlvBehaviour eBhvr, const std::string& strOption, const LLUUID& idObj) const
{
for (rlv_object_map_t::const_iterator itObj = m_Objects.begin(); itObj != m_Objects.end(); ++itObj)
@ -293,7 +321,7 @@ ERlvCmdRet RlvHandler::processCommand(const RlvCommand& rlvCmd, bool fFromObj)
case RLV_TYPE_ADD: // Checked: 2009-11-26 (RLVa-1.1.0f) | Modified: RLVa-1.1.0f
{
if ( (m_Behaviours[rlvCmd.getBehaviourType()]) &&
( (RLV_BHVR_SETDEBUG == rlvCmd.getBehaviourType()) || (RLV_BHVR_SETENV == rlvCmd.getBehaviourType()) ) )
( (RLV_BHVR_SETCAM == rlvCmd.getBehaviourType()) || (RLV_BHVR_SETDEBUG == rlvCmd.getBehaviourType()) || (RLV_BHVR_SETENV == rlvCmd.getBehaviourType()) ) )
{
// Some restrictions can only be held by one single object to avoid deadlocks
RLV_DEBUGS << "\t- " << rlvCmd.getBehaviour() << " is already set by another object => discarding" << RLV_ENDL;
@ -682,25 +710,6 @@ void RlvHandler::onTeleportFinished(const LLVector3d& posArrival)
// String/chat censoring functions
//
// Checked: 2010-03-06 (RLVa-1.2.0c) | Added: RLVa-1.1.0j
bool RlvHandler::canSit(LLViewerObject* pObj, const LLVector3& posOffset /*= LLVector3::zero*/) const
{
// The user can sit on the specified object if:
// - not prevented from sitting
// - not prevented from standing up or not currently sitting
// - not standtp restricted or not currently sitting (if the user is sitting and tried to sit elsewhere the tp would just kick in)
// - not a regular sit (i.e. due to @sit:<uuid>=force)
// - not @sittp=n or @fartouch=n restricted or if they clicked on a point within 1.5m of the avie's current position
return
( (pObj) && (LL_PCODE_VOLUME == pObj->getPCode()) ) &&
(!hasBehaviour(RLV_BHVR_SIT)) &&
( ((!hasBehaviour(RLV_BHVR_UNSIT)) && (!hasBehaviour(RLV_BHVR_STANDTP))) ||
((isAgentAvatarValid()) && (!gAgentAvatarp->isSitting())) ) &&
( ( (NULL != getCurrentCommand()) && (RLV_BHVR_SIT == getCurrentCommand()->getBehaviourType()) ) ||
( (!hasBehaviour(RLV_BHVR_SITTP)) && (!hasBehaviour(RLV_BHVR_FARTOUCH)) ) ||
(dist_vec_squared(gAgent.getPositionGlobal(), pObj->getPositionGlobal() + LLVector3d(posOffset)) < 1.5f * 1.5f) );
}
// Checked: 2010-04-11 (RLVa-1.3.0h) | Modified: RLVa-1.3.0h
bool RlvHandler::canTouch(const LLViewerObject* pObj, const LLVector3& posOffset /*=LLVector3::zero*/) const
{
@ -708,16 +717,17 @@ bool RlvHandler::canTouch(const LLViewerObject* pObj, const LLVector3& posOffset
bool fCanTouch = (idRoot.notNull()) && ((pObj->isHUDAttachment()) || (!hasBehaviour(RLV_BHVR_TOUCHALL))) &&
((!hasBehaviour(RLV_BHVR_TOUCHTHIS)) || (!isException(RLV_BHVR_TOUCHTHIS, idRoot, RLV_CHECK_PERMISSIVE)));
static RlvCachedBehaviourModifier<float> s_nFartouchDist(RLV_MODIFIER_FARTOUCHDIST);
if (fCanTouch)
{
if ( (!pObj->isAttachment()) || (!pObj->permYouOwner()) )
{
// Rezzed prim or attachment worn by another avie
fCanTouch =
fCanTouch =
( (!hasBehaviour(RLV_BHVR_TOUCHWORLD)) || (isException(RLV_BHVR_TOUCHWORLD, idRoot, RLV_CHECK_PERMISSIVE)) ) &&
( (!pObj->isAttachment()) || (!hasBehaviour(RLV_BHVR_TOUCHATTACHOTHER)) ) &&
( (!hasBehaviour(RLV_BHVR_FARTOUCH)) ||
(dist_vec_squared(gAgent.getPositionGlobal(), pObj->getPositionGlobal() + LLVector3d(posOffset)) <= 1.5f * 1.5f) );
( (!hasBehaviour(RLV_BHVR_FARTOUCH)) ||
(dist_vec_squared(gAgent.getPositionGlobal(), pObj->getPositionGlobal() + LLVector3d(posOffset)) <= s_nFartouchDist * s_nFartouchDist) );
}
else if (!pObj->isHUDAttachment())
{
@ -832,7 +842,7 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const
endRedir = m_Exceptions.upper_bound(eBhvr); itRedir != endRedir; ++itRedir)
{
S32 nChannel = boost::get<S32>(itRedir->second.varOption);
if ( (!hasBehaviour(RLV_BHVR_SENDCHANNEL)) || (isException(RLV_BHVR_SENDCHANNEL, nChannel)) )
if (RlvActions::canSendChannel(nChannel))
RlvUtil::sendChatReply(nChannel, strUTF8Text);
}
@ -1268,6 +1278,7 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd)
if (rlvCmd.isStrict())
addException(rlvCmd.getObjectID(), RLV_BHVR_PERMISSIVE, eBhvr);
m_Behaviours[eBhvr]++;
rlvCmd.markRefCounted();
}
else
{
@ -1300,6 +1311,7 @@ ERlvCmdRet RlvCommandHandlerBaseImpl<RLV_TYPE_ADDREM>::processCommand(const RlvC
if (rlvCmd.isStrict())
gRlvHandler.addException(rlvCmd.getObjectID(), RLV_BHVR_PERMISSIVE, eBhvr);
gRlvHandler.m_Behaviours[eBhvr]++;
rlvCmd.markRefCounted();
}
else
{
@ -1369,10 +1381,19 @@ ERlvCmdRet RlvBehaviourGenericHandler<RLV_OPTION_MODIFIER>::onCommand(const RlvC
if ( (!rlvCmd.hasOption()) || (!pBhvrModifier) || (!pBhvrModifier->convertOptionValue(rlvCmd.getOption(), modValue)) )
return RLV_RET_FAILED_OPTION;
// HACK-RLVa: reference counting doesn't happen until control returns to our caller but the modifier callbacks will happen now so we need to adjust the reference counts here
if (RLV_TYPE_ADD == rlvCmd.getParamType())
{
gRlvHandler.m_Behaviours[rlvCmd.getBehaviourType()]++;
pBhvrModifier->addValue(modValue, rlvCmd.getObjectID());
gRlvHandler.m_Behaviours[rlvCmd.getBehaviourType()]--;
}
else
{
gRlvHandler.m_Behaviours[rlvCmd.getBehaviourType()]--;
pBhvrModifier->removeValue(modValue, rlvCmd.getObjectID());
gRlvHandler.m_Behaviours[rlvCmd.getBehaviourType()]++;
}
fRefCount = true;
return RLV_RET_SUCCESS;
@ -1389,10 +1410,19 @@ ERlvCmdRet RlvBehaviourGenericHandler<RLV_OPTION_NONE_OR_MODIFIER>::onCommand(co
RlvBehaviourModifier* pBhvrModifier = RlvBehaviourDictionary::instance().getModifierFromBehaviour(rlvCmd.getBehaviourType());
if ( (pBhvrModifier) && (pBhvrModifier->getAddDefault()) )
{
// HACK-RLVa: reference counting doesn't happen until control returns to our caller but the modifier callbacks will happen now so we need to adjust the reference counts here
if (RLV_TYPE_ADD == rlvCmd.getParamType())
{
gRlvHandler.m_Behaviours[rlvCmd.getBehaviourType()]++;
pBhvrModifier->addValue(pBhvrModifier->getDefaultValue(), rlvCmd.getObjectID());
gRlvHandler.m_Behaviours[rlvCmd.getBehaviourType()]--;
}
else
{
gRlvHandler.m_Behaviours[rlvCmd.getBehaviourType()]--;
pBhvrModifier->removeValue(pBhvrModifier->getDefaultValue(), rlvCmd.getObjectID());
gRlvHandler.m_Behaviours[rlvCmd.getBehaviourType()]++;
}
}
fRefCount = true;
@ -1569,9 +1599,9 @@ void RlvBehaviourToggleHandler<RLV_BHVR_EDIT>::onCommandToggle(ERlvBehaviour eBh
RlvUIEnabler::instance().removeGenericFloaterFilter("beacons");
}
// Handles: @sendchannel[:<channel>]=n|y
// Handles: @sendchannel[:<channel>]=n|y and @sendchannel_except[:<channel>]=n|y
template<> template<>
ERlvCmdRet RlvBehaviourHandler<RLV_BHVR_SENDCHANNEL>::onCommand(const RlvCommand& rlvCmd, bool& fRefCount)
ERlvCmdRet RlvBehaviourSendChannelHandler::onCommand(const RlvCommand& rlvCmd, bool& fRefCount)
{
// If there's an option then it should be a valid (= positive and non-zero) chat channel
if (rlvCmd.hasOption())
@ -1592,6 +1622,59 @@ ERlvCmdRet RlvBehaviourHandler<RLV_BHVR_SENDCHANNEL>::onCommand(const RlvCommand
return RLV_RET_SUCCESS;
}
// Handles: @recvim[:<uuid|range>]=n|y, @sendim[:<uuid|range>]=n|y and @startim[:<uuid|range>]=n|y
template<> template<>
ERlvCmdRet RlvBehaviourRecvSendStartIMHandler::onCommand(const RlvCommand& rlvCmd, bool& fRefCount)
{
ERlvCmdRet eRet = RlvBehaviourGenericHandler<RLV_OPTION_NONE_OR_EXCEPTION>::onCommand(rlvCmd, fRefCount);
if ( (RLV_RET_SUCCESS != eRet) && (rlvCmd.hasOption()) )
{
// Check for <dist_min>[;<dist_max>] option
std::vector<std::string> optionList; float nDistMin = F32_MAX, nDistMax = F32_MAX;
if ( (!RlvCommandOptionHelper::parseStringList(rlvCmd.getOption(), optionList)) || (optionList.size() > 2) ||
(!RlvCommandOptionHelper::parseOption(optionList[0], nDistMin)) || (nDistMin < 0) ||
( (optionList.size() >= 2) && (!RlvCommandOptionHelper::parseOption(optionList[1], nDistMax)) ) || (nDistMax < 0) )
{
return RLV_RET_FAILED_OPTION;
}
// Valid option(s) - figure out which modifier(s) to change
ERlvBehaviourModifier eModDistMin, eModDistMax;
switch (rlvCmd.getBehaviourType())
{
case RLV_BHVR_RECVIM:
eModDistMin = RLV_MODIFIER_RECVIMDISTMIN; eModDistMax = RLV_MODIFIER_RECVIMDISTMAX;
break;
case RLV_BHVR_SENDIM:
eModDistMin = RLV_MODIFIER_SENDIMDISTMIN; eModDistMax = RLV_MODIFIER_SENDIMDISTMAX;
break;
case RLV_BHVR_STARTIM:
eModDistMin = RLV_MODIFIER_STARTIMDISTMIN; eModDistMax = RLV_MODIFIER_STARTIMDISTMAX;
break;
default:
return RLV_RET_FAILED_OPTION;
}
RlvBehaviourModifier *pBhvrModDistMin = RlvBehaviourDictionary::instance().getModifier(eModDistMin), *pBhvrModDistMax = RlvBehaviourDictionary::instance().getModifier(eModDistMax);
if (RLV_TYPE_ADD == rlvCmd.getParamType())
{
pBhvrModDistMin->addValue(nDistMin * nDistMin, rlvCmd.getObjectID());
if (optionList.size() >= 2)
pBhvrModDistMax->addValue(nDistMax * nDistMax, rlvCmd.getObjectID());
}
else
{
pBhvrModDistMin->removeValue(nDistMin * nDistMin, rlvCmd.getObjectID());
if (optionList.size() >= 2)
pBhvrModDistMax->removeValue(nDistMax * nDistMax, rlvCmd.getObjectID());
}
fRefCount = true;
return RLV_RET_SUCCESS;
}
return eRet;
}
// Handles: @sendim=n|y toggles
template<> template<>
void RlvBehaviourToggleHandler<RLV_BHVR_SENDIM>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
@ -1599,7 +1682,153 @@ void RlvBehaviourToggleHandler<RLV_BHVR_SENDIM>::onCommandToggle(ERlvBehaviour e
gSavedPerAccountSettings.getControl("DoNotDisturbModeResponse")->setHiddenFromSettingsEditor(fHasBhvr);
}
// Handles: @edit=n|y toggles
// Handles: @setcam_avdistmin:<distance>=n|y changes
template<>
void RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_AVDISTMIN>::onValueChange() const
{
if ( (gAgentCamera.cameraMouselook()) && (!RlvActions::canChangeToMouselook()) )
gAgentCamera.changeCameraToThirdPerson();
}
// Handles: @setcam_eyeoffset:<vector3>=n|y and @setcam_focusoffset:<vector3>=n|y toggles
template<> template<>
void RlvBehaviourCamEyeFocusOffsetHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
{
if (fHasBhvr)
{
gAgentCamera.switchCameraPreset(CAMERA_RLV_SETCAM_VIEW);
}
else
{
const RlvBehaviourModifier* pBhvrEyeModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_EYEOFFSET);
const RlvBehaviourModifier* pBhvrOffsetModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_FOCUSOFFSET);
if ( (!pBhvrEyeModifier->hasValue()) && (!pBhvrOffsetModifier->hasValue()) )
gAgentCamera.switchCameraPreset(CAMERA_PRESET_REAR_VIEW);
}
}
// Handles: @setcam_eyeoffset:<vector3>=n|y changes
template<>
void RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_EYEOFFSET>::onValueChange() const
{
if (RlvBehaviourModifier* pBhvrModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_EYEOFFSET))
{
LLControlVariable* pControl = gSavedSettings.getControl("CameraOffsetRLVaView");
if (pBhvrModifier->hasValue())
pControl->setValue(pBhvrModifier->getValue<LLVector3>().getValue());
else
pControl->resetToDefault();
}
}
// Handles: @setcam_focusoffset:<vector3>=n|y changes
template<>
void RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_FOCUSOFFSET>::onValueChange() const
{
if (RlvBehaviourModifier* pBhvrModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_FOCUSOFFSET))
{
LLControlVariable* pControl = gSavedSettings.getControl("FocusOffsetRLVaView");
if (pBhvrModifier->hasValue())
pControl->setValue(pBhvrModifier->getValue<LLVector3>().getValue());
else
pControl->resetToDefault();
}
}
// Handles: @setcam_fovmin:<angle>=n|y changes
template<>
void RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_FOVMIN>::onValueChange() const
{
LLViewerCamera::instance().setDefaultFOV(LLViewerCamera::instance().getDefaultFOV());
}
// Handles: @setcam_fovmax:<angle>=n|y changes
template<>
void RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_FOVMAX>::onValueChange() const
{
LLViewerCamera::instance().setDefaultFOV(LLViewerCamera::instance().getDefaultFOV());
}
// Handles: @setcam_mouselook=n|y toggles
template<> template<>
void RlvBehaviourToggleHandler<RLV_BHVR_SETCAM_MOUSELOOK>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
{
if ((fHasBhvr) && (gAgentCamera.cameraMouselook()))
gAgentCamera.changeCameraToThirdPerson();
}
// Handles: @setcam_textures[:<uuid>=n|y changes
template<>
void RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_TEXTURE>::onValueChange() const
{
if (RlvBehaviourModifier* pBhvrModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_TEXTURE))
{
if (pBhvrModifier->hasValue())
{
RLV_INFOS << "Toggling diffuse textures for @setcam_textures" << RLV_ENDL;
LLViewerFetchedTexture::sDefaultDiffuseImagep = LLViewerTextureManager::getFetchedTexture(pBhvrModifier->getValue<LLUUID>(), FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
gObjectList.setAllObjectDefaultTextures(LLRender::DIFFUSE_MAP, true);
}
else
{
RLV_INFOS << "Restoring diffuse textures for @setcam_textures" << RLV_ENDL;
gObjectList.setAllObjectDefaultTextures(LLRender::DIFFUSE_MAP, false);
LLViewerFetchedTexture::sDefaultDiffuseImagep = nullptr;
}
}
}
// Handles: @setcam_unlock=n|y toggles
template<> template<>
void RlvBehaviourToggleHandler<RLV_BHVR_SETCAM_UNLOCK>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
{
if (fHasBhvr)
handle_reset_view();
}
// Handles: @setcam=n|y toggles
template<> template<>
void RlvBehaviourToggleHandler<RLV_BHVR_SETCAM>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
{
// Once an object has exclusive control over the camera only its behaviours should be active. This affects:
// - behaviour modifiers => it's all handled for us once we set the primary object
// - RLV_BHVR_SETCAM_UNLOCK => manually (re)set the reference count (and possibly invoke the toggle handler)
LLUUID idRlvObject; bool fHasCamUnlock = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_UNLOCK);
if (fHasBhvr)
{
// Get the UUID of the primary object
std::list<const RlvObject*> lObjects;
gRlvHandler.findBehaviour(RLV_BHVR_SETCAM, lObjects);
idRlvObject = lObjects.front()->getObjectID();
// Reset the @setcam_unlock reference count
gRlvHandler.m_Behaviours[RLV_BHVR_SETCAM_UNLOCK] = (lObjects.front()->hasBehaviour(RLV_BHVR_SETCAM_UNLOCK, false)) ? 1 : 0;
}
else
{
std::list<const RlvObject*> lObjects;
// Restore the @setcam_unlock reference count
gRlvHandler.findBehaviour(RLV_BHVR_SETCAM_UNLOCK, lObjects);
gRlvHandler.m_Behaviours[RLV_BHVR_SETCAM_UNLOCK] = lObjects.size();
}
// Manually invoke the @setcam_unlock toggle handler if we toggled it on/off
if (fHasCamUnlock != gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_UNLOCK))
RlvBehaviourToggleHandler<RLV_BHVR_SETCAM_UNLOCK>::onCommandToggle(RLV_BHVR_SETCAM_UNLOCK, !fHasCamUnlock);
gAgentCamera.switchCameraPreset( (fHasBhvr) ? CAMERA_RLV_SETCAM_VIEW : CAMERA_PRESET_REAR_VIEW );
RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_AVDISTMIN)->setPrimaryObject(idRlvObject);
RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_AVDISTMAX)->setPrimaryObject(idRlvObject);
RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_ORIGINDISTMIN)->setPrimaryObject(idRlvObject);
RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_ORIGINDISTMAX)->setPrimaryObject(idRlvObject);
RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_EYEOFFSET)->setPrimaryObject(idRlvObject);
RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_FOCUSOFFSET)->setPrimaryObject(idRlvObject);
RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_FOVMIN)->setPrimaryObject(idRlvObject);
RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_FOVMAX)->setPrimaryObject(idRlvObject);
RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_TEXTURE)->setPrimaryObject(idRlvObject);
}
// Handles: @setdebug=n|y toggles
template<> template<>
void RlvBehaviourToggleHandler<RLV_BHVR_SETDEBUG>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
{
@ -1718,6 +1947,100 @@ void RlvBehaviourToggleHandler<RLV_BHVR_SHOWINV>::onCommandToggle(ERlvBehaviour
RlvUIEnabler::instance().removeGenericFloaterFilter("inventory");
}
// Handles: @shownames[:<uuid>]=n|y toggles
template<> template<>
void RlvBehaviourToggleHandler<RLV_BHVR_SHOWNAMES>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
{
if (LLApp::isQuitting())
return; // Nothing to do if the viewer is shutting down
// Update the shownames context
RlvActions::setShowName(RlvActions::SNC_DEFAULT, !fHasBhvr);
// Refresh the nearby people list
LLPanelPeople* pPeoplePanel = LLFloaterSidePanelContainer::getPanel<LLPanelPeople>("people", "panel_people");
RLV_ASSERT( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) );
if ( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) )
{
if (pPeoplePanel->getNearbyList()->isInVisibleChain())
pPeoplePanel->onCommit();
pPeoplePanel->getNearbyList()->updateAvatarNames();
}
// Force the use of the "display name" cache so we can filter both display and legacy names (or return back to the user's preference)
if (fHasBhvr)
{
LLAvatarNameCache::setForceDisplayNames(true);
}
else
{
LLAvatarNameCache::setForceDisplayNames(false);
LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames"));
}
// Refresh all name tags and HUD text
LLVOAvatar::invalidateNameTags();
LLHUDText::refreshAllObjectText();
}
// Handles: @shownames[:<uuid>]=n|y
template<> template<>
ERlvCmdRet RlvBehaviourHandler<RLV_BHVR_SHOWNAMES>::onCommand(const RlvCommand& rlvCmd, bool& fRefCount)
{
ERlvCmdRet eRet = RlvBehaviourGenericHandler<RLV_OPTION_NONE_OR_EXCEPTION>::onCommand(rlvCmd, fRefCount);
if ( (RLV_RET_SUCCESS == eRet) && (rlvCmd.hasOption()) && (!LLApp::isQuitting()) )
{
const LLUUID idAgent = RlvCommandOptionHelper::parseOption<LLUUID>(rlvCmd.getOption());
// Refresh the nearby people list (if necessary)
LLPanelPeople* pPeoplePanel = LLFloaterSidePanelContainer::getPanel<LLPanelPeople>("people", "panel_people");
RLV_ASSERT( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) );
if ( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) && (pPeoplePanel->getNearbyList()->contains(idAgent)) )
{
if (pPeoplePanel->getNearbyList()->isInVisibleChain())
pPeoplePanel->onCommit();
pPeoplePanel->getNearbyList()->updateAvatarNames();
}
// Refresh that avatar's name tag and all HUD text
LLVOAvatar::invalidateNameTag(idAgent);
LLHUDText::refreshAllObjectText();
}
return eRet;
}
// Handles: @shownametags[:<uuid>]=n|y toggles
template<> template<>
void RlvBehaviourToggleHandler<RLV_BHVR_SHOWNAMETAGS>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
{
if (LLApp::isQuitting())
return; // Nothing to do if the viewer is shutting down
// Update the shownames context
RlvActions::setShowName(RlvActions::SNC_NAMETAG, !fHasBhvr);
// Refresh all name tags
LLVOAvatar::invalidateNameTags();
}
// Handles: @shownametags[:<uuid>]=n|y
template<> template<>
ERlvCmdRet RlvBehaviourHandler<RLV_BHVR_SHOWNAMETAGS>::onCommand(const RlvCommand& rlvCmd, bool& fRefCount)
{
ERlvCmdRet eRet = RlvBehaviourGenericHandler<RLV_OPTION_NONE_OR_EXCEPTION>::onCommand(rlvCmd, fRefCount);
if ( (RLV_RET_SUCCESS == eRet) && (rlvCmd.hasOption()) )
LLVOAvatar::invalidateNameTag(RlvCommandOptionHelper::parseOption<LLUUID>(rlvCmd.getOption()));
return eRet;
}
// Handles: @showself=n|y and @showselfhead=n|y toggles
template<> template<>
void RlvBehaviourShowSelfToggleHandler::onCommandToggle(ERlvBehaviour eBvhr, bool fHasBhvr)
{
if (isAgentAvatarValid())
gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode());
}
// ============================================================================
// Command handlers (RLV_TYPE_FORCE)
//
@ -1877,6 +2200,140 @@ ERlvCmdRet RlvForceHandler<RLV_BHVR_REMOUTFIT>::onCommand(const RlvCommand& rlvC
return RLV_RET_SUCCESS;
}
// Handles: @setcam_eyeoffset[:<vector3>]=force and @setcam_focusoffset[:<vector3>]=force
template<> template<>
ERlvCmdRet RlvForceCamEyeFocusOffsetHandler::onCommand(const RlvCommand& rlvCmd)
{
// Enforce exclusive camera locks
if (!RlvActions::canChangeCameraPreset(rlvCmd.getObjectID()))
return RLV_RET_FAILED_LOCK;
LLControlVariable* pOffsetControl = gSavedSettings.getControl("CameraOffsetRLVaView");
LLControlVariable* pFocusControl = gSavedSettings.getControl("FocusOffsetRLVaView");
LLControlVariable* pControl = (rlvCmd.getBehaviourType() == RLV_BHVR_SETCAM_EYEOFFSET) ? pOffsetControl : pFocusControl;
if (rlvCmd.hasOption())
{
LLVector3 vecOffset;
if (!RlvCommandOptionHelper::parseOption(rlvCmd.getOption(), vecOffset))
return RLV_RET_FAILED_OPTION;
pControl->setValue(vecOffset.getValue());
}
else
{
pControl->resetToDefault();
}
gAgentCamera.switchCameraPreset( ((pOffsetControl->isDefault()) && (pFocusControl->isDefault())) ? CAMERA_PRESET_REAR_VIEW : CAMERA_RLV_SETCAM_VIEW);
return RLV_RET_SUCCESS;
}
// Handles: @setcam_focus:<uuid>[;<dist>[;<direction>]]=force
template<> template<>
ERlvCmdRet RlvForceHandler<RLV_BHVR_SETCAM_FOCUS>::onCommand(const RlvCommand& rlvCmd)
{
std::vector<std::string> optionList;
if (!RlvCommandOptionHelper::parseStringList(rlvCmd.getOption(), optionList))
return RLV_RET_FAILED_OPTION;
LLVector3 posAgent;
LLVector3d posGlobal;
F32 camDistance;
// Get the focus position/object (and verify it is known)
LLUUID idObject; LLVector3 posRegion;
if (RlvCommandOptionHelper::parseOption(optionList[0], idObject))
{
const LLViewerObject* pObj = gObjectList.findObject(idObject);
if (!pObj)
return RLV_RET_FAILED_OPTION;
if (!pObj->isAvatar())
{
posAgent = pObj->getPositionAgent();
posGlobal = pObj->getPositionGlobal();
}
else
{
/*const*/ LLVOAvatar* pAvatar = (/*const*/ LLVOAvatar*)pObj;
if (pAvatar->mHeadp)
{
posAgent = pAvatar->mHeadp->getWorldPosition();
posGlobal = pAvatar->getPosGlobalFromAgent(posAgent);
}
}
camDistance = pObj->getScale().magVec();
}
else if (RlvCommandOptionHelper::parseOption(optionList[0], posRegion))
{
const LLViewerRegion* pRegion = gAgent.getRegion();
if (!pRegion)
return RLV_RET_FAILED_UNKNOWN;
posAgent = pRegion->getPosAgentFromRegion(posRegion);
posGlobal = pRegion->getPosGlobalFromRegion(posRegion);
camDistance = 0.0f;
}
else
{
return RLV_RET_FAILED_OPTION;
}
// Get the camera distance
if ( (optionList.size() > 1) && (!optionList[1].empty()) )
{
if (!RlvCommandOptionHelper::parseOption(optionList[1], camDistance))
return RLV_RET_FAILED_OPTION;
}
// Get the directional vector (or calculate it from the current camera position)
LLVector3 camDirection;
if ( (optionList.size() > 2) && (!optionList[2].empty()) )
{
if (!RlvCommandOptionHelper::parseOption(optionList[2], camDirection))
return RLV_RET_FAILED_OPTION;
}
else
{
camDirection = LLViewerCamera::getInstance()->getOrigin() - posAgent;
}
camDirection.normVec();
// Move the camera in place
gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
gAgentCamera.setCameraPosAndFocusGlobal(posGlobal + LLVector3d(camDirection * llmax(F_APPROXIMATELY_ZERO, camDistance)), posGlobal, idObject);
return RLV_RET_SUCCESS;
}
// Handles: @setcam_fov[:<angle>]=force
template<> template<>
ERlvCmdRet RlvForceHandler<RLV_BHVR_SETCAM_FOV>::onCommand(const RlvCommand& rlvCmd)
{
if (!RlvActions::canChangeCameraFOV(rlvCmd.getObjectID()))
return RLV_RET_FAILED_LOCK;
F32 nFOV = DEFAULT_FIELD_OF_VIEW;
if ( (rlvCmd.hasOption()) && (!RlvCommandOptionHelper::parseOption(rlvCmd.getOption(), nFOV)) )
return RLV_RET_FAILED_OPTION;
LLViewerCamera::getInstance()->setDefaultFOV(nFOV);
return RLV_RET_SUCCESS;
}
// Handles: @setcam_mode[:<option>]=force
template<> template<>
ERlvCmdRet RlvForceHandler<RLV_BHVR_SETCAM_MODE>::onCommand(const RlvCommand& rlvCmd)
{
const std::string& strOption = rlvCmd.getOption();
if ("mouselook" == strOption)
gAgentCamera.changeCameraToMouselook();
else if ("thirdperson" == strOption)
gAgentCamera.changeCameraToThirdPerson();
else if ( ("reset" == strOption) || (strOption.empty()) )
handle_reset_view();
else
return RLV_RET_FAILED_OPTION;
return RLV_RET_SUCCESS;
}
// Checked: 2010-08-30 (RLVa-1.2.1c) | Modified: RLVa-1.2.1c
ERlvCmdRet RlvHandler::onForceWear(const LLViewerInventoryCategory* pFolder, U32 nFlags) const
{
@ -1946,7 +2403,7 @@ ERlvCmdRet RlvForceHandler<RLV_BHVR_SIT>::onCommand(const RlvCommand& rlvCmd)
if ( (idTarget.isNull()) || ((pObj = gObjectList.findObject(idTarget)) == NULL) || (LL_PCODE_VOLUME != pObj->getPCode()) )
return RLV_RET_FAILED_OPTION;
if (!gRlvHandler.canSit(pObj))
if (!RlvActions::canSit(pObj))
return RLV_RET_FAILED_LOCK;
else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_STANDTP)) && (isAgentAvatarValid()) )
{
@ -1968,35 +2425,49 @@ ERlvCmdRet RlvForceHandler<RLV_BHVR_SIT>::onCommand(const RlvCommand& rlvCmd)
return RLV_RET_SUCCESS;
}
// Handles: @tpto:<vector>[;<angle>]=force
// Handles: @tpto:<vector>[;<angle>]=force and @tpto:<region>/<vector>[;<angle>]=force
template<> template<>
ERlvCmdRet RlvForceHandler<RLV_BHVR_TPTO>::onCommand(const RlvCommand& rlvCmd)
{
std::vector<std::string> optionList;
if (!RlvCommandOptionHelper::parseStringList(rlvCmd.getOption(), optionList))
return RLV_RET_FAILED;
// First option specifies the destination
LLVector3d posGlobal;
if (!RlvCommandOptionHelper::parseOption(optionList[0], posGlobal))
return RLV_RET_FAILED_OPTION;
if (optionList.size() == 1)
// We need the look-at first
LLVector3 vecLookAt = LLVector3::zero;
if (optionList.size() > 1)
{
gAgent.teleportViaLocation(posGlobal);
}
else
{
// Second option specifies the angle
float nAngle = 0.0f;
if (!RlvCommandOptionHelper::parseOption(optionList[1], nAngle))
return RLV_RET_FAILED_OPTION;
LLVector3 vecLookAt(LLVector3::x_axis);
vecLookAt = LLVector3::x_axis;
vecLookAt.rotVec(nAngle, LLVector3::z_axis);
vecLookAt.normalize();
}
// Next figure out the destination
LLVector3d posGlobal;
if (RlvCommandOptionHelper::parseOption(optionList[0], posGlobal))
{
if (optionList.size() == 1)
gAgent.teleportViaLocation(posGlobal);
else
gAgent.teleportViaLocationLookAt(posGlobal, vecLookAt);
}
else
{
std::vector<std::string> posList; LLVector3 posRegion;
if ( (!RlvCommandOptionHelper::parseStringList(optionList[0], posList, std::string("/"))) || (4 != posList.size()) ||
(!RlvCommandOptionHelper::parseOption(optionList[0].substr(posList[0].size() + 1), posRegion)) )
{
return RLV_RET_FAILED_OPTION;
}
LLWorldMapMessage::url_callback_t cb = boost::bind(&RlvUtil::teleportCallback, _1, posRegion, vecLookAt);
LLWorldMapMessage::getInstance()->sendNamedRegionRequest(posList[0], cb, std::string(""), true);
}
return RLV_RET_SUCCESS;
}
@ -2268,6 +2739,77 @@ ERlvCmdRet RlvHandler::onGetAttachNames(const RlvCommand& rlvCmd, std::string& s
return RLV_RET_SUCCESS;
}
// Handles: @getcam_avdist=<channel>
template<> template<>
ERlvCmdRet RlvReplyHandler<RLV_BHVR_GETCAM_AVDIST>::onCommand(const RlvCommand& rlvCmd, std::string& strReply)
{
if (rlvCmd.hasOption())
return RLV_RET_FAILED_OPTION;
strReply = llformat("%.3lf", (gAgentCamera.getCameraPositionGlobal() - gAgent.getPositionGlobal()).magVec());
return RLV_RET_SUCCESS;
}
// Handles: @getcam_avdistmin=<channel>, @getcam_avdistmax=<channel>, @getcam_fovmin=<channel> and @getcam_fovmax=<channel>
template<> template<>
ERlvCmdRet RlvReplyCamMinMaxModifierHandler::onCommand(const RlvCommand& rlvCmd, std::string& strReply)
{
if ( (rlvCmd.hasOption()) || (!boost::starts_with(rlvCmd.getBehaviour(), "getcam_")) )
return RLV_RET_FAILED_OPTION;
ERlvBehaviour eBhvr = RlvBehaviourDictionary::instance().getBehaviourFromString("setcam_" + rlvCmd.getBehaviour().substr(7), RLV_TYPE_ADDREM);
if (RlvBehaviourModifier* pBhvrModifier = RlvBehaviourDictionary::instance().getModifierFromBehaviour(eBhvr))
strReply = (pBhvrModifier->hasValue()) ? llformat("%.3f", pBhvrModifier->getValue<float>()) : LLStringUtil::null;
return RLV_RET_SUCCESS;
}
// Handles: @camzoommin/max[:<multiplier>]=n|y - DEPRECATED
template<> template<>
ERlvCmdRet RlvBehaviourCamZoomMinMaxHandler::onCommand(const RlvCommand& rlvCmd, bool& fRefCount)
{
// NOTE: @camzoommin/max are implemented as semi-synonyms of @setcam_fovmin/max
F32 nMult = 1.0f;
if ( (rlvCmd.hasOption()) && (!RlvCommandOptionHelper::parseOption(rlvCmd.getOption(), nMult)) )
return RLV_RET_FAILED_OPTION;
RlvBehaviourModifier* pBhvrModifier = RlvBehaviourDictionary::instance().getModifier( (RLV_BHVR_CAMZOOMMIN == rlvCmd.getBehaviourType()) ? RLV_MODIFIER_SETCAM_FOVMIN : RLV_MODIFIER_SETCAM_FOVMAX);
if (pBhvrModifier)
{
if (RLV_TYPE_ADD == rlvCmd.getParamType())
{
gRlvHandler.m_Behaviours[(RLV_BHVR_CAMZOOMMIN == rlvCmd.getBehaviourType()) ? RLV_BHVR_SETCAM_FOVMIN : RLV_BHVR_SETCAM_FOVMAX]++;
pBhvrModifier->addValue(DEFAULT_FIELD_OF_VIEW / nMult, rlvCmd.getObjectID());
}
else
{
gRlvHandler.m_Behaviours[(RLV_BHVR_CAMZOOMMIN == rlvCmd.getBehaviourType()) ? RLV_BHVR_SETCAM_FOVMIN : RLV_BHVR_SETCAM_FOVMAX]--;
pBhvrModifier->removeValue(DEFAULT_FIELD_OF_VIEW / nMult, rlvCmd.getObjectID());
}
}
fRefCount = true;
return RLV_RET_SUCCESS;
}
// Handles: @getcam_fov=<channel>
template<> template<>
ERlvCmdRet RlvReplyHandler<RLV_BHVR_GETCAM_FOV>::onCommand(const RlvCommand& rlvCmd, std::string& strReply)
{
if (rlvCmd.hasOption())
return RLV_RET_FAILED_OPTION;
strReply = llformat("%.3f", LLViewerCamera::getInstance()->getDefaultFOV());
return RLV_RET_SUCCESS;
}
// Handles: @getcam_textures=<channel>
template<> template<>
ERlvCmdRet RlvReplyHandler<RLV_BHVR_GETCAM_TEXTURES>::onCommand(const RlvCommand& rlvCmd, std::string& strReply)
{
if (rlvCmd.hasOption())
return RLV_RET_FAILED_OPTION;
if (RlvBehaviourModifier* pBhvrModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_TEXTURE))
strReply = (pBhvrModifier->hasValue()) ? pBhvrModifier->getValue<LLUUID>().asString() : LLStringUtil::null;
return RLV_RET_SUCCESS;
}
// Handles: @getcommand[:<behaviour>[;<type>[;<separator>]]]=<channel>
template<> template<>
ERlvCmdRet RlvReplyHandler<RLV_BHVR_GETCOMMAND>::onCommand(const RlvCommand& rlvCmd, std::string& strReply)

View File

@ -44,9 +44,13 @@ public:
// - to check @remoutfit=n -> (see RlvWearableLocks)
// - to check exceptions -> isException()
public:
// Returns a list of all objects containing the specified behaviour
bool findBehaviour(ERlvBehaviour eBhvr, std::list<const RlvObject*>& lObjects) const;
// Returns TRUE is at least one object contains the specified behaviour (and optional option)
bool hasBehaviour(ERlvBehaviour eBhvr) const { return (eBhvr < RLV_BHVR_COUNT) ? (0 != m_Behaviours[eBhvr]) : false; }
bool hasBehaviour(ERlvBehaviour eBhvr, const std::string& strOption) const;
// Returns TRUE if the specified object contains the specified behaviour (and optional option)
bool hasBehaviour(const LLUUID& idObj, ERlvBehaviour eBhvr, const std::string& strOption = LLStringUtil::null) const;
// Returns TRUE if at least one object (except the specified one) contains the specified behaviour (and optional option)
bool hasBehaviourExcept(ERlvBehaviour eBhvr, const LLUUID& idObj) const;
bool hasBehaviourExcept(ERlvBehaviour eBhvr, const std::string& strOption, const LLUUID& idObj) const;
@ -94,9 +98,7 @@ public:
void setSitSource(const LLVector3d& posSource) { m_posSitSource = posSource; } // @standtp
// Command specific helper functions
bool canEdit(const LLViewerObject* pObj) const; // @edit and @editobj
bool canShowHoverText(const LLViewerObject* pObj) const; // @showhovertext* command family
bool canSit(LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero) const;
bool canTouch(const LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero) const; // @touch
bool filterChat(std::string& strUTF8Text, bool fFilterEmote) const; // @sendchat, @recvchat and @redirchat
bool redirectChatOrEmote(const std::string& strUTF8Test) const; // @redirchat and @rediremote
@ -207,6 +209,7 @@ protected:
friend class RlvSharedRootFetcher; // Fetcher needs access to m_fFetchComplete
friend class RlvGCTimer; // Timer clear its own point at destruction
template<ERlvBehaviourOptionType optionType> friend struct RlvBehaviourGenericHandler;
template<ERlvParamType> friend struct RlvCommandHandlerBaseImpl;
template<ERlvParamType, ERlvBehaviour> friend struct RlvCommandHandler;
@ -227,18 +230,6 @@ extern rlv_handler_t gRlvHandler;
// Inlined member functions
//
// Checked: 2010-11-29 (RLVa-1.3.0c) | Added: RLVa-1.3.0c
inline bool RlvHandler::canEdit(const LLViewerObject* pObj) const
{
// The specified object can be edited if:
// - not generally restricted from editing (or the object's root is an exception)
// - not specifically restricted from editing this object's root
return
(pObj) &&
((!hasBehaviour(RLV_BHVR_EDIT)) || (isException(RLV_BHVR_EDIT, pObj->getRootEdit()->getID()))) &&
((!hasBehaviour(RLV_BHVR_EDITOBJ)) || (!isException(RLV_BHVR_EDITOBJ, pObj->getRootEdit()->getID())));
}
// Checked: 2010-03-27 (RLVa-1.4.0a) | Modified: RLVa-1.0.0f
inline bool RlvHandler::canShowHoverText(const LLViewerObject *pObj) const
{

View File

@ -1,17 +1,17 @@
/**
/**
*
* Copyright (c) 2009-2016, Kitty Barnett
*
* The source code in this file is provided to you under the terms of the
*
* The source code in this file is provided to you under the terms of the
* GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt
* in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt
*
*
* By copying, modifying or distributing this software, you acknowledge that
* you have read and understood your obligations described above, and agree to
* you have read and understood your obligations described above, and agree to
* abide by those obligations.
*
*
*/
#include "llviewerprecompiledheaders.h"
@ -32,9 +32,6 @@
// RlvBehaviourDictionary
//
static RlvBehaviourModifier_CompMin s_RlvBehaviourModifier_CompMin;
static RlvBehaviourModifier_CompMax s_RlvBehaviourModifier_CompMax;
/*
* Processing of RLVa commands used to be a big switch/case loop with one function for each command type(addrem, reply
* and force). This is slowly being replaced with templated command handling which might be more confusing intially
@ -62,7 +59,7 @@ static RlvBehaviourModifier_CompMax s_RlvBehaviourModifier_CompMax;
* Definition: RlvBehaviourGenericProcessor<RLV_OPTION_TYPE>("commandname", RLV_BHVR_COMMANDNAME)
* Implement : nothing! (it automagically works)
* For simple behaviours that only require recordkeeping and only run code when they toggle:
* Definition: RlvBehaviourToggleProcessor<RLV_BHVR_COMMANDNAME, RLV_OPTION_TYPE>("commandname"))
* Definition: RlvBehaviourGenericToggleProcessor<RLV_BHVR_COMMANDNAME, RLV_OPTION_TYPE>("commandname"))
* Implement : void RlvBehaviourToggleHandler<RLV_BHVR_COMMANDNAME>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
* For behaviours that require manual processing:
* Definition: RlvBehaviourProcessor<RLV_BHVR_COMMANDNAME>("commandname"))
@ -99,10 +96,11 @@ RlvBehaviourDictionary::RlvBehaviourDictionary()
addEntry(new RlvBehaviourInfo("detachallthis", RLV_BHVR_DETACHTHIS, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE));
addEntry(new RlvBehaviourInfo("detachthis_except", RLV_BHVR_DETACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_NODE));
addEntry(new RlvBehaviourInfo("detachallthis_except", RLV_BHVR_DETACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE));
addEntry(new RlvBehaviourToggleProcessor<RLV_BHVR_EDIT, RLV_OPTION_NONE_OR_EXCEPTION>("edit"));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_EDIT, RLV_OPTION_NONE_OR_EXCEPTION>("edit"));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("editobj", RLV_BHVR_EDITOBJ));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("emote", RLV_BHVR_EMOTE));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("fartouch", RLV_BHVR_FARTOUCH));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("fartouch", RLV_BHVR_FARTOUCH));
addModifier(RLV_BHVR_FARTOUCH, RLV_MODIFIER_FARTOUCHDIST, new RlvBehaviourModifier("Fartouch Distance", RLV_MODIFIER_FARTOUCH_DEFAULT, true, new RlvBehaviourModifier_CompMin));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("fly", RLV_BHVR_FLY));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("interact", RLV_BHVR_INTERACT, RlvBehaviourInfo::BHVR_EXTENDED));
addEntry(new RlvBehaviourInfo("notify", RLV_BHVR_NOTIFY, RLV_TYPE_ADDREM));
@ -111,19 +109,25 @@ RlvBehaviourDictionary::RlvBehaviourDictionary()
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("recvchatfrom", RLV_BHVR_RECVCHATFROM, RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("recvemote", RLV_BHVR_RECVEMOTE, RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("recvemotefrom", RLV_BHVR_RECVEMOTEFROM, RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("recvim", RLV_BHVR_RECVIM, RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourProcessor<RLV_BHVR_RECVIM, RlvBehaviourRecvSendStartIMHandler>("recvim", RlvBehaviourInfo::BHVR_STRICT));
addModifier(RLV_BHVR_RECVIM, RLV_MODIFIER_RECVIMDISTMIN, new RlvBehaviourModifier("RecvIM Distance (Min)", F32_MAX, true, new RlvBehaviourModifier_CompMax));
addModifier(RLV_BHVR_RECVIM, RLV_MODIFIER_RECVIMDISTMAX, new RlvBehaviourModifier("RecvIM Distance (Max)", F32_MAX, true, new RlvBehaviourModifier_CompMin));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("recvimfrom", RLV_BHVR_RECVIMFROM, RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourInfo("redirchat", RLV_BHVR_REDIRCHAT, RLV_TYPE_ADDREM));
addEntry(new RlvBehaviourInfo("rediremote", RLV_BHVR_REDIREMOTE, RLV_TYPE_ADDREM));
addEntry(new RlvBehaviourProcessor<RLV_BHVR_REMATTACH, RlvBehaviourAddRemAttachHandler>("remattach"));
addEntry(new RlvBehaviourInfo("remoutfit", RLV_BHVR_REMOUTFIT, RLV_TYPE_ADDREM));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("rez", RLV_BHVR_REZ));
addEntry(new RlvBehaviourProcessor<RLV_BHVR_SENDCHANNEL>("sendchannel", RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourProcessor<RLV_BHVR_SENDCHANNEL, RlvBehaviourSendChannelHandler>("sendchannel", RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourProcessor<RLV_BHVR_SENDCHANNELEXCEPT, RlvBehaviourSendChannelHandler>("sendchannel_except", RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("sendchat", RLV_BHVR_SENDCHAT));
addEntry(new RlvBehaviourToggleProcessor<RLV_BHVR_SENDIM, RLV_OPTION_NONE_OR_EXCEPTION>("sendim", RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourToggleProcessor<RLV_BHVR_SENDIM, RlvBehaviourRecvSendStartIMHandler>("sendim", RlvBehaviourInfo::BHVR_STRICT));
addModifier(RLV_BHVR_SENDIM, RLV_MODIFIER_SENDIMDISTMIN, new RlvBehaviourModifier("SendIM Distance (Min)", F32_MAX, true, new RlvBehaviourModifier_CompMax));
addModifier(RLV_BHVR_SENDIM, RLV_MODIFIER_SENDIMDISTMAX, new RlvBehaviourModifier("SendIM Distance (Max)", F32_MAX, true, new RlvBehaviourModifier_CompMin));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("sendimto", RLV_BHVR_SENDIMTO, RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourToggleProcessor<RLV_BHVR_SETDEBUG, RLV_OPTION_NONE>("setdebug"));
addEntry(new RlvBehaviourToggleProcessor<RLV_BHVR_SETENV, RLV_OPTION_NONE>("setenv"));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("sendgesture", RLV_BHVR_SENDGESTURE, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SETDEBUG, RLV_OPTION_NONE>("setdebug"));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SETENV, RLV_OPTION_NONE>("setenv"));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("setgroup", RLV_BHVR_SETGROUP));
addEntry(new RlvBehaviourInfo("sharedunwear", RLV_BHVR_SHAREDUNWEAR, RLV_TYPE_ADDREM, RlvBehaviourInfo::BHVR_EXTENDED));
addEntry(new RlvBehaviourInfo("sharedwear", RLV_BHVR_SHAREDWEAR, RLV_TYPE_ADDREM, RlvBehaviourInfo::BHVR_EXTENDED));
@ -131,29 +135,36 @@ RlvBehaviourDictionary::RlvBehaviourDictionary()
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("showhovertextall", RLV_BHVR_SHOWHOVERTEXTALL));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("showhovertexthud", RLV_BHVR_SHOWHOVERTEXTHUD));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("showhovertextworld", RLV_BHVR_SHOWHOVERTEXTWORLD));
addEntry(new RlvBehaviourToggleProcessor<RLV_BHVR_SHOWINV, RLV_OPTION_NONE>("showinv"));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SHOWINV, RLV_OPTION_NONE>("showinv"));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("showloc", RLV_BHVR_SHOWLOC));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("showminimap", RLV_BHVR_SHOWMINIMAP));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("shownames", RLV_BHVR_SHOWNAMES));
addEntry(new RlvBehaviourToggleProcessor<RLV_BHVR_SHOWNAMES>("shownames", RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourToggleProcessor<RLV_BHVR_SHOWNAMETAGS>("shownametags", RlvBehaviourInfo::BHVR_STRICT ));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SHOWSELF, RLV_OPTION_NONE, RlvBehaviourShowSelfToggleHandler>("showself", RlvBehaviourInfo::BHVR_EXTENDED));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SHOWSELFHEAD, RLV_OPTION_NONE, RlvBehaviourShowSelfToggleHandler>("showselfhead", RlvBehaviourInfo::BHVR_EXTENDED));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("showworldmap", RLV_BHVR_SHOWWORLDMAP));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("sit", RLV_BHVR_SIT));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("sittp", RLV_BHVR_SITTP));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("sittp", RLV_BHVR_SITTP));
addModifier(RLV_BHVR_SITTP, RLV_MODIFIER_SITTPDIST, new RlvBehaviourModifier("SitTp Distance", RLV_MODIFIER_SITTP_DEFAULT, true, new RlvBehaviourModifier_CompMin));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("standtp", RLV_BHVR_STANDTP));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("startim", RLV_BHVR_STARTIM, RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourProcessor<RLV_BHVR_STARTIM, RlvBehaviourRecvSendStartIMHandler>("startim", RlvBehaviourInfo::BHVR_STRICT));
addModifier(RLV_BHVR_STARTIM, RLV_MODIFIER_STARTIMDISTMIN, new RlvBehaviourModifier("StartIM Distance (Min)", F32_MAX, true, new RlvBehaviourModifier_CompMax));
addModifier(RLV_BHVR_STARTIM, RLV_MODIFIER_STARTIMDISTMAX, new RlvBehaviourModifier("StartIM Distance (Max)", F32_MAX, true, new RlvBehaviourModifier_CompMin));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("startimto", RLV_BHVR_STARTIMTO, RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("temprun", RLV_BHVR_TEMPRUN));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("touchall", RLV_BHVR_TOUCHALL));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("touchattach", RLV_BHVR_TOUCHATTACH));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("touchattachother", RLV_BHVR_TOUCHATTACHOTHER));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("touchattachself", RLV_BHVR_TOUCHATTACHSELF));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("touchfar", RLV_BHVR_FARTOUCH, RlvBehaviourInfo::BHVR_SYNONYM));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("touchfar", RLV_BHVR_FARTOUCH, RlvBehaviourInfo::BHVR_SYNONYM));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("touchhud", RLV_BHVR_TOUCHHUD, RlvBehaviourInfo::BHVR_EXTENDED));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("touchme", RLV_BHVR_TOUCHME));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("touchthis", RLV_BHVR_TOUCHTHIS));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("touchworld", RLV_BHVR_TOUCHWORLD));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("tplm", RLV_BHVR_TPLM));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("tploc", RLV_BHVR_TPLOC));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("tplocal", RLV_BHVR_TPLOCAL));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("tplocal", RLV_BHVR_TPLOCAL));
addModifier(RLV_BHVR_TPLOCAL, RLV_MODIFIER_TPLOCALDIST, new RlvBehaviourModifier("Local Teleport Distance", RLV_MODIFIER_TPLOCAL_DEFAULT, true, new RlvBehaviourModifier_CompMin));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("tplure", RLV_BHVR_TPLURE, RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("tprequest", RLV_BHVR_TPREQUEST, RlvBehaviourInfo::BHVR_STRICT | RlvBehaviourInfo::BHVR_EXTENDED));
addEntry(new RlvBehaviourInfo("unsharedunwear", RLV_BHVR_UNSHAREDUNWEAR, RLV_TYPE_ADDREM));
@ -162,6 +173,35 @@ RlvBehaviourDictionary::RlvBehaviourDictionary()
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("viewnote", RLV_BHVR_VIEWNOTE));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("viewscript", RLV_BHVR_VIEWSCRIPT));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("viewtexture", RLV_BHVR_VIEWTEXTURE));
// Camera
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SETCAM, RLV_OPTION_NONE>("setcam"));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_MODIFIER>("setcam_avdistmin", RLV_BHVR_SETCAM_AVDISTMIN));
addModifier(RLV_BHVR_SETCAM_AVDISTMIN, RLV_MODIFIER_SETCAM_AVDISTMIN, new RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_AVDISTMIN>("Camera - Avatar Distance (Min)", 0.0f, false, new RlvBehaviourModifier_CompMax()));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_MODIFIER>("setcam_avdistmax", RLV_BHVR_SETCAM_AVDISTMAX));
addModifier(RLV_BHVR_SETCAM_AVDISTMAX, RLV_MODIFIER_SETCAM_AVDISTMAX, new RlvBehaviourModifier("Camera - Avatar Distance (Max)", F32_MAX, false, new RlvBehaviourModifier_CompMin));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_MODIFIER>("setcam_origindistmin", RLV_BHVR_SETCAM_ORIGINDISTMIN));
addModifier(RLV_BHVR_SETCAM_ORIGINDISTMIN, RLV_MODIFIER_SETCAM_ORIGINDISTMIN, new RlvBehaviourModifier("Camera - Focus Distance (Min)", 0.0f, true, new RlvBehaviourModifier_CompMax));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_MODIFIER>("setcam_origindistmax", RLV_BHVR_SETCAM_ORIGINDISTMAX));
addModifier(RLV_BHVR_SETCAM_ORIGINDISTMAX, RLV_MODIFIER_SETCAM_ORIGINDISTMAX, new RlvBehaviourModifier("Camera - Focus Distance (Max)", F32_MAX, true, new RlvBehaviourModifier_CompMin));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SETCAM_EYEOFFSET, RLV_OPTION_MODIFIER, RlvBehaviourCamEyeFocusOffsetHandler>("setcam_eyeoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addModifier(RLV_BHVR_SETCAM_EYEOFFSET, RLV_MODIFIER_SETCAM_EYEOFFSET, new RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_EYEOFFSET>("Camera - Eye Offset", LLVector3::zero, true, nullptr));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SETCAM_FOCUSOFFSET, RLV_OPTION_MODIFIER, RlvBehaviourCamEyeFocusOffsetHandler>("setcam_focusoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addModifier(RLV_BHVR_SETCAM_FOCUSOFFSET, RLV_MODIFIER_SETCAM_FOCUSOFFSET, new RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_FOCUSOFFSET>("Camera - Focus Offset", LLVector3::zero, true, nullptr));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_MODIFIER>("setcam_fovmin", RLV_BHVR_SETCAM_FOVMIN));
addModifier(RLV_BHVR_SETCAM_FOVMIN, RLV_MODIFIER_SETCAM_FOVMIN, new RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_FOVMIN>("Camera - FOV (Min)", DEFAULT_FIELD_OF_VIEW, true, new RlvBehaviourModifier_CompMax));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_MODIFIER>("setcam_fovmax", RLV_BHVR_SETCAM_FOVMAX));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SETCAM_MOUSELOOK, RLV_OPTION_NONE>("setcam_mouselook"));
addModifier(RLV_BHVR_SETCAM_FOVMAX, RLV_MODIFIER_SETCAM_FOVMAX, new RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_FOVMAX>("Camera - FOV (Max)", DEFAULT_FIELD_OF_VIEW, true, new RlvBehaviourModifier_CompMin));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("setcam_textures", RLV_BHVR_SETCAM_TEXTURES));
addModifier(RLV_BHVR_SETCAM_TEXTURES, RLV_MODIFIER_SETCAM_TEXTURE, new RlvBehaviourModifierHandler<RLV_MODIFIER_SETCAM_TEXTURE>("Camera - Forced Texture", IMG_DEFAULT, true, nullptr));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SETCAM_UNLOCK, RLV_OPTION_NONE>("setcam_unlock"));
// Camera (compatibility shim - to be deprecated)
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_MODIFIER>("camdistmin", RLV_BHVR_SETCAM_AVDISTMIN, RlvBehaviourInfo::BHVR_SYNONYM | RlvBehaviourInfo::BHVR_DEPRECATED));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_MODIFIER>("camdistmax", RLV_BHVR_SETCAM_AVDISTMAX, RlvBehaviourInfo::BHVR_SYNONYM | RlvBehaviourInfo::BHVR_DEPRECATED));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("camtextures", RLV_BHVR_SETCAM_TEXTURES, RlvBehaviourInfo::BHVR_SYNONYM | RlvBehaviourInfo::BHVR_DEPRECATED));
addEntry(new RlvBehaviourProcessor<RLV_BHVR_CAMZOOMMIN, RlvBehaviourCamZoomMinMaxHandler>("camzoommin", RlvBehaviourInfo::BHVR_DEPRECATED));
addEntry(new RlvBehaviourProcessor<RLV_BHVR_CAMZOOMMAX, RlvBehaviourCamZoomMinMaxHandler>("camzoommax", RlvBehaviourInfo::BHVR_DEPRECATED));
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SETCAM_UNLOCK, RLV_OPTION_NONE>("camunlock", RlvBehaviourInfo::BHVR_SYNONYM | RlvBehaviourInfo::BHVR_DEPRECATED));
//
// Force-wear
@ -200,6 +240,11 @@ RlvBehaviourDictionary::RlvBehaviourDictionary()
//
addEntry(new RlvBehaviourInfo("adjustheight", RLV_BHVR_ADJUSTHEIGHT, RLV_TYPE_FORCE));
addEntry(new RlvForceProcessor<RLV_BHVR_DETACHME>("detachme"));
addEntry(new RlvForceProcessor<RLV_BHVR_SETCAM_FOCUS>("setcam_focus", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvForceProcessor<RLV_BHVR_SETCAM_EYEOFFSET, RlvForceCamEyeFocusOffsetHandler>("setcam_eyeoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvForceProcessor<RLV_BHVR_SETCAM_FOCUSOFFSET, RlvForceCamEyeFocusOffsetHandler>("setcam_focusoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvForceProcessor<RLV_BHVR_SETCAM_FOV>("setcam_fov", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvForceProcessor<RLV_BHVR_SETCAM_MODE>("setcam_mode", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvForceProcessor<RLV_BHVR_SETGROUP>("setgroup"));
addEntry(new RlvForceProcessor<RLV_BHVR_SIT>("sit"));
addEntry(new RlvForceProcessor<RLV_BHVR_TPTO>("tpto"));
@ -214,6 +259,13 @@ RlvBehaviourDictionary::RlvBehaviourDictionary()
addEntry(new RlvBehaviourInfo("getaddoutfitnames", RLV_BHVR_GETADDOUTFITNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvBehaviourInfo("getattach", RLV_BHVR_GETATTACH, RLV_TYPE_REPLY));
addEntry(new RlvBehaviourInfo("getattachnames", RLV_BHVR_GETATTACHNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvReplyProcessor<RLV_BHVR_GETCAM_AVDIST>("getcam_avdist", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvReplyProcessor<RLV_BHVR_GETCAM_AVDISTMIN, RlvReplyCamMinMaxModifierHandler>("getcam_avdistmin", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvReplyProcessor<RLV_BHVR_GETCAM_AVDISTMAX, RlvReplyCamMinMaxModifierHandler>("getcam_avdistmax", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvReplyProcessor<RLV_BHVR_GETCAM_FOV>("getcam_fov", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvReplyProcessor<RLV_BHVR_GETCAM_FOVMIN, RlvReplyCamMinMaxModifierHandler>("getcam_fovmin", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvReplyProcessor<RLV_BHVR_GETCAM_FOVMAX, RlvReplyCamMinMaxModifierHandler>("getcam_fovmax", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvReplyProcessor<RLV_BHVR_GETCAM_TEXTURES>("getcam_textures", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvReplyProcessor<RLV_BHVR_GETCOMMAND>("getcommand", RlvBehaviourInfo::BHVR_EXTENDED));
addEntry(new RlvBehaviourInfo("getgroup", RLV_BHVR_GETGROUP, RLV_TYPE_REPLY));
addEntry(new RlvBehaviourInfo("getinv", RLV_BHVR_GETINV, RLV_TYPE_REPLY));
@ -365,9 +417,19 @@ void RlvBehaviourDictionary::toggleBehaviourFlag(const std::string& strBhvr, ERl
// RlvBehaviourModifier
//
RlvBehaviourModifier::RlvBehaviourModifier(const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator)
: m_DefaultValue(defaultValue), m_fAddDefaultOnEmpty(fAddDefaultOnEmpty), m_pValueComparator(pValueComparator)
RlvBehaviourModifier::RlvBehaviourModifier(std::string strName, const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator)
: m_strName(strName), m_DefaultValue(defaultValue), m_fAddDefaultOnEmpty(fAddDefaultOnEmpty), m_pValueComparator(pValueComparator)
{
m_pValueComparator = (pValueComparator) ? pValueComparator : new RlvBehaviourModifier_Comp();
}
RlvBehaviourModifier::~RlvBehaviourModifier()
{
if (m_pValueComparator)
{
delete m_pValueComparator;
m_pValueComparator = NULL;
}
}
bool RlvBehaviourModifier::addValue(const RlvBehaviourModifierValue& modValue, const LLUUID& idObject)
@ -375,13 +437,26 @@ bool RlvBehaviourModifier::addValue(const RlvBehaviourModifierValue& modValue, c
if (modValue.which() == m_DefaultValue.which())
{
m_Values.insert((m_pValueComparator) ? std::lower_bound(m_Values.begin(), m_Values.end(), std::make_pair(modValue, idObject), boost::bind(&RlvBehaviourModifier_Comp::operator(), m_pValueComparator, _1, _2)) : m_Values.end(), std::make_pair(modValue, idObject));
onValueChange();
// NOTE: change signal needs to trigger before modifier handlers so cached values have a chance to update properly
m_ChangeSignal(getValue());
onValueChange();
return true;
}
return false;
}
const LLUUID& RlvBehaviourModifier::getPrimaryObject() const
{
return (m_pValueComparator) ? m_pValueComparator->m_idPrimaryObject : LLUUID::null;
}
bool RlvBehaviourModifier::hasValue() const {
// If no primary object is set this returns "any value set"; otherwise it returns "any value set by the primary object"
if ( (!m_pValueComparator) || (m_pValueComparator->m_idPrimaryObject.isNull()) )
return !m_Values.empty();
return (!m_Values.empty()) ? m_Values.front().second == m_pValueComparator->m_idPrimaryObject : false;
}
void RlvBehaviourModifier::removeValue(const RlvBehaviourModifierValue& modValue, const LLUUID& idObject)
{
if ( (modValue.which() == m_DefaultValue.which()) )
@ -413,14 +488,32 @@ bool RlvBehaviourModifier::convertOptionValue(const std::string& optionValue, Rl
{
if (typeid(float) == m_DefaultValue.type())
{
modValue = std::stof(optionValue.c_str());
modValue = std::stof(optionValue);
return true;
}
else if (typeid(int) == m_DefaultValue.type())
{
modValue = std::stoi(optionValue.c_str());
modValue = std::stoi(optionValue);
return true;
}
else if (typeid(LLVector3) == m_DefaultValue.type())
{
LLVector3 vecOption;
if (3 == sscanf(optionValue.c_str(), "%f/%f/%f", vecOption.mV + 0, vecOption.mV + 1, vecOption.mV + 2))
{
modValue = vecOption;
return true;
}
}
else if (typeid(LLUUID) == m_DefaultValue.type())
{
LLUUID idOption;
if (LLUUID::parseUUID(optionValue, &idOption))
{
modValue = idOption;
return true;
}
}
return false;
}
catch (const std::invalid_argument&)
@ -436,15 +529,14 @@ bool RlvBehaviourModifier::convertOptionValue(const std::string& optionValue, Rl
RlvCommand::RlvCommand(const LLUUID& idObj, const std::string& strCommand)
: m_fValid(false), m_idObj(idObj), m_pBhvrInfo(NULL), m_eParamType(RLV_TYPE_UNKNOWN), m_fStrict(false), m_eRet(RLV_RET_UNKNOWN)
{
std::string strBehaviour;
if (m_fValid = parseCommand(strCommand, strBehaviour, m_strOption, m_strParam))
if (m_fValid = parseCommand(strCommand, m_strBehaviour, m_strOption, m_strParam))
{
S32 nTemp = 0;
if ( ("n" == m_strParam) || ("add" == m_strParam) )
m_eParamType = RLV_TYPE_ADD;
else if ( ("y" == m_strParam) || ("rem" == m_strParam) )
m_eParamType = RLV_TYPE_REMOVE;
else if (strBehaviour == "clear") // clear is the odd one out so just make it its own type
else if (m_strBehaviour == "clear") // clear is the odd one out so just make it its own type
m_eParamType = RLV_TYPE_CLEAR;
else if ("force" == m_strParam)
m_eParamType = RLV_TYPE_FORCE;
@ -463,7 +555,7 @@ RlvCommand::RlvCommand(const LLUUID& idObj, const std::string& strCommand)
return;
}
m_pBhvrInfo = RlvBehaviourDictionary::instance().getBehaviourInfo(strBehaviour, m_eParamType, &m_fStrict);
m_pBhvrInfo = RlvBehaviourDictionary::instance().getBehaviourInfo(m_strBehaviour, m_eParamType, &m_fStrict);
}
bool RlvCommand::parseCommand(const std::string& strCommand, std::string& strBehaviour, std::string& strOption, std::string& strParam)
@ -617,14 +709,6 @@ bool RlvCommandOptionHelper::parseOption<RlvCommandOptionGeneric>(const std::str
return true;
}
template<typename T>
T RlvCommandOptionHelper::parseOption(const std::string& strOption)
{
T value;
parseOption<T>(strOption, value);
return value;
}
bool RlvCommandOptionHelper::parseStringList(const std::string& strOption, std::vector<std::string>& optionList, const std::string& strSeparator)
{
if (!strOption.empty())
@ -857,9 +941,19 @@ bool RlvObject::hasBehaviour(ERlvBehaviour eBehaviour, bool fStrictOnly) const
bool RlvObject::hasBehaviour(ERlvBehaviour eBehaviour, const std::string& strOption, bool fStrictOnly) const
{
for (rlv_command_list_t::const_iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd)
if ( (itCmd->getBehaviourType() == eBehaviour) && (itCmd->getOption() == strOption) && ((!fStrictOnly) || (itCmd->isStrict())) )
for (const RlvCommand& rlvCmd : m_Commands)
{
// The specified behaviour is contained within the current object if:
// - the (parsed) behaviour matches
// - the option matches (or we're checking for an empty option and the command was reference counted)
// - we're not matching on strict (or it is a strict command)
if ( (rlvCmd.getBehaviourType() == eBehaviour) &&
( (rlvCmd.getOption() == strOption) || ((strOption.empty()) && (rlvCmd.isRefCounted())) ) &&
( (!fStrictOnly) ||(rlvCmd.isStrict()) ) )
{
return true;
}
}
return false;
}

View File

@ -1,17 +1,17 @@
/**
/**
*
* Copyright (c) 2009-2016, Kitty Barnett
*
* The source code in this file is provided to you under the terms of the
*
* The source code in this file is provided to you under the terms of the
* GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt
* in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt
*
*
* By copying, modifying or distributing this software, you acknowledge that
* you have read and understood your obligations described above, and agree to
* you have read and understood your obligations described above, and agree to
* abide by those obligations.
*
*
*/
#ifndef RLV_HELPER_H
@ -40,6 +40,7 @@ public:
BHVR_EXTENDED = 0x0004, // Behaviour is part of the RLVa extended command set
BHVR_EXPERIMENTAL = 0x0008, // Behaviour is part of the RLVa experimental command set
BHVR_BLOCKED = 0x0010, // Behaviour is blocked
BHVR_DEPRECATED = 0x0020, // Behaviour is deprecated
BHVR_GENERAL_MASK = 0x0FFF,
// Force-wear specific flags
@ -114,8 +115,15 @@ template<ERlvBehaviour eBhvr> using RlvForceHandler = RlvCommandHandler<RLV_TYPE
template<ERlvBehaviour eBhvr> using RlvReplyHandler = RlvCommandHandler<RLV_TYPE_REPLY, eBhvr>;
// List of shared handlers
typedef RlvBehaviourHandler<RLV_BHVR_REMATTACH> RlvBehaviourAddRemAttachHandler; // Shared between @addattach and @remattach
typedef RlvForceHandler<RLV_BHVR_REMATTACH> RlvForceRemAttachHandler; // Shared between @remattach and @detach
typedef RlvBehaviourToggleHandler<RLV_BHVR_SETCAM_EYEOFFSET> RlvBehaviourCamEyeFocusOffsetHandler; // Shared between @setcam_eyeoffset and @setcam_focusoffset
typedef RlvBehaviourHandler<RLV_BHVR_REMATTACH> RlvBehaviourAddRemAttachHandler; // Shared between @addattach and @remattach
typedef RlvBehaviourHandler<RLV_BHVR_SENDCHANNEL> RlvBehaviourSendChannelHandler; // Shared between @sendchannel and @sendchannel_except
typedef RlvBehaviourHandler<RLV_BHVR_SENDIM> RlvBehaviourRecvSendStartIMHandler; // Shared between @recvim, @sendim and @startim
typedef RlvBehaviourToggleHandler<RLV_BHVR_SHOWSELF> RlvBehaviourShowSelfToggleHandler; // Shared between @showself and @showselfhead
typedef RlvBehaviourHandler<RLV_BHVR_CAMZOOMMIN> RlvBehaviourCamZoomMinMaxHandler; // Shared between @camzoommin and @camzoommax (deprecated)
typedef RlvReplyHandler<RLV_BHVR_GETCAM_AVDISTMIN> RlvReplyCamMinMaxModifierHandler; // Shared between @getcam_avdistmin and @getcam_avdistmax
typedef RlvForceHandler<RLV_BHVR_REMATTACH> RlvForceRemAttachHandler; // Shared between @remattach and @detach
typedef RlvForceHandler<RLV_BHVR_SETCAM_EYEOFFSET> RlvForceCamEyeFocusOffsetHandler; // Shared between @setcam_eyeoffset and @setcam_focusoffset
//
// RlvCommandProcessor - Templated glue class that brings RlvBehaviourInfo, RlvCommandHandlerBaseImpl and RlvCommandHandler together
@ -148,13 +156,14 @@ template<ERlvBehaviourOptionType optionType> using RlvBehaviourGenericProcessor
// RlvBehaviourProcessor and related classes - Handles add/rem comamnds aka "restrictions)
//
template <ERlvBehaviour eBhvr, ERlvBehaviourOptionType optionType, typename toggleHandlerImpl = RlvBehaviourToggleHandler<eBhvr>>
template <ERlvBehaviour eBhvr, typename handlerImpl = RlvBehaviourHandler<eBhvr>, typename toggleHandlerImpl = RlvBehaviourToggleHandler<eBhvr>>
class RlvBehaviourToggleProcessor : public RlvBehaviourInfo
{
public:
RlvBehaviourToggleProcessor(const std::string& strBhvr, U32 nBhvrFlags = 0) : RlvBehaviourInfo(strBhvr, eBhvr, RLV_TYPE_ADDREM, nBhvrFlags) {}
ERlvCmdRet processCommand(const RlvCommand& rlvCmd) const override { return RlvCommandHandlerBaseImpl<RLV_TYPE_ADDREM>::processCommand(rlvCmd, &RlvBehaviourGenericHandler<optionType>::onCommand, &toggleHandlerImpl::onCommandToggle); }
ERlvCmdRet processCommand(const RlvCommand& rlvCmd) const override { return RlvCommandHandlerBaseImpl<RLV_TYPE_ADDREM>::processCommand(rlvCmd, &handlerImpl::onCommand, &toggleHandlerImpl::onCommandToggle); }
};
template <ERlvBehaviour eBhvr, ERlvBehaviourOptionType optionType, typename toggleHandlerImpl = RlvBehaviourToggleHandler<eBhvr>> using RlvBehaviourGenericToggleProcessor = RlvBehaviourToggleProcessor<eBhvr, RlvBehaviourGenericHandler<optionType>, toggleHandlerImpl>;
// ============================================================================
// RlvBehaviourModifier - stores behaviour modifiers in an - optionally - sorted list and returns the first element (or default value if there are no modifiers)
@ -197,8 +206,8 @@ struct RlvBehaviourModifier_CompMax : public RlvBehaviourModifier_Comp
class RlvBehaviourModifier
{
public:
RlvBehaviourModifier(const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator);
virtual ~RlvBehaviourModifier() {}
RlvBehaviourModifier(const std::string strName, const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator = nullptr);
virtual ~RlvBehaviourModifier();
/*
* Member functions
@ -206,14 +215,17 @@ public:
protected:
virtual void onValueChange() const {}
public:
bool addValue(const RlvBehaviourModifierValue& modValue, const LLUUID& idObject);
bool convertOptionValue(const std::string& optionValue, RlvBehaviourModifierValue& modValue) const;
bool getAddDefault() const { return m_fAddDefaultOnEmpty; }
bool addValue(const RlvBehaviourModifierValue& modValue, const LLUUID& idObject);
bool convertOptionValue(const std::string& optionValue, RlvBehaviourModifierValue& modValue) const;
bool getAddDefault() const { return m_fAddDefaultOnEmpty; }
const RlvBehaviourModifierValue& getDefaultValue() const { return m_DefaultValue; }
const RlvBehaviourModifierValue& getValue() const { return (!m_Values.empty()) ? m_Values.front().first : m_DefaultValue; }
const LLUUID& getPrimaryObject() const;
const std::string& getName() const { return m_strName; }
const RlvBehaviourModifierValue& getValue() const { return (hasValue()) ? m_Values.front().first : m_DefaultValue; }
template<typename T> const T& getValue() const { return boost::get<T>(getValue()); }
void removeValue(const RlvBehaviourModifierValue& modValue, const LLUUID& idObject);
void setPrimaryObject(const LLUUID& idPrimaryObject);
bool hasValue() const;
void removeValue(const RlvBehaviourModifierValue& modValue, const LLUUID& idObject);
void setPrimaryObject(const LLUUID& idPrimaryObject);
typedef boost::signals2::signal<void(const RlvBehaviourModifierValue& newValue)> change_signal_t;
change_signal_t& getSignal() { return m_ChangeSignal; }
@ -222,6 +234,7 @@ public:
* Member variables
*/
protected:
std::string m_strName;
RlvBehaviourModifierValue m_DefaultValue;
bool m_fAddDefaultOnEmpty;
std::list<RlvBehaviourModifierValueTuple> m_Values;
@ -234,8 +247,8 @@ class RlvBehaviourModifierHandler : public RlvBehaviourModifier
{
public:
//using RlvBehaviourModifier::RlvBehaviourModifier; // Needs VS2015 and up
RlvBehaviourModifierHandler(const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator)
: RlvBehaviourModifier(defaultValue, fAddDefaultOnEmpty, pValueComparator) {}
RlvBehaviourModifierHandler(const std::string& strName, const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator)
: RlvBehaviourModifier(strName, defaultValue, fAddDefaultOnEmpty, pValueComparator) {}
protected:
void onValueChange() const override;
};
@ -309,6 +322,7 @@ protected:
class RlvBehaviourDictionary : public LLSingleton<RlvBehaviourDictionary>
{
friend class LLSingleton<RlvBehaviourDictionary>;
friend class RlvFloaterBehaviours;
protected:
RlvBehaviourDictionary();
~RlvBehaviourDictionary();
@ -358,7 +372,7 @@ public:
*/
public:
std::string asString() const;
const std::string& getBehaviour() const { return (m_pBhvrInfo) ? m_pBhvrInfo->getBehaviour() : LLStringUtil::null; }
const std::string& getBehaviour() const { return (m_pBhvrInfo) ? m_pBhvrInfo->getBehaviour() : m_strBehaviour; }
ERlvBehaviour getBehaviourType() const { return (m_pBhvrInfo) ? m_pBhvrInfo->getBehaviourType() : RLV_BHVR_UNKNOWN; }
U32 getBehaviourFlags() const{ return (m_pBhvrInfo) ? m_pBhvrInfo->getBehaviourFlags() : 0; }
const LLUUID& getObjectID() const { return m_idObj; }
@ -368,12 +382,14 @@ public:
ERlvCmdRet getReturnType() const { return m_eRet; }
bool hasOption() const { return !m_strOption.empty(); }
bool isBlocked() const { return (m_pBhvrInfo) ? m_pBhvrInfo->isBlocked() : false; }
bool isRefCounted() const { return m_fRefCounted; }
bool isStrict() const { return m_fStrict; }
bool isValid() const { return m_fValid; }
ERlvCmdRet processCommand() const { return (m_pBhvrInfo) ? m_pBhvrInfo->processCommand(*this) : RLV_RET_FAILED_UNKNOWN; }
ERlvCmdRet processCommand() const { return (m_pBhvrInfo) ? m_pBhvrInfo->processCommand(*this) : RLV_RET_NO_PROCESSOR; }
protected:
static bool parseCommand(const std::string& strCommand, std::string& strBehaviour, std::string& strOption, std::string& strParam);
bool markRefCounted() const { return m_fRefCounted = true; }
/*
* Operators
@ -387,15 +403,18 @@ public:
protected:
bool m_fValid;
LLUUID m_idObj;
std::string m_strBehaviour;
const RlvBehaviourInfo* m_pBhvrInfo;
ERlvParamType m_eParamType;
bool m_fStrict;
std::string m_strOption;
std::string m_strParam;
ERlvCmdRet m_eRet;
mutable bool m_fRefCounted;
friend class RlvHandler;
friend class RlvObject;
template<ERlvParamType> friend struct RlvCommandHandlerBaseImpl;
};
// ============================================================================
@ -407,7 +426,12 @@ class RlvCommandOptionHelper
public:
// NOTE: this function is destructive (reference value may still change on parsing failure)
template<typename T> static bool parseOption(const std::string& strOption, T& valueOption);
template<typename T> static T parseOption(const std::string& strOption);
template<typename T> static T parseOption(const std::string& strOption)
{
T value;
parseOption<T>(strOption, value);
return value;
}
static bool parseStringList(const std::string& strOption, std::vector<std::string>& optionList, const std::string& strSeparator = std::string(RLV_OPTION_SEPARATOR));
};

View File

@ -20,12 +20,14 @@
#include "llattachmentsmgr.h"
#include "lloutfitobserver.h"
#include "llviewerobjectlist.h"
#include "llviewermenu.h"
#include "pipeline.h"
#include "rlvlocks.h"
#include "rlvhelper.h"
#include "rlvinventory.h"
// ============================================================================
// RlvAttachPtLookup member functions
//
@ -401,8 +403,7 @@ void RlvAttachmentLocks::updateLockedHUD()
// Reset HUD visibility and wireframe options if at least one HUD attachment is locked
if (m_fHasLockedHUD)
{
LLPipeline::sShowHUDAttachments = TRUE;
gUseWireframe = FALSE;
set_use_wireframe(false);
}
}

View File

@ -17,14 +17,11 @@
#include "llviewerprecompiledheaders.h"
#include "llagent.h"
#include "llavataractions.h" // LLAvatarActions::profileVisible()
#include "llavatarlist.h" // Avatar list control used by the "Nearby" tab in the "People" sidebar panel
#include "llavatarnamecache.h"
#include "llfloatersidepanelcontainer.h"
#include "llhudtext.h" // LLHUDText::refreshAllObjectText()
#include "llimview.h" // LLIMMgr::computeSessionID()
#include "llmoveview.h" // Movement panel (contains "Stand" and "Stop Flying" buttons)
#include "llnavigationbar.h" // Navigation bar
#include "llpanelpeople.h" // "People" sidebar panel
#include "llparcel.h"
#include "llpaneltopinfobar.h"
#include "llteleporthistory.h"
@ -47,7 +44,6 @@ RlvUIEnabler::RlvUIEnabler()
// onRefreshHoverText()
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWLOC, boost::bind(&RlvUIEnabler::onRefreshHoverText, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWNAMES, boost::bind(&RlvUIEnabler::onRefreshHoverText, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWHOVERTEXTALL, boost::bind(&RlvUIEnabler::onRefreshHoverText, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWHOVERTEXTWORLD, boost::bind(&RlvUIEnabler::onRefreshHoverText, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWHOVERTEXTHUD, boost::bind(&RlvUIEnabler::onRefreshHoverText, this)));
@ -65,7 +61,6 @@ RlvUIEnabler::RlvUIEnabler()
// onToggleXXX
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWLOC, boost::bind(&RlvUIEnabler::onToggleShowLoc, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWMINIMAP, boost::bind(&RlvUIEnabler::onToggleShowMinimap, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWNAMES, boost::bind(&RlvUIEnabler::onToggleShowNames, this, _1)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWWORLDMAP, boost::bind(&RlvUIEnabler::onToggleShowWorldMap, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_UNSIT, boost::bind(&RlvUIEnabler::onToggleUnsit, this)));
@ -211,42 +206,6 @@ void RlvUIEnabler::onToggleShowMinimap()
}
}
// Checked: 2010-12-08 (RLVa-1.4.0a) | Modified: RLVa-1.2.2c
void RlvUIEnabler::onToggleShowNames(bool fQuitting)
{
if (fQuitting)
return; // Nothing to do if the viewer is shutting down
bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
// Refresh the nearby people list
LLPanelPeople* pPeoplePanel = LLFloaterSidePanelContainer::getPanel<LLPanelPeople>("people", "panel_people");
RLV_ASSERT( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) );
if ( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) )
{
if (pPeoplePanel->getNearbyList()->isInVisibleChain())
pPeoplePanel->onCommit();
pPeoplePanel->getNearbyList()->updateAvatarNames();
}
// // Refresh the speaker list
// LLCallFloater* pCallFloater = LLFloaterReg::findTypedInstance<LLCallFloater>("voice_controls");
// if (pCallFloater)
// pCallFloater->getAvatarCallerList()->updateAvatarNames();
// Force the use of the "display name" cache so we can filter both display and legacy names (or return back to the user's preference)
if (!fEnable)
{
LLAvatarNameCache::setForceDisplayNames(true);
}
else
{
LLAvatarNameCache::setForceDisplayNames(false);
LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames"));
}
LLVOAvatar::invalidateNameTags(); // See handleDisplayNamesOptionChanged()
}
// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a
void RlvUIEnabler::onToggleShowWorldMap()
{

View File

@ -47,7 +47,6 @@ protected:
void onToggleMovement(); // fly, alwaysrun and temprun
void onToggleShowLoc(); // showloc
void onToggleShowMinimap(); // showminimap
void onToggleShowNames(bool fQuitting); // shownames
void onToggleShowWorldMap(); // showworldmap
void onToggleTp(); // tploc and tplm
void onToggleUnsit(); // unsit

View File

@ -6,20 +6,20 @@
can_resize="true"
height="300"
min_height="300"
min_width="300"
min_width="450"
name="rlv_behaviours"
save_rect="true"
save_visibility="false"
single_instance="true"
title="Active RLV Restrictions"
width="300">
width="450">
<tab_container
follows="all"
layout="topleft"
left="8"
left="8"
name="behaviour_tab"
height="266"
right="-8"
right="-8"
tab_height="23"
tab_min_width="120"
tab_position="top"
@ -31,16 +31,16 @@
name="behaviour_panel"
top="0">
<scroll_list
draw_border="false"
draw_heading="true"
draw_stripes="true"
follows="all"
height="266"
layout="topleft"
multi_select="false"
name="behaviour_list"
tool_tip="List of current RLVa restrictions."
top_pad="0" >
draw_border="false"
draw_heading="true"
draw_stripes="true"
follows="all"
height="266"
layout="topleft"
multi_select="false"
name="behaviour_list"
tool_tip="List of current RLVa restrictions."
top_pad="0" >
<scroll_list.columns label="Restriction" name="behaviour" width="70" />
<scroll_list.columns label="Object Name" name="issuer" />
</scroll_list>
@ -52,21 +52,43 @@
name="exception_panel"
top="0">
<scroll_list
draw_border="false"
draw_heading="true"
draw_stripes="true"
follows="all"
height="266"
layout="topleft"
multi_select="false"
name="exception_list"
tool_tip="List of current RLVa exceptions."
top_pad="0" >
draw_border="false"
draw_heading="true"
draw_stripes="true"
follows="all"
height="266"
layout="topleft"
multi_select="false"
name="exception_list"
tool_tip="List of current RLVa exceptions."
top_pad="0" >
<scroll_list.columns label="Exception" name="behaviour" width="70" />
<scroll_list.columns label="Source" name="option" width="105" />
<scroll_list.columns label="Object Name" name="issuer" />
</scroll_list>
</panel>
<panel
follows="all" height="265"
label="MODIFIERS"
layout="topleft"
name="modifier_panel"
top="0">
<scroll_list
draw_border="false"
draw_heading="true"
draw_stripes="true"
follows="all"
height="266"
layout="topleft"
multi_select="false"
name="modifier_list"
tool_tip="List of current RLVa modifiers."
top_pad="0" >
<scroll_list.columns label="Modifier" name="modifier" width="105" />
<scroll_list.columns label="Value" name="value" width="105" />
<scroll_list.columns label="Primary Object" name="primary" />
</scroll_list>
</panel>
</tab_container>
<panel
background_visible="false"

View File

@ -10,8 +10,7 @@
function="ShowAgentProfile"
parameter="hit object" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
enabled="false"
@ -29,8 +28,7 @@
<menu_item_call.on_click
function="Avatar.AddToContactSet" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
label="IM"
@ -38,8 +36,7 @@
<menu_item_call.on_click
function="Avatar.SendIM" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
label="Give Calling Card"
@ -47,8 +44,7 @@
<menu_item_call.on_click
function="Avatar.GiveCard" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
label="Call"
@ -64,8 +60,7 @@
<menu_item_call.on_click
function="Avatar.InviteToGroup" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_separator />
<context_menu

View File

@ -10,8 +10,7 @@
function="ShowAgentProfile"
parameter="hit object" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
enabled="false"
@ -28,8 +27,7 @@
<menu_item_call.on_click
function="Avatar.GiveCard" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
label="Add to Set"
@ -38,8 +36,7 @@
<menu_item_call.on_click
function="Avatar.AddToContactSet" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
label="IM"
@ -47,8 +44,7 @@
<menu_item_call.on_click
function="Avatar.SendIM" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
label="Call"
@ -64,8 +60,7 @@
<menu_item_call.on_click
function="Avatar.InviteToGroup" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_separator />
@ -135,6 +130,8 @@
name="Pay...">
<menu_item_call.on_click
function="PayObject" />
<menu_item_call.on_enable
function="EnablePayAvatar" />
</menu_item_call>
<menu_item_call
enabled="true"

View File

@ -10,8 +10,7 @@
function="ShowAgentProfile"
parameter="hit object" />
<pie_slice.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</pie_slice>
<pie_menu
name="mute_menu"
@ -70,8 +69,7 @@
<pie_slice.on_click
function="Avatar.AddToContactSet" />
<pie_slice.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</pie_slice>
</pie_menu>
<pie_slice
@ -102,8 +100,7 @@
<pie_slice.on_click
function="Avatar.GiveCard" />
<pie_slice.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</pie_slice>
<pie_slice
label="Invite to Group"
@ -111,8 +108,7 @@
<pie_slice.on_click
function="Avatar.InviteToGroup" />
<pie_slice.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</pie_slice>
<pie_separator/>
<pie_slice
@ -272,8 +268,7 @@
<pie_slice.on_click
function="Avatar.SendIM" />
<pie_slice.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</pie_slice>
</pie_menu>

View File

@ -10,8 +10,7 @@
function="ShowAgentProfile"
parameter="hit object" />
<pie_slice.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</pie_slice>
<pie_menu
name="mute_menu"
@ -70,8 +69,7 @@
<pie_slice.on_click
function="Avatar.AddToContactSet" />
<pie_slice.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</pie_slice>
</pie_menu>
<pie_slice
@ -102,8 +100,7 @@
<pie_slice.on_click
function="Avatar.GiveCard" />
<pie_slice.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</pie_slice>
<pie_slice
label="Invite to Group"
@ -111,8 +108,7 @@
<pie_slice.on_click
function="Avatar.InviteToGroup" />
<pie_slice.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</pie_slice>
<pie_separator/>
<pie_slice
@ -237,8 +233,7 @@
<pie_slice.on_click
function="Avatar.SendIM" />
<pie_slice.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</pie_slice>
</pie_menu>

View File

@ -2280,16 +2280,6 @@
function="ToggleControl"
parameter="RestrainedLoveShowEllipsis" />
</menu_item_check>
<menu_item_check
label="Show Name Tags"
name="Show Name Tags">
<menu_item_check.on_check
function="CheckControl"
parameter="RLVaShowNameTags" />
<menu_item_check.on_click
function="ToggleControl"
parameter="RLVaShowNameTags" />
</menu_item_check>
<menu_item_check
label="Wear Replaces Unlocked"
name="Wear Replaces Unlocked">

View File

@ -46,6 +46,11 @@
</map>
<!-- Shown as notifications -->
<key>blocked_autopilot</key>
<map>
<key>value</key>
<string>Unable to use the autopilot due to RLV restrictions</string>
</map>
<key>blocked_generic</key>
<map>
<key>value</key>
@ -76,6 +81,11 @@
<key>value</key>
<string>Unable to initiate teleport due to RLV restrictions</string>
</map>
<key>blocked_teleport_offer</key>
<map>
<key>value</key>
<string>Unable to offer teleport due to RLV restrictions</string>
</map>
<key>blocked_viewxxx</key>
<map>
<key>value</key>