[RLVa] @camavdist

This commit is contained in:
Inusaito Sayori
2015-05-26 02:49:23 -04:00
parent 210c97986d
commit c42e501f6f
3 changed files with 24 additions and 1 deletions

View File

@@ -3794,6 +3794,9 @@ bool LLVOAvatar::isVisuallyMuted() const
muted = (!show_muted && LLMuteList::getInstance()->isMuted(getID())) ||
(mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) ||
(mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) ||
// [RLVa:LF] - RLV 2.9 camavdist
(gRlvHandler.hasBehaviour(RLV_BHVR_CAMAVDIST) && (gAgent.getPosGlobalFromAgent(const_cast<LLVOAvatar&>(*this).getCharacterPosition()) - gAgent.getPosGlobalFromAgent(gAgentAvatarp->getRenderPosition())).magVec() > gRlvHandler.camAvDist()) ||
// [/RLVa:LF]
isLangolier();
}
return muted;

View File

@@ -840,6 +840,18 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const
return true;
}
F32 RlvHandler::camAvDist() const
{
F32 ret(F32_MAX);
for (rlv_exception_map_t::const_iterator i = m_Exceptions.lower_bound(RLV_BHVR_CAMAVDIST),
end = m_Exceptions.upper_bound(RLV_BHVR_CAMAVDIST); i != end; ++i)
{
F32 dist(boost::get<F32>(i->second.varOption));
if (ret > dist) ret = dist;
}
return ret;
}
// ============================================================================
// Composite folders
//
@@ -1326,8 +1338,15 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd)
eRet = RLV_RET_FAILED_UNKNOWN; // Singu TODO: Implement
break;
case RLV_BHVR_CAMAVDIST: // @camavdist:<distance>=n|y - Checked: 2015-05-25 (RLVa:LF)
eRet = RLV_RET_FAILED_UNKNOWN; // Singu TODO: Implement
{
F32 dist;
LLStringUtil::convertToF32(strOption, dist);
if (RLV_TYPE_ADD == eType)
addException(rlvCmd.getObjectID(), eBhvr, dist);
else
removeException(rlvCmd.getObjectID(), eBhvr, dist);
break;
}
// The following block is only valid if there's no option
case RLV_BHVR_SHOWLOC: // @showloc=n|y - Checked: 2009-12-05 (RLVa-1.1.0h) | Modified: RLVa-1.1.0h
case RLV_BHVR_SHOWNAMES: // @shownames=n|y - Checked: 2009-12-05 (RLVa-1.1.0h) | Modified: RLVa-1.1.0h

View File

@@ -100,6 +100,7 @@ public:
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
F32 camAvDist() const; // @camavdist
// Command processing helper functions
ERlvCmdRet processCommand(const LLUUID& idObj, const std::string& strCommand, bool fFromObj);