Merged with RLVa-refactor tip
commit
1c7b227637
|
|
@ -0,0 +1,12 @@
|
|||
[repository]
|
||||
native = LF
|
||||
|
||||
[patterns]
|
||||
path:indra/lscript/lscript_compile/windows/unistd.h = CRLF
|
||||
path:indra/newview/installers/windows/FILES_ARE_UNICODE_UTF-16LE.txt = CRLF
|
||||
path:indra/tools/vstool/README.txt = CRLF
|
||||
**.h = native
|
||||
**.cpp = native
|
||||
**.py = native
|
||||
**.xml = native
|
||||
**.txt = native
|
||||
|
|
@ -1 +1 @@
|
|||
543c14d1270ba0327474287b08ae6463d8c03fdb
|
||||
264c7688ecdba8432a64f36a24e389eb85cbc10d
|
||||
|
|
@ -1546,9 +1546,6 @@ set(viewer_HEADER_FILES
|
|||
pieseparator.h
|
||||
pieslice.h
|
||||
pipeline.h
|
||||
roles_constants.h
|
||||
qtoolalign.h
|
||||
quickprefs.h
|
||||
rlvactions.h
|
||||
rlvdefines.h
|
||||
rlvhandler.h
|
||||
|
|
@ -1559,6 +1556,9 @@ set(viewer_HEADER_FILES
|
|||
rlvextensions.h
|
||||
rlvfloaters.h
|
||||
rlvui.h
|
||||
roles_constants.h
|
||||
qtoolalign.h
|
||||
quickprefs.h
|
||||
sanitycheck.h
|
||||
streamtitledisplay.h
|
||||
utilitybar.h
|
||||
|
|
|
|||
|
|
@ -1309,6 +1309,17 @@
|
|||
<key>Value</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>RLVaExperimentalCommands</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Enables the experimental command set</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>RLVaHideLockedLayers</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "llmutelist.h"
|
||||
#include "llnotificationmanager.h"
|
||||
#include "lltooldraganddrop.h"
|
||||
#include "lltrans.h"
|
||||
#include "llviewerinventory.h"
|
||||
#include "llviewernetwork.h"
|
||||
#include "llviewerobject.h"
|
||||
|
|
|
|||
|
|
@ -98,14 +98,17 @@
|
|||
#include "stringize.h"
|
||||
#include "boost/foreach.hpp"
|
||||
#include "llcorehttputil.h"
|
||||
// [RLVa:KB] - Checked: 2011-11-04 (RLVa-1.4.4a)
|
||||
#include "rlvactions.h"
|
||||
#include "rlvhandler.h"
|
||||
#include "rlvhelper.h"
|
||||
#include "rlvui.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
// Firestorm includes
|
||||
#include "fslslbridge.h"
|
||||
#include "kcwlinterface.h"
|
||||
#include "llpresetsmanager.h"
|
||||
#include "rlvactions.h"
|
||||
#include "rlvhandler.h"
|
||||
#include "rlvhelper.h"
|
||||
#include "NACLantispam.h"
|
||||
|
||||
using namespace LLAvatarAppearanceDefines;
|
||||
|
|
@ -216,7 +219,10 @@ private:
|
|||
class LLTeleportRequestViaLocationLookAt : public LLTeleportRequestViaLocation
|
||||
{
|
||||
public:
|
||||
LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal);
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal, const LLVector3& look_at);
|
||||
// [/RLVa:KB]
|
||||
// LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal);
|
||||
virtual ~LLTeleportRequestViaLocationLookAt();
|
||||
|
||||
virtual bool canRestartTeleport();
|
||||
|
|
@ -225,8 +231,14 @@ public:
|
|||
virtual void restartTeleport();
|
||||
|
||||
protected:
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
const LLVector3& getLookAt() const { return mLookAt; }
|
||||
// [/RLVa:KB]
|
||||
|
||||
private:
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
LLVector3 mLookAt;
|
||||
// [/RLVa:KB]
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -2934,15 +2946,11 @@ void LLAgent::onAnimStop(const LLUUID& id)
|
|||
}
|
||||
else if (id == ANIM_AGENT_AWAY)
|
||||
{
|
||||
// clearAFK();
|
||||
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Added: RLVa-1.1.0g
|
||||
#ifdef RLV_EXTENSION_CMD_ALLOWIDLE
|
||||
if (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE))
|
||||
clearAFK();
|
||||
#else
|
||||
clearAFK();
|
||||
#endif // RLV_EXTENSION_CMD_ALLOWIDLE
|
||||
// [/RLVa:KB]
|
||||
// clearAFK();
|
||||
}
|
||||
else if (id == ANIM_AGENT_STANDUP)
|
||||
{
|
||||
|
|
@ -4627,10 +4635,13 @@ void LLAgent::handleTeleportFailed()
|
|||
}
|
||||
}
|
||||
|
||||
void LLAgent::teleportRequest(
|
||||
const U64& region_handle,
|
||||
const LLVector3& pos_local,
|
||||
bool look_at_from_camera)
|
||||
//void LLAgent::teleportRequest(
|
||||
// const U64& region_handle,
|
||||
// const LLVector3& pos_local,
|
||||
// bool look_at_from_camera)
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
void LLAgent::teleportRequest(const U64& region_handle, const LLVector3& pos_local, const LLVector3& look_at)
|
||||
// [/RLVa:KB]
|
||||
{
|
||||
LLViewerRegion* regionp = getRegion();
|
||||
bool is_local = (region_handle == regionp->getHandle());
|
||||
|
|
@ -4646,11 +4657,11 @@ void LLAgent::teleportRequest(
|
|||
msg->nextBlockFast(_PREHASH_Info);
|
||||
msg->addU64("RegionHandle", region_handle);
|
||||
msg->addVector3("Position", pos_local);
|
||||
LLVector3 look_at(0,1,0);
|
||||
if (look_at_from_camera)
|
||||
{
|
||||
look_at = LLViewerCamera::getInstance()->getAtAxis();
|
||||
}
|
||||
// LLVector3 look_at(0,1,0);
|
||||
// if (look_at_from_camera)
|
||||
// {
|
||||
// look_at = LLViewerCamera::getInstance()->getAtAxis();
|
||||
// }
|
||||
msg->addVector3("LookAt", look_at);
|
||||
sendReliableMessage();
|
||||
}
|
||||
|
|
@ -4763,13 +4774,10 @@ void LLAgent::restoreCanceledTeleportRequest()
|
|||
|
||||
void LLAgent::teleportViaLocation(const LLVector3d& pos_global)
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.2.0c) | Modified: RLVa-1.2.0a
|
||||
if ( (rlv_handler_t::isEnabled()) && (!RlvUtil::isForceTp()) )
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
if ( (RlvActions::isRlvEnabled()) && (!RlvUtil::isForceTp()) )
|
||||
{
|
||||
// If we're getting teleported due to @tpto we should disregard any @tploc=n or @unsit=n restrictions from the same object
|
||||
if ( (gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOC, gRlvHandler.getCurrentObject())) ||
|
||||
( (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) &&
|
||||
(gRlvHandler.hasBehaviourExcept(RLV_BHVR_UNSIT, gRlvHandler.getCurrentObject()))) )
|
||||
if ( (RlvActions::isLocalTp(pos_global)) ? !RlvActions::canTeleportToLocal() : !RlvActions::canTeleportToLocation() )
|
||||
{
|
||||
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT);
|
||||
return;
|
||||
|
|
@ -4844,25 +4852,37 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global)
|
|||
}
|
||||
|
||||
// Teleport to global position, but keep facing in the same direction
|
||||
void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global)
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at)
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2010-10-07 (RLVa-1.2.1f) | Added: RLVa-1.2.1f
|
||||
// RELEASE-RLVa: [SL-2.2.0] Make sure this isn't used for anything except double-click teleporting
|
||||
if ( (rlv_handler_t::isEnabled()) && (!RlvUtil::isForceTp()) &&
|
||||
((gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) || (!RlvActions::canStand())) )
|
||||
if ( (RlvActions::isRlvEnabled()) && (!RlvUtil::isForceTp()) )
|
||||
{
|
||||
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT);
|
||||
return;
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
if ( (RlvActions::isLocalTp(pos_global)) ? !RlvActions::canTeleportToLocal() : !RlvActions::canTeleportToLocation() )
|
||||
{
|
||||
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT);
|
||||
return;
|
||||
}
|
||||
|
||||
mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global));
|
||||
if ( (gRlvHandler.getCurrentCommand()) && (RLV_BHVR_TPTO == gRlvHandler.getCurrentCommand()->getBehaviourType()) )
|
||||
{
|
||||
gRlvHandler.setCanCancelTp(false);
|
||||
}
|
||||
}
|
||||
|
||||
mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global, (look_at.isExactlyZero()) ? LLViewerCamera::getInstance()->getAtAxis() : look_at));
|
||||
startTeleportRequest();
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
//void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global)
|
||||
//{
|
||||
// mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global));
|
||||
// startTeleportRequest();
|
||||
//}
|
||||
|
||||
void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global)
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at)
|
||||
{
|
||||
mbTeleportKeepsLookAt = true;
|
||||
mbTeleportKeepsLookAt = look_at.isExactlyZero();
|
||||
|
||||
if(!gAgentCamera.isfollowCamLocked())
|
||||
{
|
||||
|
|
@ -4878,7 +4898,7 @@ void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global)
|
|||
}
|
||||
// </FS:CR>
|
||||
LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle));
|
||||
teleportRequest(region_handle, pos_local, getTeleportKeepsLookAt());
|
||||
teleportRequest(region_handle, pos_local, look_at);
|
||||
|
||||
// <FS:TT> Client LSL Bridge
|
||||
if (FSLSLBridge::instance().canUseBridge())
|
||||
|
|
@ -4896,6 +4916,21 @@ LLAgent::ETeleportState LLAgent::getTeleportState() const
|
|||
return (mTeleportRequest && (mTeleportRequest->getStatus() == LLTeleportRequest::kFailed)) ?
|
||||
TELEPORT_NONE : mTeleportState;
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
//void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at)
|
||||
//{
|
||||
// mbTeleportKeepsLookAt = true;
|
||||
//
|
||||
// if(!gAgentCamera.isfollowCamLocked())
|
||||
// {
|
||||
// gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction
|
||||
// }
|
||||
//
|
||||
// U64 region_handle = to_region_handle(pos_global);
|
||||
// LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle));
|
||||
// teleportRequest(region_handle, pos_local, look_at);
|
||||
// teleportRequest(region_handle, pos_local, getTeleportKeepsLookAt());
|
||||
//}
|
||||
|
||||
|
||||
void LLAgent::setTeleportState(ETeleportState state)
|
||||
|
|
@ -5402,11 +5437,18 @@ void LLTeleportRequestViaLocation::restartTeleport()
|
|||
// LLTeleportRequestViaLocationLookAt
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
LLTeleportRequestViaLocationLookAt::LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal)
|
||||
: LLTeleportRequestViaLocation(pPosGlobal)
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
LLTeleportRequestViaLocationLookAt::LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal, const LLVector3& look_at)
|
||||
: LLTeleportRequestViaLocation(pPosGlobal), mLookAt(look_at)
|
||||
{
|
||||
LL_INFOS("Teleport") << "LLTeleportRequestViaLocationLookAt created" << LL_ENDL;
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
//LLTeleportRequestViaLocationLookAt::LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal)
|
||||
// : LLTeleportRequestViaLocation(pPosGlobal)
|
||||
//{
|
||||
//}
|
||||
|
||||
LLTeleportRequestViaLocationLookAt::~LLTeleportRequestViaLocationLookAt()
|
||||
{
|
||||
|
|
@ -5422,13 +5464,19 @@ bool LLTeleportRequestViaLocationLookAt::canRestartTeleport()
|
|||
void LLTeleportRequestViaLocationLookAt::startTeleport()
|
||||
{
|
||||
LL_INFOS("Teleport") << "LLTeleportRequestViaLocationLookAt::startTeleport" << LL_ENDL;
|
||||
gAgent.doTeleportViaLocationLookAt(getPosGlobal());
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
gAgent.doTeleportViaLocationLookAt(getPosGlobal(), getLookAt());
|
||||
// [/RLVa:KB]
|
||||
// gAgent.doTeleportViaLocationLookAt(getPosGlobal());
|
||||
}
|
||||
|
||||
void LLTeleportRequestViaLocationLookAt::restartTeleport()
|
||||
{
|
||||
LL_INFOS("Teleport") << "LLTeleportRequestViaLocationLookAt::restartTeleport" << LL_ENDL;
|
||||
gAgent.doTeleportViaLocationLookAt(getPosGlobal());
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
gAgent.doTeleportViaLocationLookAt(getPosGlobal(), getLookAt());
|
||||
// [/RLVa:KB]
|
||||
// gAgent.doTeleportViaLocationLookAt(getPosGlobal());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -721,7 +721,10 @@ public:
|
|||
void teleportHome() { teleportViaLandmark(LLUUID::null); } // Go home
|
||||
void teleportViaLure(const LLUUID& lure_id, BOOL godlike); // To an invited location
|
||||
void teleportViaLocation(const LLVector3d& pos_global); // To a global location - this will probably need to be deprecated
|
||||
void teleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
void teleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at = LLVector3::zero);// To a global location, preserving camera rotation
|
||||
// [/RLVa:KB]
|
||||
// void teleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation
|
||||
void teleportCancel(); // May or may not be allowed by server
|
||||
void restoreCanceledTeleportRequest();
|
||||
bool getTeleportKeepsLookAt() { return mbTeleportKeepsLookAt; } // Whether look-at reset after teleport
|
||||
|
|
@ -765,13 +768,19 @@ private:
|
|||
bool hasPendingTeleportRequest();
|
||||
void startTeleportRequest();
|
||||
|
||||
void teleportRequest(const U64& region_handle,
|
||||
const LLVector3& pos_local, // Go to a named location home
|
||||
bool look_at_from_camera = false);
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
void teleportRequest(const U64& region_handle, const LLVector3& pos_local, const LLVector3& look_at = LLVector3(0, 1, 0));
|
||||
// [/RLVa:KB]
|
||||
// void teleportRequest(const U64& region_handle,
|
||||
// const LLVector3& pos_local, // Go to a named location home
|
||||
// bool look_at_from_camera = false);
|
||||
void doTeleportViaLandmark(const LLUUID& landmark_id); // Teleport to a landmark
|
||||
void doTeleportViaLure(const LLUUID& lure_id, BOOL godlike); // To an invited location
|
||||
void doTeleportViaLocation(const LLVector3d& pos_global); // To a global location - this will probably need to be deprecated
|
||||
void doTeleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
void doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at);// To a global location, preserving camera rotation
|
||||
// [/RLVa:KB]
|
||||
// void doTeleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation
|
||||
|
||||
void handleTeleportFinished();
|
||||
void handleTeleportFailed();
|
||||
|
|
|
|||
|
|
@ -59,12 +59,12 @@
|
|||
#include "llappviewer.h"
|
||||
#include "llcoros.h"
|
||||
#include "lleventcoro.h"
|
||||
|
||||
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1)
|
||||
#include "rlvhandler.h"
|
||||
#include "rlvhelper.h"
|
||||
#include "rlvlocks.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
#include "fslslbridge.h"
|
||||
|
||||
#if LL_MSVC
|
||||
|
|
@ -1321,28 +1321,22 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items)
|
|||
// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2015-06-30 (Catznip-3.7)
|
||||
static void removeDuplicateWearableItemsByAssetID(LLInventoryModel::item_array_t& items)
|
||||
{
|
||||
struct is_duplicate_asset
|
||||
{
|
||||
bool operator()(const LLViewerInventoryItem* pItem)
|
||||
std::set<LLUUID> idsAsset;
|
||||
items.erase(std::remove_if(items.begin(), items.end(),
|
||||
[&idsAsset](const LLViewerInventoryItem* pItem)
|
||||
{
|
||||
if (pItem->isWearableType())
|
||||
{
|
||||
const LLUUID& idAsset = pItem->getAssetUUID();
|
||||
if ( (idAsset.notNull()) && (m_idsAsset.end() != m_idsAsset.find(idAsset)) )
|
||||
if ( (idAsset.notNull()) && (idsAsset.end() != idsAsset.find(idAsset)) )
|
||||
return true;
|
||||
m_idsAsset.insert(idAsset);
|
||||
idsAsset.insert(idAsset);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
protected:
|
||||
std::set<LLUUID> m_idsAsset;
|
||||
};
|
||||
items.erase(std::remove_if(items.begin(), items.end(), is_duplicate_asset()), items.end());
|
||||
}), items.end());
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
//=========================================================================
|
||||
|
||||
const LLUUID LLAppearanceMgr::getCOF() const
|
||||
{
|
||||
return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
|
||||
|
|
@ -1524,9 +1518,9 @@ void LLAppearanceMgr::wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear,
|
|||
LLUUID item_id = gAgentWearables.getWearableItemID(item_to_wear->getWearableType(),
|
||||
wearable_count-1);
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-05-02 (Catznip-3.7)
|
||||
removeCOFItemLinks(item_id, NULL, true);
|
||||
removeCOFItemLinks(item_id, NULL, true);
|
||||
// [/SL:KB]
|
||||
// removeCOFItemLinks(item_id, cb);
|
||||
// removeCOFItemLinks(item_id, cb);
|
||||
}
|
||||
|
||||
items_to_link.push_back(item_to_wear);
|
||||
|
|
@ -2081,6 +2075,8 @@ void LLAppearanceMgr::filterWearableItems(
|
|||
}
|
||||
}
|
||||
|
||||
//void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
|
||||
// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0)
|
||||
void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
|
||||
{
|
||||
LLViewerInventoryCategory *pcat = gInventory.getCategory(category);
|
||||
|
|
@ -2136,8 +2132,9 @@ void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new,
|
|||
|
||||
// Collect and filter descendents to determine new COF contents.
|
||||
|
||||
// - Body parts: always include COF contents as a fallback in case any
|
||||
// required parts are missing.
|
||||
//
|
||||
// - Body parts: always include COF contents as a fallback in case any required parts are missing.
|
||||
//
|
||||
// Preserve body parts from COF if appending.
|
||||
LLInventoryModel::item_array_t body_items;
|
||||
getDescendentsOfAssetType(cof, body_items, LLAssetType::AT_BODYPART);
|
||||
|
|
@ -2155,7 +2152,9 @@ void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new,
|
|||
removeDuplicateItems(body_items);
|
||||
filterWearableItems(body_items, 1, 0);
|
||||
|
||||
//
|
||||
// - Wearables: include COF contents only if appending.
|
||||
//
|
||||
LLInventoryModel::item_array_t wear_items;
|
||||
if (append)
|
||||
getDescendentsOfAssetType(cof, wear_items, LLAssetType::AT_CLOTHING);
|
||||
|
|
@ -2181,7 +2180,9 @@ void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new,
|
|||
// [/SL:KB]
|
||||
filterWearableItems(wear_items, 0, LLAgentWearables::MAX_CLOTHING_LAYERS);
|
||||
|
||||
//
|
||||
// - Attachments: include COF contents only if appending.
|
||||
//
|
||||
LLInventoryModel::item_array_t obj_items;
|
||||
if (append)
|
||||
getDescendentsOfAssetType(cof, obj_items, LLAssetType::AT_OBJECT);
|
||||
|
|
@ -2215,7 +2216,9 @@ void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new,
|
|||
|
||||
removeDuplicateItems(obj_items);
|
||||
|
||||
//
|
||||
// - Gestures: include COF contents only if appending.
|
||||
//
|
||||
LLInventoryModel::item_array_t gest_items;
|
||||
if (append)
|
||||
getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE);
|
||||
|
|
@ -4215,7 +4218,7 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove, LLP
|
|||
return;
|
||||
}
|
||||
// [RLVa:KB] - Checked: 2013-02-12 (RLVa-1.4.8)
|
||||
// LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy;
|
||||
// LLPointer<LLInventoryCallback> cb = NULL;
|
||||
for (uuid_vec_t::const_iterator it = ids_to_remove.begin(); it != ids_to_remove.end(); ++it)
|
||||
{
|
||||
const LLUUID& id_to_remove = *it;
|
||||
|
|
|
|||
|
|
@ -95,9 +95,8 @@
|
|||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2013-02-12 (Catznip-3.4)
|
||||
#include "llappearancemgr.h"
|
||||
// [/SL:KB]
|
||||
// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.4.0)
|
||||
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g)
|
||||
#include "rlvactions.h"
|
||||
#include "rlvhelper.h"
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
|
|
@ -543,17 +542,13 @@ void idle_afk_check()
|
|||
{
|
||||
// check idle timers
|
||||
F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32();
|
||||
// F32 afk_timeout = gSavedSettings.getS32("AFKTimeout");
|
||||
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g
|
||||
#ifdef RLV_EXTENSION_CMD_ALLOWIDLE
|
||||
// Enforce an idle time of 30 minutes if @allowidle=n restricted
|
||||
// <FS:CR> Cache frequently hit location
|
||||
static LLCachedControl<S32> sAFKTimeout(gSavedSettings, "AFKTimeout");
|
||||
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g
|
||||
// Enforce an idle time of 30 minutes if @allowidle=n restricted
|
||||
S32 afk_timeout = (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) ? sAFKTimeout : 60 * 30;
|
||||
#else
|
||||
static LLCachedControl<S32> afk_timeout(gSavedSettings, "AFKTimeout"); // <FS:CR>
|
||||
#endif // RLV_EXTENSION_CMD_ALLOWIDLE
|
||||
// [/RLVa:KB]
|
||||
// F32 afk_timeout = gSavedSettings.getS32("AFKTimeout");
|
||||
// <FS:CR> Explicit conversions just cos.
|
||||
//if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK())
|
||||
if (static_cast<S32>(afk_timeout) && (current_idle > static_cast<F32>(afk_timeout)) && ! gAgent.getAFK())
|
||||
|
|
@ -3901,16 +3896,28 @@ LLSD LLAppViewer::getViewerInfo() const
|
|||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (region)
|
||||
{
|
||||
LLVector3d pos = gAgent.getPositionGlobal();
|
||||
info["POSITION"] = ll_sd_from_vector3d(pos);
|
||||
info["POSITION_LOCAL"] = ll_sd_from_vector3(gAgent.getPosAgentFromGlobal(pos));
|
||||
info["REGION"] = gAgent.getRegion()->getName();
|
||||
info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName();
|
||||
info["HOSTIP"] = gAgent.getRegion()->getHost().getString();
|
||||
// [RLVa:KB] - Checked: 2014-02-24 (RLVa-1.4.10)
|
||||
if (RlvActions::canShowLocation())
|
||||
{
|
||||
// [/RLVa:KB]
|
||||
LLVector3d pos = gAgent.getPositionGlobal();
|
||||
info["POSITION"] = ll_sd_from_vector3d(pos);
|
||||
info["POSITION_LOCAL"] = ll_sd_from_vector3(gAgent.getPosAgentFromGlobal(pos));
|
||||
info["REGION"] = gAgent.getRegion()->getName();
|
||||
info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName();
|
||||
info["HOSTIP"] = gAgent.getRegion()->getHost().getString();
|
||||
// info["SERVER_VERSION"] = gLastVersionChannel;
|
||||
LLSLURL slurl;
|
||||
LLAgentUI::buildSLURL(slurl);
|
||||
info["SLURL"] = slurl.getSLURLString();
|
||||
// [RLVa:KB] - Checked: 2014-02-24 (RLVa-1.4.10)
|
||||
}
|
||||
else
|
||||
{
|
||||
info["REGION"] = RlvStrings::getString(RLV_STRING_HIDDEN_REGION);
|
||||
}
|
||||
info["SERVER_VERSION"] = gLastVersionChannel;
|
||||
LLSLURL slurl;
|
||||
LLAgentUI::buildSLURL(slurl);
|
||||
info["SLURL"] = slurl.getSLURLString();
|
||||
// [/RLVa:KB]
|
||||
}
|
||||
|
||||
// CPU
|
||||
|
|
@ -3930,7 +3937,7 @@ LLSD LLAppViewer::getViewerInfo() const
|
|||
#endif
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.2.0)
|
||||
info["RLV_VERSION"] = (RlvActions::isRlvEnabled()) ? RlvStrings::getVersionAbout() : "(disabled)";
|
||||
info["RLV_VERSION"] = (rlv_handler_t::isEnabled()) ? RlvStrings::getVersionAbout() : "(disabled)";
|
||||
// [/RLVa:KB]
|
||||
info["OPENGL_VERSION"] = (const char*)(glGetString(GL_VERSION));
|
||||
info["LIBCURL_VERSION"] = LLCore::LLHttp::getCURLVersion();
|
||||
|
|
@ -4112,13 +4119,9 @@ std::string LLAppViewer::getViewerInfoString() const
|
|||
if (info.has("REGION"))
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2014-02-24 (RLVa-1.4.10)
|
||||
support << "\n\n";
|
||||
if (RlvActions::canShowLocation())
|
||||
support << LLTrans::getString("AboutPosition", args);
|
||||
else
|
||||
support << RlvStrings::getString(RLV_STRING_HIDDEN_REGION);
|
||||
support << "\n\n" << LLTrans::getString( (RlvActions::canShowLocation()) ? "AboutPosition" : "AboutPositionRLVShowLoc", args);
|
||||
// [/RLVa:KB]
|
||||
//support << "\n\n" << LLTrans::getString("AboutPosition", args);
|
||||
// support << "\n\n" << LLTrans::getString("AboutPosition", args);
|
||||
}
|
||||
support << "\n\n" << LLTrans::getString("AboutSystem", args);
|
||||
support << "\n";
|
||||
|
|
|
|||
|
|
@ -74,6 +74,11 @@
|
|||
#include "llsidepanelinventory.h"
|
||||
#include "llavatarname.h"
|
||||
#include "llagentui.h"
|
||||
// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0)
|
||||
#include "rlvactions.h"
|
||||
#include "rlvcommon.h"
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
// Firestorm includes
|
||||
#include "fsfloaterim.h"
|
||||
|
|
@ -91,9 +96,6 @@
|
|||
#include "llviewerparcelmgr.h"
|
||||
#include "llviewerwindow.h" // For opening logs externally
|
||||
#include "llworld.h"
|
||||
#include "rlvactions.h"
|
||||
#include "rlvcommon.h"
|
||||
#include "rlvhandler.h"
|
||||
|
||||
// Flags for kick message
|
||||
const U32 KICK_FLAGS_DEFAULT = 0x0;
|
||||
|
|
@ -243,7 +245,7 @@ void LLAvatarActions::startIM(const LLUUID& id)
|
|||
return;
|
||||
|
||||
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
|
||||
if ( (!RlvActions::canStartIM(id)) && (!RlvActions::hasOpenP2PSession(id)) )
|
||||
if (!RlvActions::canStartIM(id))
|
||||
{
|
||||
make_ui_sound("UISndInvalidOp");
|
||||
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", id, "completename").getSLURLString()));
|
||||
|
|
@ -288,7 +290,7 @@ void LLAvatarActions::startCall(const LLUUID& id)
|
|||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
|
||||
if ( (!RlvActions::canStartIM(id)) && (!RlvActions::hasOpenP2PSession(id)) )
|
||||
if (!RlvActions::canStartIM(id))
|
||||
{
|
||||
make_ui_sound("UISndInvalidOp");
|
||||
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", id, "completename").getSLURLString()));
|
||||
|
|
@ -556,6 +558,17 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const
|
|||
{
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
const LLUUID idRecipient = notification["substitutions"]["uuid"];
|
||||
std::string strMessage = response["message"];
|
||||
|
||||
// Filter the request message if the recipients is IM-blocked
|
||||
if ( (!RlvActions::isRlvEnabled()) || ((RlvActions::canStartIM(idRecipient)) && (RlvActions::canSendIM(idRecipient))) )
|
||||
{
|
||||
strMessage = RlvStrings::getString(RLV_STRING_HIDDEN);
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
|
|
@ -573,7 +586,10 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const
|
|||
LLAgentUI::buildFullname(name);
|
||||
|
||||
msg->addStringFast(_PREHASH_FromAgentName, name);
|
||||
msg->addStringFast(_PREHASH_Message, response["message"]);
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
msg->addStringFast(_PREHASH_Message, strMessage);
|
||||
// [/RLVa:KB]
|
||||
// msg->addStringFast(_PREHASH_Message, response["message"]);
|
||||
msg->addU32Fast(_PREHASH_ParentEstateID, 0);
|
||||
msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
|
||||
msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
|
||||
|
|
@ -601,14 +617,17 @@ void LLAvatarActions::teleportRequest(const LLUUID& id)
|
|||
|
||||
LLSD notification;
|
||||
notification["uuid"] = id;
|
||||
LLAvatarName av_name;
|
||||
if (!LLAvatarNameCache::get(id, &av_name))
|
||||
{
|
||||
// unlikely ... they just picked this name from somewhere...
|
||||
LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::teleportRequest, id));
|
||||
return; // reinvoke this when the name resolves
|
||||
}
|
||||
notification["NAME"] = av_name.getCompleteName();
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
notification["NAME"] = LLSLURL("agent", id, (RlvActions::canShowName(RlvActions::SNC_TELEPORTREQUEST)) ? "completename" : "rlvanonym").getSLURLString();
|
||||
// [/RLVa:KB]
|
||||
// LLAvatarName av_name;
|
||||
// if (!LLAvatarNameCache::get(id, &av_name))
|
||||
// {
|
||||
// // unlikely ... they just picked this name from somewhere...
|
||||
// LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::teleportRequest, id));
|
||||
// return; // reinvoke this when the name resolves
|
||||
// }
|
||||
// notification["NAME"] = av_name.getCompleteName();
|
||||
|
||||
LLSD payload;
|
||||
|
||||
|
|
|
|||
|
|
@ -642,10 +642,11 @@ protected:
|
|||
|
||||
void showInfoCtrl()
|
||||
{
|
||||
const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType;
|
||||
// const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType;
|
||||
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) | Added: RLVa-1.2.0f
|
||||
if (isVisible && mShowInfoCtrl)
|
||||
const bool isVisible = mShowInfoCtrl && !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType;
|
||||
// [/RLVa:KB]
|
||||
if (isVisible)
|
||||
{
|
||||
const LLRect sticky_rect = mUserNameTextBox->getRect();
|
||||
S32 icon_x = llmin(sticky_rect.mLeft + mUserNameTextBox->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3);
|
||||
|
|
|
|||
|
|
@ -118,6 +118,10 @@
|
|||
#include "llteleporthistorystorage.h"
|
||||
#include "llproxy.h"
|
||||
#include "llweb.h"
|
||||
// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a)
|
||||
#include "rlvactions.h"
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
#include "lllogininstance.h" // to check if logged in yet
|
||||
#include "llsdserialize.h"
|
||||
|
|
@ -147,8 +151,6 @@
|
|||
#include "llwaterparammanager.h"
|
||||
#include "llwldaycycle.h"
|
||||
#include "llwlparammanager.h"
|
||||
#include "rlvactions.h"
|
||||
#include "rlvhandler.h"
|
||||
#include "NACLantispam.h"
|
||||
#include "../llcrashlogger/llcrashlogger.h"
|
||||
|
||||
|
|
@ -2159,8 +2161,14 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()
|
|||
LLSliderCtrl* terrain_detail = getChild<LLSliderCtrl>("TerrainDetail"); // can be linked with control var
|
||||
LLTextBox* terrain_text = getChild<LLTextBox>("TerrainDetailText");
|
||||
|
||||
ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"));
|
||||
|
||||
// ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"));
|
||||
// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-0.2.0a
|
||||
// "Basic Shaders" can't be disabled - but can be enabled - under @setenv=n
|
||||
bool fCtrlShaderEnable = LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable");
|
||||
ctrl_shader_enable->setEnabled(
|
||||
fCtrlShaderEnable && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) || (!gSavedSettings.getBOOL("VertexShaderEnable"))) );
|
||||
// [/RLVa:KB]
|
||||
|
||||
BOOL shaders = ctrl_shader_enable->get();
|
||||
if (shaders)
|
||||
{
|
||||
|
|
@ -2181,7 +2189,13 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()
|
|||
|
||||
// *HACK just checks to see if we can use shaders...
|
||||
// maybe some cards that use shaders, but don't support windlight
|
||||
ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders);
|
||||
// ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders);
|
||||
// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-0.2.0a
|
||||
// "Atmospheric Shaders" can't be disabled - but can be enabled - under @setenv=n
|
||||
bool fCtrlWindLightEnable = fCtrlShaderEnable && shaders;
|
||||
ctrl_wind_light->setEnabled(
|
||||
fCtrlWindLightEnable && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) );
|
||||
// [/RLVa:KB]
|
||||
|
||||
sky->setEnabled(ctrl_wind_light->get() && shaders);
|
||||
sky_text->setEnabled(ctrl_wind_light->get() && shaders);
|
||||
|
|
|
|||
|
|
@ -41,6 +41,12 @@
|
|||
#include "llnotificationsutil.h"
|
||||
#include "llstatusbar.h" // can_afford_transaction()
|
||||
#include "groupchatlistener.h"
|
||||
// [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.3.0)
|
||||
#include "llslurl.h"
|
||||
#include "rlvactions.h"
|
||||
#include "rlvcommon.h"
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
// Firestorm includes
|
||||
#include "exogroupmutelist.h"
|
||||
|
|
@ -51,10 +57,6 @@
|
|||
#include "fsfloaterim.h"
|
||||
#include "llpanelgroup.h"
|
||||
#include "llresmgr.h"
|
||||
#include "llslurl.h"
|
||||
#include "rlvactions.h"
|
||||
#include "rlvcommon.h"
|
||||
#include "rlvhandler.h"
|
||||
|
||||
//
|
||||
// Globals
|
||||
|
|
@ -235,7 +237,7 @@ void LLGroupActions::startCall(const LLUUID& group_id)
|
|||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
|
||||
if ( (!RlvActions::canStartIM(group_id)) && (!RlvActions::hasOpenGroupSession(group_id)) )
|
||||
if (!RlvActions::canStartIM(group_id))
|
||||
{
|
||||
make_ui_sound("UISndInvalidOp");
|
||||
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("group", group_id, "about").getSLURLString()));
|
||||
|
|
@ -614,7 +616,7 @@ LLUUID LLGroupActions::startIM(const LLUUID& group_id)
|
|||
if (group_id.isNull()) return LLUUID::null;
|
||||
|
||||
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
|
||||
if ( (!RlvActions::canStartIM(group_id)) && (!RlvActions::hasOpenGroupSession(group_id)) )
|
||||
if (!RlvActions::canStartIM(group_id))
|
||||
{
|
||||
make_ui_sound("UISndInvalidOp");
|
||||
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("group", group_id, "about").getSLURLString()));
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ bool LLAlertHandler::processNotification(const LLNotificationPtr& notification)
|
|||
// - LLHandlerUtil::logToIMP2P() below will still be called with to_file_only == false
|
||||
// - LLHandlerUtil::logToIM() will eventually be called as a result and without an open IM session it will log the
|
||||
// same message as it would for an open session whereas to_file_only == true would take a different code path
|
||||
if ( (RlvActions::hasOpenP2PSession(from_id)) || (RlvActions::canStartIM(from_id)) )
|
||||
if (RlvActions::canStartIM(from_id))
|
||||
{
|
||||
// [/RLVa:KB]
|
||||
// firstly create session...
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification)
|
|||
|
||||
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
|
||||
// Don't spawn an IM session for non-chat related events
|
||||
if ( (RlvActions::hasOpenP2PSession(from_id)) || (RlvActions::canStartIM(from_id)) )
|
||||
if (RlvActions::canStartIM(from_id))
|
||||
{
|
||||
// [/RLVa:KB]
|
||||
LLHandlerUtil::spawnIMSession(name, from_id);
|
||||
|
|
|
|||
|
|
@ -772,6 +772,18 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
|||
// [/RLVa:KB]
|
||||
}
|
||||
items.push_back(std::string("Task Properties"));
|
||||
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Added: RLVa-1.2.1f
|
||||
items.push_back(std::string("Task Rename"));
|
||||
if ( (!isItemRenameable()) || ((flags & FIRST_SELECTED_ITEM) == 0) )
|
||||
{
|
||||
disabled_items.push_back(std::string("Task Rename"));
|
||||
}
|
||||
items.push_back(std::string("Task Remove"));
|
||||
if (!isItemRemovable())
|
||||
{
|
||||
disabled_items.push_back(std::string("Task Remove"));
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
// if(isItemRenameable())
|
||||
// {
|
||||
// items.push_back(std::string("Task Rename"));
|
||||
|
|
@ -784,18 +796,6 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
|||
// {
|
||||
// items.push_back(std::string("Task Remove"));
|
||||
// }
|
||||
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Added: RLVa-1.2.1f
|
||||
items.push_back(std::string("Task Rename"));
|
||||
items.push_back(std::string("Task Remove"));
|
||||
if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0)
|
||||
{
|
||||
disabled_items.push_back(std::string("Task Rename"));
|
||||
}
|
||||
if (!isItemRemovable())
|
||||
{
|
||||
disabled_items.push_back(std::string("Task Remove"));
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
hide_context_entries(menu, items, disabled_items);
|
||||
}
|
||||
|
|
@ -1294,6 +1294,7 @@ void LLTaskNotecardBridge::openItem()
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0b
|
||||
if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,6 +75,10 @@
|
|||
#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]
|
||||
|
||||
|
||||
// Firestorm includes
|
||||
#include "fscommon.h"
|
||||
|
|
@ -82,7 +86,6 @@
|
|||
#include "lggcontactsets.h"
|
||||
#include "llcombobox.h"
|
||||
#include "lllayoutstack.h"
|
||||
#include "rlvhandler.h"
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
|
|
@ -1074,6 +1077,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)) )
|
||||
{
|
||||
item_selected = multiple_selected = false;
|
||||
}
|
||||
// [/RLBa:KB]
|
||||
}
|
||||
|
||||
std::string LLPanelPeople::getActiveTabName() const
|
||||
|
|
@ -1308,6 +1318,13 @@ 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)
|
||||
{
|
||||
|
|
@ -1434,6 +1451,13 @@ 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);
|
||||
if ( selected_uuids.size() == 1 )
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@ public:
|
|||
|
||||
bool mTryToConnectToFacebook;
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
|
||||
LLAvatarList* getNearbyList() { return mNearbyList; }
|
||||
// [/RLVa:KB]
|
||||
|
||||
// internals
|
||||
class Updater;
|
||||
|
||||
|
|
|
|||
|
|
@ -466,13 +466,13 @@ void LLPanelPermissions::refresh()
|
|||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||
{
|
||||
// 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))) )
|
||||
// creator_name = LLSLURL("agent", mCreatorID, "rlvanonym").getSLURLString();
|
||||
if ( (creators_identical) && (mCreatorID != gAgent.getID()) && ((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()) )
|
||||
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
|
||||
if ( (last_owners_identical) && (mLastOwnerID != gAgent.getID()) )
|
||||
last_owner_name = LLSLURL("agent", mLastOwnerID, "rlvanonym").getSLURLString();
|
||||
|
|
|
|||
|
|
@ -4394,7 +4394,7 @@ void LLSelectMgr::convertTransient()
|
|||
|
||||
void LLSelectMgr::deselectAllIfTooFar()
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c
|
||||
// [RLVa:KB] - Checked: RLVa-1.3.0
|
||||
if ( (!mSelectedObjects->isEmpty()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ))) )
|
||||
{
|
||||
struct NotTransientOrFocusedMediaOrEditable : public LLSelectedNodeFunctor
|
||||
|
|
@ -4402,8 +4402,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) && (!gRlvHandler.canEdit(pObj)) && (pObj->getID() != LLViewerMediaFocus::getInstance()->getFocusedObjectID());
|
||||
}
|
||||
} f;
|
||||
if (mSelectedObjects->getFirstRootNode(&f, TRUE))
|
||||
|
|
@ -4416,15 +4415,13 @@ void LLSelectMgr::deselectAllIfTooFar()
|
|||
return;
|
||||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.1.0l
|
||||
#ifdef RLV_EXTENSION_CMD_INTERACT
|
||||
// [Fall-back code] Don't allow an active selection (except for HUD attachments - see above) when @interact=n restricted
|
||||
// [RLVa:KB] - Checked: RLVa-1.2.0
|
||||
// [Fall-back code] Don't allow an active selection (except for HUD attachments - see above) when @interact restricted
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT))
|
||||
{
|
||||
deselectAll();
|
||||
return;
|
||||
}
|
||||
#endif // RLV_EXTENSION_CMD_INTERACT
|
||||
// [/RLVa:KB]
|
||||
|
||||
// HACK: Don't deselect when we're navigating to rate an object's
|
||||
|
|
|
|||
|
|
@ -192,6 +192,10 @@
|
|||
#include "llvoicechannel.h"
|
||||
#include "llpathfindingmanager.h"
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a)
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
#include "lllogin.h"
|
||||
#include "llevents.h"
|
||||
#include "llstartuplistener.h"
|
||||
|
|
@ -232,7 +236,6 @@
|
|||
#include "llprogressview.h"
|
||||
#include "lltoolbarview.h"
|
||||
#include "NACLantispam.h"
|
||||
#include "rlvhandler.h"
|
||||
#include "streamtitledisplay.h"
|
||||
#include "tea.h"
|
||||
|
||||
|
|
@ -1366,11 +1369,7 @@ bool idle_startup()
|
|||
// All accounts have both a home and a last location, and we don't support
|
||||
// more locations than that. Choose the appropriate one. JC
|
||||
// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d
|
||||
#ifndef RLV_EXTENSION_STARTLOCATION
|
||||
if (rlv_handler_t::isEnabled())
|
||||
#else
|
||||
if ( (rlv_handler_t::isEnabled()) && (RlvSettings::getLoginLastLocation()) )
|
||||
#endif // RLV_EXTENSION_STARTLOCATION
|
||||
{
|
||||
// Force login at the last location
|
||||
LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST));
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@
|
|||
// </FS:CR>
|
||||
|
||||
#include "fssearchableui.h"
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
|
|
|
|||
|
|
@ -609,6 +609,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
|
|||
}
|
||||
// [/RLVa:KB]
|
||||
LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace);
|
||||
|
||||
if (object)
|
||||
{
|
||||
parent = object->getRootEdit();
|
||||
|
|
@ -1488,7 +1489,15 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask)
|
|||
// [/RLVa:KB]
|
||||
|
||||
LLViewerObject* hover_object = mHoverPick.getObject();
|
||||
|
||||
|
||||
// [RLVa:KB] - Checked: RLVa-1.2.0
|
||||
// NOTE: handleTooltipObject() will block HUD tooltips anyway but technically interact should only interfere with world interaction
|
||||
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (hover_object) && (!hover_object->isHUDAttachment()) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
// update hover object and hover parcel
|
||||
LLSelectMgr::getInstance()->setHoverObject(hover_object, mHoverPick.mObjectFace);
|
||||
|
||||
|
|
|
|||
|
|
@ -78,6 +78,9 @@
|
|||
#include "llslurl.h"
|
||||
#include "llstartup.h"
|
||||
#include "llupdaterservice.h"
|
||||
// [RLVa:KB] - Checked: 2015-12-27 (RLVa-1.5.0)
|
||||
#include "rlvcommon.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
// Firestorm inclues
|
||||
#include "fsfloatercontacts.h"
|
||||
|
|
@ -1050,6 +1053,9 @@ void settings_setup_listeners()
|
|||
gSavedSettings.getControl("SpellCheck")->getSignal()->connect(boost::bind(&handleSpellCheckChanged));
|
||||
gSavedSettings.getControl("SpellCheckDictionary")->getSignal()->connect(boost::bind(&handleSpellCheckChanged));
|
||||
gSavedSettings.getControl("LoginLocation")->getSignal()->connect(boost::bind(&handleLoginLocationChanged));
|
||||
// [RLVa:KB] - Checked: 2015-12-27 (RLVa-1.5.0)
|
||||
gSavedSettings.getControl("RestrainedLove")->getSignal()->connect(boost::bind(&RlvSettings::onChangedSettingMain, _2));
|
||||
// [/RLVa:KB]
|
||||
gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getSignal()->connect(boost::bind(&handleAvatarZOffsetChanged, _2)); // <FS:Zi> Moved Avatar Z offset from RLVa to here
|
||||
// <FS:Zi> Is done inside XUI now, using visibility_control
|
||||
// gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2));
|
||||
|
|
|
|||
|
|
@ -200,7 +200,6 @@
|
|||
#include "NACLfloaterexploresounds.h"
|
||||
#include "particleeditor.h"
|
||||
#include "quickprefs.h"
|
||||
|
||||
// handle secondlife:///app/openfloater/{NAME} URLs
|
||||
class LLFloaterOpenHandler : public LLCommandHandler
|
||||
{
|
||||
|
|
@ -385,6 +384,7 @@ void LLViewerFloaterReg::registerFloaters()
|
|||
LLFloaterReg::add("region_restarting", "floater_region_restarting.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRegionRestarting>);
|
||||
// [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0a
|
||||
LLFloaterReg::add("rlv_behaviours", "floater_rlv_behaviours.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<RlvFloaterBehaviours>);
|
||||
LLFloaterReg::add("rlv_console", "floater_rlv_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<RlvFloaterConsole>);
|
||||
LLFloaterReg::add("rlv_locks", "floater_rlv_locks.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<RlvFloaterLocks>);
|
||||
LLFloaterReg::add("rlv_strings", "floater_rlv_strings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<RlvFloaterStrings>);
|
||||
// [/RLVa:KB]
|
||||
|
|
|
|||
|
|
@ -122,6 +122,10 @@ void agent_push_down( EKeystate s )
|
|||
|
||||
static void agent_check_temporary_run(LLAgent::EDoubleTapRunMode mode)
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i
|
||||
if ( (gAgent.mDoubleTapRunMode == mode) && (gAgent.getTempRun()) )
|
||||
gAgent.clearTempRun();
|
||||
// [/RLVa:KB]
|
||||
// if (gAgent.mDoubleTapRunMode == mode &&
|
||||
// gAgent.getRunning() &&
|
||||
// !gAgent.getAlwaysRun())
|
||||
|
|
@ -130,10 +134,6 @@ static void agent_check_temporary_run(LLAgent::EDoubleTapRunMode mode)
|
|||
// gAgent.clearRunning();
|
||||
// gAgent.sendWalkRun(gAgent.getRunning());
|
||||
// }
|
||||
// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i
|
||||
if ( (gAgent.mDoubleTapRunMode == mode) && (gAgent.getTempRun()) )
|
||||
gAgent.clearTempRun();
|
||||
// [/RLVa:KB]
|
||||
}
|
||||
|
||||
static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode mode)
|
||||
|
|
|
|||
|
|
@ -134,13 +134,13 @@
|
|||
#include "llpathfindingmanager.h"
|
||||
#include "llstartup.h"
|
||||
#include "boost/unordered_map.hpp"
|
||||
|
||||
// Firestorm includes
|
||||
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a)
|
||||
#include "rlvactions.h"
|
||||
#include "rlvhandler.h"
|
||||
#include "rlvlocks.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
// Firestorm includes
|
||||
#include "fsdata.h"
|
||||
#include "fslslbridge.h"
|
||||
#include "fscommon.h"
|
||||
|
|
@ -11333,7 +11333,10 @@ void initialize_menus()
|
|||
|
||||
// [RLVa:KB] - Checked: 2010-04-23 (RLVa-1.2.0g) | Added: RLVa-1.2.0
|
||||
enable.add("RLV.MainToggleVisible", boost::bind(&rlvMenuMainToggleVisible, _1));
|
||||
enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2));
|
||||
if (rlv_handler_t::isEnabled())
|
||||
{
|
||||
enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2));
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
// <FS:Ansariel> Toggle internal web browser
|
||||
|
|
|
|||
|
|
@ -119,6 +119,12 @@
|
|||
#include "llpanelplaceprofile.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llfloaterregionrestarting.h"
|
||||
// [RLVa:KB] - Checked: 2010-03-09 (RLVa-1.2.0a)
|
||||
#include "rlvactions.h"
|
||||
#include "rlvhandler.h"
|
||||
#include "rlvinventory.h"
|
||||
#include "rlvui.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
#include <boost/algorithm/string/split.hpp> //
|
||||
#include <boost/regex.hpp>
|
||||
|
|
@ -147,10 +153,6 @@
|
|||
#include "llgiveinventory.h"
|
||||
#include "lllandmarkactions.h"
|
||||
#include "lltexturefetch.h"
|
||||
#include "rlvactions.h"
|
||||
#include "rlvhandler.h"
|
||||
#include "rlvinventory.h"
|
||||
#include "rlvui.h"
|
||||
#include "sound_ids.h"
|
||||
#include "tea.h" // <FS:AW opensim currency support>
|
||||
#include "NACLantispam.h"
|
||||
|
|
@ -3811,7 +3813,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||
case IM_LURE_USER:
|
||||
case IM_TELEPORT_REQUEST:
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2013-11-08 (RLVa-1.4.9)
|
||||
// [RLVa:KB] - Checked: RLVa-1.4.9
|
||||
// If we auto-accept the offer/request then this will override DnD status (but we'll still let the other party know later)
|
||||
bool fRlvAutoAccept = (rlv_handler_t::isEnabled()) &&
|
||||
( ((IM_LURE_USER == dialog) && (RlvActions::autoAcceptTeleportOffer(from_id))) ||
|
||||
|
|
@ -3823,7 +3825,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||
return;
|
||||
}
|
||||
// else if (is_do_not_disturb)
|
||||
// [RLVa:KB] - Checked: 2013-11-08 (RLVa-1.4.9)
|
||||
// [RLVa:KB] - Checked: RLVa-1.4.9
|
||||
else if ( (is_do_not_disturb) && (!fRlvAutoAccept) )
|
||||
// [/RLVa:KB]
|
||||
{
|
||||
|
|
@ -3894,7 +3896,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||
}
|
||||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2013-11-08 (RLVa-1.4.9)
|
||||
// [RLVa:KB] - Checked: RLVa-1.4.9
|
||||
if (rlv_handler_t::isEnabled())
|
||||
{
|
||||
if ( ((IM_LURE_USER == dialog) && (!RlvActions::canAcceptTpOffer(from_id))) ||
|
||||
|
|
@ -3906,8 +3908,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||
return;
|
||||
}
|
||||
|
||||
// Censor lure message if: 1) restricted from receiving IMs from the sender, or 2) teleport offer and @showloc=n restricted
|
||||
if ( (!RlvActions::canReceiveIM(from_id)) || ((IM_LURE_USER == dialog) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))) )
|
||||
// Censor message if: 1) restricted from receiving IMs from the sender, or 2) teleport offer/request and @showloc=n restricted
|
||||
if ( (!RlvActions::canReceiveIM(from_id)) ||
|
||||
((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (IM_LURE_USER == dialog || IM_TELEPORT_REQUEST == dialog)) )
|
||||
{
|
||||
message = RlvStrings::getString(RLV_STRING_HIDDEN);
|
||||
}
|
||||
|
|
@ -3973,8 +3976,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||
params.substitutions = args;
|
||||
params.payload = payload;
|
||||
|
||||
// [RLVa:KB] - Checked: 20103-11-08 (RLVa-1.4.9)
|
||||
if ( (rlv_handler_t::isEnabled()) && (fRlvAutoAccept) )
|
||||
// [RLVa:KB] - Checked: RLVa-1.4.9
|
||||
if (fRlvAutoAccept)
|
||||
{
|
||||
if (IM_LURE_USER == dialog)
|
||||
gRlvHandler.setCanCancelTp(false);
|
||||
|
|
@ -7864,13 +7867,13 @@ 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()) )
|
||||
{
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
|
||||
RlvUtil::filterLocation(new_msg);
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||
RlvUtil::filterNames(new_msg);
|
||||
}
|
||||
if ( (new_msg == text) && (rlv_handler_t::isEnabled()) )
|
||||
{
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
|
||||
RlvUtil::filterLocation(new_msg);
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||
RlvUtil::filterNames(new_msg);
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
args["MESSAGE"] = new_msg;
|
||||
LLNotificationsUtil::add("SystemMessage", args);
|
||||
|
|
@ -8943,20 +8946,14 @@ void send_lures(const LLSD& notification, const LLSD& response)
|
|||
LLAgentUI::buildSLURL(slurl);
|
||||
text.append("\r\n").append(slurl.getSLURLString());
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0)
|
||||
if ( (RlvActions::hasBehaviour(RLV_BHVR_SENDIM)) || (RlvActions::hasBehaviour(RLV_BHVR_SENDIMTO)) )
|
||||
{
|
||||
// Filter the lure message if one of the recipients of the lure can't be sent an IM to
|
||||
for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray();
|
||||
it != notification["payload"]["ids"].endArray(); ++it)
|
||||
{
|
||||
if (!RlvActions::canSendIM(it->asUUID()))
|
||||
{
|
||||
text = RlvStrings::getString(RLV_STRING_HIDDEN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
// Filter the lure message if any of the recipients are IM-blocked
|
||||
const LLSD& sdRecipients = notification["payload"]["ids"];
|
||||
if ( (gRlvHandler.isEnabled()) &&
|
||||
(std::any_of(sdRecipients.beginArray(), sdRecipients.endArray(), [](const LLSD& id) { return !RlvActions::canStartIM(id.asUUID()) || !RlvActions::canSendIM(id.asUUID()); })) )
|
||||
{
|
||||
text = RlvStrings::getString(RLV_STRING_HIDDEN);
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
|
|
@ -8978,12 +8975,18 @@ 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]
|
||||
// <FS:Ansariel> Show complete name for TP lures
|
||||
//std::string target_name;
|
||||
//gCacheName->getFullName(target_id, target_name); // for im log filenames
|
||||
LLSD args;
|
||||
//args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();;
|
||||
args["TO_NAME"] = LLSLURL("agent", target_id, "completename").getSLURLString();
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
args["TO_NAME"] = LLSLURL("agent", target_id, (!fRlvHideName) ? "completename" : "rlvanonym").getSLURLString();;
|
||||
// [/RLVa:KB]
|
||||
// args["TO_NAME"] = LLSLURL("agent", target_id, "completename").getSLURLString();
|
||||
// </FS:Ansariel>
|
||||
|
||||
LLSD payload;
|
||||
|
|
@ -8994,7 +8997,11 @@ void send_lures(const LLSD& notification, const LLSD& response)
|
|||
LLNotificationsUtil::add("TeleportOfferSent", args, payload);
|
||||
|
||||
// Add the recepient to the recent people list.
|
||||
LLRecentPeople::instance().add(target_id);
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
if (!fRlvHideName)
|
||||
LLRecentPeople::instance().add(target_id);
|
||||
// [/RLVa:KB]
|
||||
// LLRecentPeople::instance().add(target_id);
|
||||
}
|
||||
}
|
||||
gAgent.sendReliableMessage();
|
||||
|
|
@ -9040,8 +9047,7 @@ void handle_lure(const uuid_vec_t& ids)
|
|||
|
||||
LLSD edit_args;
|
||||
// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0a
|
||||
edit_args["REGION"] =
|
||||
(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN);
|
||||
edit_args["REGION"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN);
|
||||
// [/RLVa:KB]
|
||||
// edit_args["REGION"] = gAgent.getRegion()->getName();
|
||||
|
||||
|
|
@ -9061,6 +9067,7 @@ void handle_lure(const uuid_vec_t& ids)
|
|||
return;
|
||||
}
|
||||
}
|
||||
payload["rlv_shownames"] = !RlvActions::canShowName(RlvActions::SNC_TELEPORTOFFER);
|
||||
// [/RLVa:KB]
|
||||
payload["ids"].append(*it);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4496,8 +4496,7 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de
|
|||
}
|
||||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l
|
||||
#ifdef RLV_EXTENSION_CMD_INTERACT
|
||||
// [RLVa:KB] - Checked: RLVa-1.2.0
|
||||
if ( (rlv_handler_t::isEnabled()) && (found) && (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) )
|
||||
{
|
||||
// Allow picking if:
|
||||
|
|
@ -4506,14 +4505,13 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de
|
|||
// - the pie tool is active *and* we picked our own avie (allows "mouse steering" and the self pie menu)
|
||||
LLTool* pCurTool = LLToolMgr::getInstance()->getCurrentTool();
|
||||
if ( (LLToolDragAndDrop::getInstance() != pCurTool) &&
|
||||
(!LLToolCamera::getInstance()->hasMouseCapture()) &&
|
||||
((LLToolPie::getInstance() != pCurTool) || (gAgent.getID() != found->getID())) )
|
||||
(!LLToolCamera::getInstance()->hasMouseCapture()) &&
|
||||
((LLToolPie::getInstance() != pCurTool) || (gAgent.getID() != found->getID())) )
|
||||
{
|
||||
found = NULL;
|
||||
}
|
||||
#endif // RLV_EXTENSION_CMD_INTERACT
|
||||
// [/RLVa:KB]
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
}
|
||||
|
||||
return found;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@
|
|||
#include "lltoolbarview.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llvoavatar.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "llwaterparammanager.h"
|
||||
#include "llwlparamset.h"
|
||||
#include "llwlparammanager.h"
|
||||
|
|
|
|||
|
|
@ -15,9 +15,11 @@
|
|||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include "llagent.h"
|
||||
#include "llimview.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "rlvactions.h"
|
||||
#include "rlvhelper.h"
|
||||
#include "rlvhandler.h"
|
||||
|
||||
// ============================================================================
|
||||
|
|
@ -50,57 +52,81 @@ bool RlvActions::canSendIM(const LLUUID& idRecipient)
|
|||
( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIMTO)) || (!gRlvHandler.isException(RLV_BHVR_SENDIMTO, idRecipient)) ) );
|
||||
}
|
||||
|
||||
// Checked: 2011-04-12 (RLVa-1.3.0)
|
||||
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 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)) ) &&
|
||||
( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIMTO)) || (!gRlvHandler.isException(RLV_BHVR_STARTIMTO, idRecipient)) ) );
|
||||
( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIMTO)) || (!gRlvHandler.isException(RLV_BHVR_STARTIMTO, idRecipient)) ) ) ||
|
||||
( (hasOpenP2PSession(idRecipient)) || (hasOpenGroupSession(idRecipient)) );
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Movement
|
||||
//
|
||||
|
||||
// Checked: 2010-12-11 (RLVa-1.2.2)
|
||||
bool RlvActions::canAcceptTpOffer(const LLUUID& idSender)
|
||||
{
|
||||
return ((!gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) || (gRlvHandler.isException(RLV_BHVR_TPLURE, idSender))) && (canStand());
|
||||
}
|
||||
|
||||
// Checked: 2013-11-08 (RLVa-1.4.9)
|
||||
bool RlvActions::autoAcceptTeleportOffer(const LLUUID& idSender)
|
||||
{
|
||||
return ((idSender.notNull()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, idSender))) || (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP));
|
||||
}
|
||||
|
||||
// Checked: 2013-11-08 (RLVa-1.4.9)
|
||||
bool RlvActions::canAcceptTpRequest(const LLUUID& idSender)
|
||||
{
|
||||
return (!gRlvHandler.hasBehaviour(RLV_BHVR_TPREQUEST)) || (gRlvHandler.isException(RLV_BHVR_TPREQUEST, idSender));
|
||||
}
|
||||
|
||||
// Checked: 2013-11-08 (RLVa-1.4.9)
|
||||
bool RlvActions::autoAcceptTeleportRequest(const LLUUID& idRequester)
|
||||
{
|
||||
return ((idRequester.notNull()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTPREQUEST, idRequester))) || (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTPREQUEST));
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// World interaction
|
||||
//
|
||||
// Teleporting
|
||||
//
|
||||
|
||||
bool RlvActions::canTeleportToLocal()
|
||||
{
|
||||
return (!gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_TPLOCAL)) && (RlvActions::canStand());
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// World interaction
|
||||
//
|
||||
|
||||
// Checked: 2010-03-07 (RLVa-1.2.0)
|
||||
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
|
||||
return (!gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || ((isAgentAvatarValid()) && (!gAgentAvatarp->isSitting()));
|
||||
}
|
||||
|
||||
bool RlvActions::canStand(const LLUUID& idRlvObjExcept)
|
||||
{
|
||||
// NOTE: must match generic function above
|
||||
return (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_UNSIT, idRlvObjExcept)) || ((isAgentAvatarValid()) && (!gAgentAvatarp->isSitting()));
|
||||
}
|
||||
|
||||
// Checked: 2014-02-24 (RLVa-1.4.10)
|
||||
bool RlvActions::canShowLocation()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ public:
|
|||
static bool canSendIM(const LLUUID& idRecipient);
|
||||
|
||||
/*
|
||||
* Returns true if the user is allowed to start a - P2P or group - conversation with the specified UUID.
|
||||
* Returns true if the user is allowed to start a - P2P or group - conversation with the specified UUID (or if the session already exists)
|
||||
*/
|
||||
static bool canStartIM(const LLUUID& idRecipient); // @startim and @startimto
|
||||
static bool canStartIM(const LLUUID& idRecipient);
|
||||
|
||||
/*
|
||||
* Returns true if an avatar's name should be hidden for the requested operation/context
|
||||
|
|
@ -83,6 +83,25 @@ public:
|
|||
*/
|
||||
static bool autoAcceptTeleportRequest(const LLUUID& idRequester);
|
||||
|
||||
// ===========
|
||||
// Teleporting
|
||||
// ===========
|
||||
public:
|
||||
/*
|
||||
* Returns true if the user can teleport locally (short distances)
|
||||
*/
|
||||
static bool canTeleportToLocal();
|
||||
|
||||
/*
|
||||
* Returns true if the user can teleport to a (remote) location
|
||||
*/
|
||||
static bool canTeleportToLocation();
|
||||
|
||||
/*
|
||||
* Returns true if the teleport is considered local (e.g. double-click tp)
|
||||
*/
|
||||
static bool isLocalTp(const LLVector3d& posGlobal);
|
||||
|
||||
// =================
|
||||
// World interaction
|
||||
// =================
|
||||
|
|
@ -91,6 +110,7 @@ public:
|
|||
* Returns true if the user can stand up (returns true if the user isn't currently sitting)
|
||||
*/
|
||||
static bool canStand();
|
||||
static bool canStand(const LLUUID& idRlvObjExcept);
|
||||
|
||||
/*
|
||||
* Returns true if the user can see their in-world location
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
#include "rlvhandler.h"
|
||||
#include "rlvlocks.h"
|
||||
|
||||
#include "lscript_byteformat.h"
|
||||
#include "llscriptruntimeperms.h"
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
// ============================================================================
|
||||
|
|
@ -96,11 +96,9 @@ void RlvSettings::initClass()
|
|||
if (gSavedSettings.controlExists(RLV_SETTING_SHOWNAMETAGS))
|
||||
gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fShowNameTags));
|
||||
|
||||
#ifdef RLV_EXTENSION_STARTLOCATION
|
||||
// Don't allow toggling RLVaLoginLastLocation from the debug settings floater
|
||||
if (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION))
|
||||
gSavedPerAccountSettings.getControl(RLV_SETTING_LOGINLASTLOCATION)->setHiddenFromSettingsEditor(true);
|
||||
#endif // RLV_EXTENSION_STARTLOCATION
|
||||
|
||||
if (gSavedSettings.controlExists(RLV_SETTING_TOPLEVELMENU))
|
||||
gSavedSettings.getControl(RLV_SETTING_TOPLEVELMENU)->getSignal()->connect(boost::bind(&onChangedMenuLevel));
|
||||
|
|
@ -109,21 +107,19 @@ void RlvSettings::initClass()
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef RLV_EXTENSION_STARTLOCATION
|
||||
// Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d
|
||||
void RlvSettings::updateLoginLastLocation()
|
||||
// Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d
|
||||
void RlvSettings::updateLoginLastLocation()
|
||||
{
|
||||
if ( (!LLApp::isQuitting()) && (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) )
|
||||
{
|
||||
if ( (!LLApp::isQuitting()) && (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) )
|
||||
BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || (!RlvActions::canStand());
|
||||
if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue)
|
||||
{
|
||||
BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || (!RlvActions::canStand());
|
||||
if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue)
|
||||
{
|
||||
gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue);
|
||||
gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE);
|
||||
}
|
||||
gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue);
|
||||
gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE);
|
||||
}
|
||||
}
|
||||
#endif // RLV_EXTENSION_STARTLOCATION
|
||||
}
|
||||
|
||||
// Checked: 2011-08-16 (RLVa-1.4.0b) | Added: RLVa-1.4.0b
|
||||
bool RlvSettings::onChangedMenuLevel()
|
||||
|
|
@ -416,19 +412,19 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy)
|
|||
void RlvUtil::filterScriptQuestions(S32& nQuestions, LLSD& sdPayload)
|
||||
{
|
||||
// Check SCRIPT_PERMISSION_ATTACH
|
||||
if ( (!gRlvAttachmentLocks.canAttach()) && (LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH] & nQuestions) )
|
||||
if ( (!gRlvAttachmentLocks.canAttach()) && (SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_ATTACH].permbit & nQuestions) )
|
||||
{
|
||||
// Notify the user that we blocked it since they're not allowed to wear any new attachments
|
||||
sdPayload["rlv_blocked"] = RLV_STRING_BLOCKED_PERMATTACH;
|
||||
nQuestions &= ~LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH];
|
||||
nQuestions &= ~SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_ATTACH].permbit;
|
||||
}
|
||||
|
||||
// Check SCRIPT_PERMISSION_TELEPORT
|
||||
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) && (LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TELEPORT] & nQuestions) )
|
||||
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) && (SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_TELEPORT].permbit & nQuestions) )
|
||||
{
|
||||
// Notify the user that we blocked it since they're not allowed to teleport
|
||||
sdPayload["rlv_blocked"] = RLV_STRING_BLOCKED_PERMTELEPORT;
|
||||
nQuestions &= ~LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TELEPORT];
|
||||
nQuestions &= ~SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_TELEPORT].permbit;
|
||||
}
|
||||
|
||||
sdPayload["questions"] = nQuestions;
|
||||
|
|
@ -585,7 +581,7 @@ bool rlvMenuEnableIfNot(const LLSD& sdParam)
|
|||
bool fEnable = true;
|
||||
if (rlv_handler_t::isEnabled())
|
||||
{
|
||||
ERlvBehaviour eBhvr = RlvCommand::getBehaviourFromString(sdParam.asString());
|
||||
ERlvBehaviour eBhvr = RlvBehaviourDictionary::instance().getBehaviourFromString(sdParam.asString(), RLV_TYPE_ADDREM);
|
||||
fEnable = (eBhvr != RLV_BHVR_UNKNOWN) ? !gRlvHandler.hasBehaviour(eBhvr) : true;
|
||||
}
|
||||
return fEnable;
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ class RlvObject;
|
|||
|
||||
struct RlvException;
|
||||
typedef boost::variant<std::string, LLUUID, S32, ERlvBehaviour> RlvExceptionOption;
|
||||
typedef boost::variant<int, float> RlvBehaviourModifierValue;
|
||||
|
||||
class RlvGCTimer;
|
||||
|
||||
|
|
@ -98,10 +99,8 @@ public:
|
|||
static bool getSharedInvAutoRename() { return rlvGetSetting<bool>(RLV_SETTING_SHAREDINVAUTORENAME, true); }
|
||||
static bool getShowNameTags() { return fShowNameTags; }
|
||||
|
||||
#ifdef RLV_EXTENSION_STARTLOCATION
|
||||
static bool getLoginLastLocation() { return rlvGetPerUserSetting<bool>(RLV_SETTING_LOGINLASTLOCATION, true); }
|
||||
static void updateLoginLastLocation();
|
||||
#endif // RLV_EXTENSION_STARTLOCATION
|
||||
|
||||
static void initClass();
|
||||
static void onChangedSettingMain(const LLSD& sdValue);
|
||||
|
|
@ -171,7 +170,7 @@ public:
|
|||
static void notifyFailedAssertion(const std::string& strAssert, const std::string& strFile, int nLine);
|
||||
|
||||
static void sendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLUUID& idSession = LLUUID::null);
|
||||
static bool isValidReplyChannel(S32 nChannel);
|
||||
static bool isValidReplyChannel(S32 nChannel, bool fLoopback = false);
|
||||
static bool sendChatReply(S32 nChannel, const std::string& strUTF8Text);
|
||||
static bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text);
|
||||
|
||||
|
|
@ -183,16 +182,16 @@ protected:
|
|||
// Extensibility classes
|
||||
//
|
||||
|
||||
class RlvCommandHandler
|
||||
class RlvExtCommandHandler
|
||||
{
|
||||
public:
|
||||
virtual ~RlvCommandHandler() {}
|
||||
virtual ~RlvExtCommandHandler() {}
|
||||
virtual bool onAddRemCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; }
|
||||
virtual bool onClearCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; }
|
||||
virtual bool onReplyCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; }
|
||||
virtual bool onForceCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; }
|
||||
};
|
||||
typedef bool (RlvCommandHandler::*rlvCommandHandler)(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet);
|
||||
typedef bool (RlvExtCommandHandler::*rlvExtCommandHandler)(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet);
|
||||
|
||||
// ============================================================================
|
||||
// Generic menu enablers
|
||||
|
|
@ -301,9 +300,9 @@ inline bool RlvUtil::isEmote(const std::string& strUTF8Text)
|
|||
}
|
||||
|
||||
// Checked: 2010-03-09 (RLVa-1.2.0b) | Added: RLVa-1.0.2a
|
||||
inline bool RlvUtil::isValidReplyChannel(S32 nChannel)
|
||||
inline bool RlvUtil::isValidReplyChannel(S32 nChannel, bool fLoopback /*=false*/)
|
||||
{
|
||||
return (nChannel > 0) && (CHAT_CHANNEL_DEBUG != nChannel);
|
||||
return (nChannel > ((!fLoopback) ? 0 : -1)) && (CHAT_CHANNEL_DEBUG != nChannel);
|
||||
}
|
||||
|
||||
// Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright (c) 2009-2011, Kitty Barnett
|
||||
* 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;
|
||||
|
|
@ -17,40 +17,6 @@
|
|||
#ifndef RLV_DEFINES_H
|
||||
#define RLV_DEFINES_H
|
||||
|
||||
// ============================================================================
|
||||
// Extensions
|
||||
//
|
||||
|
||||
// Extensions
|
||||
#define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx
|
||||
#define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders:<option>=<channel> - @findfolder with multiple results
|
||||
#define RLV_EXTENSION_FORCEWEAR_GESTURES // @attach*/detach* commands also (de)activate gestures
|
||||
#define RLV_EXTENSION_STARTLOCATION // Reenables "Start Location" at login if not @tploc=n or @unsit=n restricted at last logoff
|
||||
#define RLV_EXPERIMENTAL // Enables/disables experimental features en masse
|
||||
#define RLV_EXPERIMENTAL_CMDS // Enables/disables experimental commands en masse
|
||||
|
||||
// Experimental features
|
||||
#ifdef RLV_EXPERIMENTAL
|
||||
// Stable (will mature to RLV_EXTENSION_XXX in next release if no bugs are found)
|
||||
|
||||
// Under testing (stable, but requires further testing - safe for public release but may be quirky)
|
||||
#define RLV_EXTENSION_FORCEWEAR_FOLDERLINKS // @attach*/detach* commands will collect from folder links as well
|
||||
|
||||
// Under development (don't include in public release)
|
||||
#if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG
|
||||
// #define RLV_EXPERIMENTAL_COMPOSITEFOLDERS
|
||||
#endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG
|
||||
#endif // RLV_EXPERIMENTAL
|
||||
|
||||
// Experimental commands (not part of the RLV API spec, disabled on public releases)
|
||||
#ifdef RLV_EXPERIMENTAL_CMDS
|
||||
#define RLV_EXTENSION_CMD_ALLOWIDLE // Forces "Away" status when idle (effect is the same as setting AllowIdleAFK to TRUE)
|
||||
#define RLV_EXTENSION_CMD_GETCOMMAND // @getcommand:<option>=<channel>
|
||||
#define RLV_EXTENSION_CMD_GETXXXNAMES // @get[add|rem]attachnames:<option>=<channel> and @get[add|rem]outfitnames=<channel>
|
||||
#define RLV_EXTENSION_CMD_INTERACT // @interact=n
|
||||
#define RLV_EXTENSION_CMD_TOUCHXXX // @touch:uuid=n|y, @touchworld[:<uuid>]=n|y, @touchattach[:<uuid>]=n|y, @touchud[:<uuid>]=n|y
|
||||
#endif // RLV_EXPERIMENTAL_CMDS
|
||||
|
||||
// ============================================================================
|
||||
// Defines
|
||||
//
|
||||
|
|
@ -62,9 +28,9 @@ const S32 RLV_VERSION_PATCH = 0;
|
|||
const S32 RLV_VERSION_BUILD = 0;
|
||||
|
||||
// Implementation version
|
||||
const S32 RLVa_VERSION_MAJOR = 1;
|
||||
const S32 RLVa_VERSION_MINOR = 4;
|
||||
const S32 RLVa_VERSION_PATCH = 10;
|
||||
const S32 RLVa_VERSION_MAJOR = 2;
|
||||
const S32 RLVa_VERSION_MINOR = 0;
|
||||
const S32 RLVa_VERSION_PATCH = 0;
|
||||
const S32 RLVa_VERSION_BUILD = 0;
|
||||
|
||||
// Uncomment before a final release
|
||||
|
|
@ -100,11 +66,13 @@ const S32 RLVa_VERSION_BUILD = 0;
|
|||
|
||||
#define RLV_ROOT_FOLDER "#RLV"
|
||||
#define RLV_CMD_PREFIX '@'
|
||||
#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 '.'
|
||||
|
|
@ -114,10 +82,9 @@ const S32 RLVa_VERSION_BUILD = 0;
|
|||
// Enumeration declarations
|
||||
//
|
||||
|
||||
// NOTE: any changes to this enumeration should be reflected in RlvCommand::initLookupTable()
|
||||
// NOTE: any changes to this enumeration should be reflected in the RlvBehaviourDictionary constructor
|
||||
enum ERlvBehaviour {
|
||||
RLV_BHVR_DETACH = 0, // "detach"
|
||||
RLV_BHVR_ATTACH, // "attach"
|
||||
RLV_BHVR_ADDATTACH, // "addattach"
|
||||
RLV_BHVR_REMATTACH, // "remattach"
|
||||
RLV_BHVR_ADDOUTFIT, // "addoutfit"
|
||||
|
|
@ -157,6 +124,7 @@ enum ERlvBehaviour {
|
|||
RLV_BHVR_SHOWHOVERTEXTALL, // "showhovertextall"
|
||||
RLV_BHVR_TPLM, // "tplm"
|
||||
RLV_BHVR_TPLOC, // "tploc"
|
||||
RLV_BHVR_TPLOCAL,
|
||||
RLV_BHVR_TPLURE, // "tplure"
|
||||
RLV_BHVR_TPREQUEST, // "tprequest"
|
||||
RLV_BHVR_VIEWNOTE, // "viewnote"
|
||||
|
|
@ -190,20 +158,10 @@ enum ERlvBehaviour {
|
|||
RLV_BHVR_ALWAYSRUN, // "alwaysrun"
|
||||
RLV_BHVR_TEMPRUN, // "temprun"
|
||||
RLV_BHVR_DETACHME, // "detachme"
|
||||
RLV_BHVR_ATTACHOVER, // "attachover"
|
||||
RLV_BHVR_ATTACHTHIS, // "attachthis"
|
||||
RLV_BHVR_ATTACHTHISOVER, // "attachthisover"
|
||||
RLV_BHVR_ATTACHTHISEXCEPT, // "attachthis_except"
|
||||
RLV_BHVR_DETACHTHIS, // "detachthis"
|
||||
RLV_BHVR_DETACHTHISEXCEPT, // "detachthis_except"
|
||||
RLV_BHVR_ATTACHALL, // "attachall"
|
||||
RLV_BHVR_ATTACHALLOVER, // "attachallover"
|
||||
RLV_BHVR_DETACHALL, // "detachall"
|
||||
RLV_BHVR_ATTACHALLTHIS, // "attachallthis"
|
||||
RLV_BHVR_ATTACHALLTHISEXCEPT, // "attachallthis_except"
|
||||
RLV_BHVR_ATTACHALLTHISOVER, // "attachallthisover"
|
||||
RLV_BHVR_DETACHALLTHIS, // "detachallthis"
|
||||
RLV_BHVR_DETACHALLTHISEXCEPT, // "detachallthis_except"
|
||||
RLV_BHVR_ADJUSTHEIGHT, // "adjustheight"
|
||||
RLV_BHVR_TPTO, // "tpto"
|
||||
RLV_BHVR_VERSION, // "version"
|
||||
|
|
@ -228,18 +186,37 @@ enum ERlvBehaviour {
|
|||
RLV_BHVR_GETCOMMAND, // "getcommand"
|
||||
RLV_BHVR_GETSTATUS, // "getstatus"
|
||||
RLV_BHVR_GETSTATUSALL, // "getstatusall"
|
||||
RLV_CMD_FORCEWEAR, // Internal representation of all force wear commands
|
||||
|
||||
RLV_BHVR_COUNT,
|
||||
RLV_BHVR_UNKNOWN
|
||||
};
|
||||
|
||||
enum ERlvBehaviourModifier
|
||||
{
|
||||
RLV_MODIFIER_PLACEHOLDER,
|
||||
|
||||
RLV_MODIFIER_COUNT,
|
||||
RLV_MODIFIER_UNKNOWN
|
||||
};
|
||||
|
||||
enum ERlvBehaviourOptionType
|
||||
{
|
||||
RLV_OPTION_NONE, // Behaviour takes no parameters
|
||||
RLV_OPTION_EXCEPTION, // Behaviour requires an exception as a parameter
|
||||
RLV_OPTION_NONE_OR_EXCEPTION, // Behaviour takes either no parameters or an exception
|
||||
RLV_OPTION_MODIFIER, // Behaviour requires a modifier as a parameter
|
||||
RLV_OPTION_NONE_OR_MODIFIER // Behaviour takes either no parameters or a modifier
|
||||
};
|
||||
|
||||
enum ERlvParamType {
|
||||
RLV_TYPE_UNKNOWN,
|
||||
RLV_TYPE_ADD, // <param> == "n"|"add"
|
||||
RLV_TYPE_REMOVE, // <param> == "y"|"rem"
|
||||
RLV_TYPE_FORCE, // <param> == "force"
|
||||
RLV_TYPE_REPLY, // <param> == <number>
|
||||
RLV_TYPE_CLEAR
|
||||
RLV_TYPE_UNKNOWN = 0x00,
|
||||
RLV_TYPE_ADD = 0x01, // <param> == "n"|"add"
|
||||
RLV_TYPE_REMOVE = 0x02, // <param> == "y"|"rem"
|
||||
RLV_TYPE_FORCE = 0x04, // <param> == "force"
|
||||
RLV_TYPE_REPLY = 0x08, // <param> == <number>
|
||||
RLV_TYPE_CLEAR = 0x10,
|
||||
RLV_TYPE_ADDREM = RLV_TYPE_ADD | RLV_TYPE_REMOVE
|
||||
};
|
||||
|
||||
enum ERlvCmdRet {
|
||||
|
|
@ -257,7 +234,8 @@ enum ERlvCmdRet {
|
|||
RLV_RET_FAILED_DISABLED, // Command failed (command disabled by user)
|
||||
RLV_RET_FAILED_UNKNOWN, // Command failed (unknown command)
|
||||
RLV_RET_FAILED_NOSHAREDROOT, // Command failed (missing #RLV)
|
||||
RLV_RET_DEPRECATED // Command has been deprecated
|
||||
RLV_RET_DEPRECATED, // Command has been deprecated
|
||||
RLV_RET_NO_PROCESSOR // Command doesn't have a template processor define (legacy code)
|
||||
};
|
||||
|
||||
enum ERlvExceptionCheck
|
||||
|
|
|
|||
|
|
@ -385,11 +385,9 @@ RlvExtGetSet::RlvExtGetSet()
|
|||
{
|
||||
m_DbgAllowed.insert(std::pair<std::string, S16>("AvatarSex", DBG_READ | DBG_WRITE | DBG_PSEUDO));
|
||||
m_DbgAllowed.insert(std::pair<std::string, S16>("RenderResolutionDivisor", DBG_READ | DBG_WRITE));
|
||||
#ifdef RLV_EXTENSION_CMD_GETSETDEBUG_EX
|
||||
m_DbgAllowed.insert(std::pair<std::string, S16>(RLV_SETTING_FORBIDGIVETORLV, DBG_READ));
|
||||
m_DbgAllowed.insert(std::pair<std::string, S16>(RLV_SETTING_NOSETENV, DBG_READ));
|
||||
m_DbgAllowed.insert(std::pair<std::string, S16>("WindLightUseAtmosShaders", DBG_READ));
|
||||
#endif // RLV_EXTENSION_CMD_GETSETDEBUG_EX
|
||||
m_DbgAllowed.insert(std::pair<std::string, S16>(RLV_SETTING_FORBIDGIVETORLV, DBG_READ));
|
||||
m_DbgAllowed.insert(std::pair<std::string, S16>(RLV_SETTING_NOSETENV, DBG_READ));
|
||||
m_DbgAllowed.insert(std::pair<std::string, S16>("WindLightUseAtmosShaders", DBG_READ));
|
||||
|
||||
// Cache persistance of every setting
|
||||
LLControlVariable* pSetting;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
class RlvExtGetSet : public RlvCommandHandler
|
||||
class RlvExtGetSet : public RlvExtCommandHandler
|
||||
{
|
||||
public:
|
||||
RlvExtGetSet();
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llappearancemgr.h"
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llclipboard.h"
|
||||
|
|
@ -672,3 +673,100 @@ void RlvFloaterStrings::refresh()
|
|||
}
|
||||
|
||||
// ============================================================================
|
||||
// RlvFloaterConsole
|
||||
//
|
||||
|
||||
static const char s_strRlvConsolePrompt[] = "> ";
|
||||
static const char s_strRlvConsoleDisabled[] = "RLVa is disabled";
|
||||
static const char s_strRlvConsoleInvalid[] = "Invalid command";
|
||||
|
||||
RlvFloaterConsole::RlvFloaterConsole(const LLSD& sdKey)
|
||||
: LLFloater(sdKey), m_pOutputText(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
RlvFloaterConsole::~RlvFloaterConsole()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL RlvFloaterConsole::postBuild()
|
||||
{
|
||||
LLLineEditor* pInputEdit = getChild<LLLineEditor>("console_input");
|
||||
pInputEdit->setEnableLineHistory(true);
|
||||
pInputEdit->setCommitCallback(boost::bind(&RlvFloaterConsole::onInput, this, _1, _2));
|
||||
pInputEdit->setFocus(true);
|
||||
pInputEdit->setCommitOnFocusLost(false);
|
||||
|
||||
m_pOutputText = getChild<LLTextEditor>("console_output");
|
||||
m_pOutputText->appendText(s_strRlvConsolePrompt, false);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void RlvFloaterConsole::addCommandReply(const std::string& strCommand, const std::string& strReply)
|
||||
{
|
||||
m_pOutputText->appendText(llformat("%s: ", strCommand.c_str()), true);
|
||||
m_pOutputText->appendText(strReply, false);
|
||||
}
|
||||
|
||||
void RlvFloaterConsole::onInput(LLUICtrl* pCtrl, const LLSD& sdParam)
|
||||
{
|
||||
LLLineEditor* pInputEdit = static_cast<LLLineEditor*>(pCtrl);
|
||||
std::string strInput = pInputEdit->getText();
|
||||
|
||||
m_pOutputText->appendText(strInput, false);
|
||||
pInputEdit->clear();
|
||||
|
||||
if (!rlv_handler_t::isEnabled())
|
||||
{
|
||||
m_pOutputText->appendText(s_strRlvConsoleDisabled, true);
|
||||
}
|
||||
else if ( (strInput.length() <= 3) || (RLV_CMD_PREFIX != strInput[0]) )
|
||||
{
|
||||
m_pOutputText->appendText(s_strRlvConsoleInvalid, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
strInput.erase(0, 1);
|
||||
LLStringUtil::toLower(strInput);
|
||||
|
||||
std::string strExecuted, strFailed, strRetained, *pstr;
|
||||
|
||||
boost_tokenizer tokens(strInput, boost::char_separator<char>(",", "", boost::drop_empty_tokens));
|
||||
for (std::string strCmd : tokens)
|
||||
{
|
||||
ERlvCmdRet eRet = gRlvHandler.processCommand(gAgent.getID(), strCmd, true);
|
||||
if ( RLV_RET_SUCCESS == (eRet & RLV_RET_SUCCESS) )
|
||||
pstr = &strExecuted;
|
||||
else if ( RLV_RET_FAILED == (eRet & RLV_RET_FAILED) )
|
||||
pstr = &strFailed;
|
||||
else if (RLV_RET_RETAINED == eRet)
|
||||
pstr = &strRetained;
|
||||
else
|
||||
{
|
||||
RLV_ASSERT(false);
|
||||
pstr = &strFailed;
|
||||
}
|
||||
|
||||
if (const char* pstrSuffix = RlvStrings::getStringFromReturnCode(eRet))
|
||||
strCmd.append(" (").append(pstrSuffix).append(")");
|
||||
else if (RLV_RET_SUCCESS == (eRet & RLV_RET_SUCCESS))
|
||||
strCmd.clear(); // Only show feedback on successful commands when there's an informational notice
|
||||
|
||||
if (!pstr->empty())
|
||||
pstr->push_back(',');
|
||||
pstr->append(strCmd);
|
||||
}
|
||||
|
||||
if (!strExecuted.empty())
|
||||
m_pOutputText->appendText("INFO: @" + strExecuted, true);
|
||||
if (!strFailed.empty())
|
||||
m_pOutputText->appendText("ERR: @" + strFailed, true);
|
||||
if (!strRetained.empty())
|
||||
m_pOutputText->appendText("RET: @" + strRetained, true);
|
||||
}
|
||||
|
||||
m_pOutputText->appendText(s_strRlvConsolePrompt, true);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
|
|
|||
|
|
@ -22,6 +22,12 @@
|
|||
#include "rlvdefines.h"
|
||||
#include "rlvcommon.h"
|
||||
|
||||
// ============================================================================
|
||||
// Foward declarations
|
||||
//
|
||||
class LLComboBox;
|
||||
class LLTextEditor;
|
||||
|
||||
// ============================================================================
|
||||
// RlvFloaterLocks class declaration
|
||||
//
|
||||
|
|
@ -118,6 +124,39 @@ protected:
|
|||
LLSD m_sdStringsInfo;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// RlvFloaterConsole - debug console to allow command execution without the need for a script
|
||||
//
|
||||
|
||||
class RlvFloaterConsole : public LLFloater
|
||||
{
|
||||
friend class LLFloaterReg;
|
||||
template<ERlvParamType> friend struct RlvCommandHandlerBaseImpl;
|
||||
friend class RlvHandler;
|
||||
private:
|
||||
RlvFloaterConsole(const LLSD& sdKey);
|
||||
~RlvFloaterConsole() override;
|
||||
|
||||
/*
|
||||
* LLFloater overrides
|
||||
*/
|
||||
public:
|
||||
BOOL postBuild() override;
|
||||
|
||||
/*
|
||||
* Member functions
|
||||
*/
|
||||
protected:
|
||||
void addCommandReply(const std::string& strCommand, const std::string& strReply);
|
||||
void onInput(LLUICtrl* ctrl, const LLSD& param);
|
||||
|
||||
/*
|
||||
* Member variables
|
||||
*/
|
||||
protected:
|
||||
LLTextEditor* m_pOutputText;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
|
||||
#endif // RLV_FLOATERS_H
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright (c) 2009-2011, Kitty Barnett
|
||||
* 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;
|
||||
|
|
@ -131,11 +131,11 @@ public:
|
|||
typedef boost::signals2::signal<void (const RlvCommand&, ERlvCmdRet, bool)> rlv_command_signal_t;
|
||||
boost::signals2::connection setCommandCallback(const rlv_command_signal_t::slot_type& cb ) { return m_OnCommand.connect(cb); }
|
||||
|
||||
void addCommandHandler(RlvCommandHandler* pHandler);
|
||||
void removeCommandHandler(RlvCommandHandler* pHandler);
|
||||
void addCommandHandler(RlvExtCommandHandler* pHandler);
|
||||
void removeCommandHandler(RlvExtCommandHandler* pHandler);
|
||||
protected:
|
||||
void clearCommandHandlers();
|
||||
bool notifyCommandHandlers(rlvCommandHandler f, const RlvCommand& rlvCmd, ERlvCmdRet& eRet, bool fNotifyAll) const;
|
||||
bool notifyCommandHandlers(rlvExtCommandHandler f, const RlvCommand& rlvCmd, ERlvCmdRet& eRet, bool fNotifyAll) const;
|
||||
|
||||
// Externally invoked event handlers
|
||||
public:
|
||||
|
|
@ -158,18 +158,12 @@ protected:
|
|||
|
||||
// Command handlers (RLV_TYPE_ADD and RLV_TYPE_CLEAR)
|
||||
ERlvCmdRet processAddRemCommand(const RlvCommand& rlvCmd);
|
||||
ERlvCmdRet onAddRemAttach(const RlvCommand& rlvCmd, bool& fRefCount);
|
||||
ERlvCmdRet onAddRemDetach(const RlvCommand& rlvCmd, bool& fRefCount);
|
||||
ERlvCmdRet onAddRemFolderLock(const RlvCommand& rlvCmd, bool& fRefCount);
|
||||
ERlvCmdRet onAddRemFolderLockException(const RlvCommand& rlvCmd, bool& fRefCount);
|
||||
// Command handlers (RLV_TYPE_FORCE)
|
||||
ERlvCmdRet processForceCommand(const RlvCommand& rlvCmd) const;
|
||||
ERlvCmdRet onForceRemAttach(const RlvCommand& rlvCmd) const;
|
||||
ERlvCmdRet onForceRemOutfit(const RlvCommand& rlvCmd) const;
|
||||
ERlvCmdRet onForceGroup(const RlvCommand& rlvCmd) const;
|
||||
ERlvCmdRet onForceSit(const RlvCommand& rlvCmd) const;
|
||||
ERlvCmdRet onForceWear(const LLViewerInventoryCategory* pFolder, ERlvBehaviour eBhvr) const;
|
||||
void onForceWearCallback(const uuid_vec_t& idItems, ERlvBehaviour eBhvr) const;
|
||||
ERlvCmdRet onForceWear(const LLViewerInventoryCategory* pFolder, U32 nFlags) const;
|
||||
void onForceWearCallback(const uuid_vec_t& idItems, U32 nFlags) const;
|
||||
// Command handlers (RLV_TYPE_REPLY)
|
||||
ERlvCmdRet processReplyCommand(const RlvCommand& rlvCmd) const;
|
||||
ERlvCmdRet onFindFolder(const RlvCommand& rlvCmd, std::string& strReply) const;
|
||||
|
|
@ -203,7 +197,7 @@ protected:
|
|||
rlv_behaviour_signal_t m_OnBehaviour;
|
||||
rlv_behaviour_signal_t m_OnBehaviourToggle;
|
||||
rlv_command_signal_t m_OnCommand;
|
||||
mutable std::list<RlvCommandHandler*> m_CommandHandlers;
|
||||
mutable std::list<RlvExtCommandHandler*> m_CommandHandlers;
|
||||
|
||||
static BOOL m_fEnabled; // Use setEnabled() to toggle this
|
||||
|
||||
|
|
@ -213,6 +207,8 @@ protected:
|
|||
|
||||
friend class RlvSharedRootFetcher; // Fetcher needs access to m_fFetchComplete
|
||||
friend class RlvGCTimer; // Timer clear its own point at destruction
|
||||
template<ERlvParamType> friend struct RlvCommandHandlerBaseImpl;
|
||||
template<ERlvParamType, ERlvBehaviour> friend struct RlvCommandHandler;
|
||||
|
||||
// --------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright (c) 2009-2011, Kitty Barnett
|
||||
* 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;
|
||||
|
|
@ -28,24 +28,423 @@
|
|||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
// ============================================================================
|
||||
// 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
|
||||
* (also due to my poor naming schemes) but is actually far simpler and less error-prone than the old way.
|
||||
*
|
||||
* In the general case you just add a definition for the command below and then write the function body in rlvhandler.cpp
|
||||
* and you're done! Told you this was easy.
|
||||
*
|
||||
* Reply command
|
||||
* =============
|
||||
* Definition: RlvReplyProcessor<RLV_BHVR_COMMANDNAME>("commandname"[, <options>]));
|
||||
* Implement : ERlvCmdRet RlvReplyHandler<RLV_BHVR_COMMANDNAME>::onCommand(const RlvCommand& rlvCmd, std::string& strReply)
|
||||
*
|
||||
* Force command
|
||||
* =============
|
||||
* Definition: new RlvForceProcessor<RLV_BHVR_COMMANDNAME>("commandname"[, <options>]));
|
||||
* Implement : ERlvCmdRet RlvForceProcessor<RLV_BHVR_COMMANDNAME>::onCommand(const RlvCommand& rlvCmd)
|
||||
*
|
||||
* Behaviours
|
||||
* ==========
|
||||
* Behaviours come in many forms but the added complexity is only in the variety of choices. The implementation is as
|
||||
* easy as reply or force commands.
|
||||
*
|
||||
* For simple behaviours that only require recordkeeping and don't run code when set/unset (see ERlvBehaviourOptionType):
|
||||
* 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"))
|
||||
* Implement : void RlvBehaviourToggleHandler<RLV_BHVR_COMMANDNAME>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
|
||||
* For behaviours that require manual processing:
|
||||
* Definition: RlvBehaviourProcessor<RLV_BHVR_COMMANDNAME>("commandname"))
|
||||
* Implement : ERlvCmdRet RlvBehaviourHandler<RLV_BHVR_COMMANDNAME>::onCommand(const RlvCommand& rlvCmd, bool& fRefCount)
|
||||
* For behaviours that run code when their modifier changes:
|
||||
* Definition: addModifier(RLV_BHVR_COMMANDNAME, RLV_MODIFIER_COMMANDNAME, new RlvBehaviourModifierHandler<RLV_MODIFIER_COMMANDNAME>(<default>, <auto-add>, <comparator>));
|
||||
* Implement : void RlvBehaviourModifierHandler::onValueChanged()
|
||||
*
|
||||
*/
|
||||
RlvBehaviourDictionary::RlvBehaviourDictionary()
|
||||
{
|
||||
// Array auto-initialization to 0 is still not supported in VS2013
|
||||
memset(m_BehaviourModifiers, 0, sizeof(RlvBehaviourModifier*) * RLV_MODIFIER_COUNT);
|
||||
|
||||
//
|
||||
// Restrictions
|
||||
//
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("acceptpermission", RLV_BHVR_ACCEPTPERMISSION));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("accepttp", RLV_BHVR_ACCEPTTP, RlvBehaviourInfo::BHVR_STRICT));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("accepttprequest", RLV_BHVR_ACCEPTTPREQUEST, RlvBehaviourInfo::BHVR_STRICT | RlvBehaviourInfo::BHVR_EXTENDED));
|
||||
addEntry(new RlvBehaviourProcessor<RLV_BHVR_ADDATTACH, RlvBehaviourAddRemAttachHandler>("addattach"));
|
||||
addEntry(new RlvBehaviourInfo("addoutfit", RLV_BHVR_ADDOUTFIT, RLV_TYPE_ADDREM));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("allowidle", RLV_BHVR_ALLOWIDLE, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("alwaysrun", RLV_BHVR_ALWAYSRUN));
|
||||
addEntry(new RlvBehaviourInfo("attachthis", RLV_BHVR_ATTACHTHIS, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_NODE));
|
||||
addEntry(new RlvBehaviourInfo("attachallthis", RLV_BHVR_ATTACHTHIS, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE));
|
||||
addEntry(new RlvBehaviourInfo("attachthis_except", RLV_BHVR_ATTACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_NODE));
|
||||
addEntry(new RlvBehaviourInfo("attachallthis_except", RLV_BHVR_ATTACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("chatwhisper", RLV_BHVR_CHATWHISPER));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("chatnormal", RLV_BHVR_CHATNORMAL));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("chatshout", RLV_BHVR_CHATSHOUT));
|
||||
addEntry(new RlvBehaviourProcessor<RLV_BHVR_DETACH>("detach"));
|
||||
addEntry(new RlvBehaviourInfo("detachthis", RLV_BHVR_DETACHTHIS, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_NODE));
|
||||
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 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>("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));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("permissive", RLV_BHVR_PERMISSIVE));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("recvchat", RLV_BHVR_RECVCHAT, RlvBehaviourInfo::BHVR_STRICT));
|
||||
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 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 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 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>("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));
|
||||
addEntry(new RlvBehaviourProcessor<RLV_BHVR_SHOWHOVERTEXT>("showhovertext"));
|
||||
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 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 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>("standtp", RLV_BHVR_STANDTP));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("startim", RLV_BHVR_STARTIM, RlvBehaviourInfo::BHVR_STRICT));
|
||||
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_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_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));
|
||||
addEntry(new RlvBehaviourInfo("unsharedwear", RLV_BHVR_UNSHAREDWEAR, RLV_TYPE_ADDREM));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("unsit", RLV_BHVR_UNSIT));
|
||||
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));
|
||||
|
||||
//
|
||||
// Force-wear
|
||||
//
|
||||
addEntry(new RlvBehaviourInfo("attach", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE));
|
||||
addEntry(new RlvBehaviourInfo("attachall", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE));
|
||||
addEntry(new RlvBehaviourInfo("attachover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE));
|
||||
addEntry(new RlvBehaviourInfo("attachallover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE));
|
||||
addEntry(new RlvBehaviourInfo("attachthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT));
|
||||
addEntry(new RlvBehaviourInfo("attachallthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT));
|
||||
addEntry(new RlvBehaviourInfo("attachthisover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT));
|
||||
addEntry(new RlvBehaviourInfo("attachallthisover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT));
|
||||
addEntry(new RlvForceProcessor<RLV_BHVR_DETACH, RlvForceRemAttachHandler>("detach", RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE));
|
||||
addEntry(new RlvBehaviourInfo("detachall", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE));
|
||||
addEntry(new RlvBehaviourInfo("detachthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT));
|
||||
addEntry(new RlvBehaviourInfo("detachallthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT));
|
||||
addEntry(new RlvForceProcessor<RLV_BHVR_REMATTACH, RlvForceRemAttachHandler>("remattach", RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE));
|
||||
addEntry(new RlvForceProcessor<RLV_BHVR_REMOUTFIT>("remoutfit", RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE));
|
||||
// Synonyms (addoutfit* -> attach*)
|
||||
addEntry(new RlvBehaviourInfo("addoutfit", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
addEntry(new RlvBehaviourInfo("addoutfitall", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
addEntry(new RlvBehaviourInfo("addoutfitover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
addEntry(new RlvBehaviourInfo("addoutfitallover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
addEntry(new RlvBehaviourInfo("addoutfitthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
addEntry(new RlvBehaviourInfo("addoutfitallthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
addEntry(new RlvBehaviourInfo("addoutfitthisover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
addEntry(new RlvBehaviourInfo("addoutfitallthisover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
// Synonyms (attach*overorreplace -> attach*)
|
||||
addEntry(new RlvBehaviourInfo("attachoverorreplace", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
addEntry(new RlvBehaviourInfo("attachalloverorreplace", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
addEntry(new RlvBehaviourInfo("attachthisoverorreplace",RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
addEntry(new RlvBehaviourInfo("attachallthisoverorreplace",RLV_CMD_FORCEWEAR,RLV_TYPE_FORCE,RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM));
|
||||
|
||||
//
|
||||
// Force-only
|
||||
//
|
||||
addEntry(new RlvBehaviourInfo("adjustheight", RLV_BHVR_ADJUSTHEIGHT, RLV_TYPE_FORCE));
|
||||
addEntry(new RlvForceProcessor<RLV_BHVR_DETACHME>("detachme"));
|
||||
addEntry(new RlvForceProcessor<RLV_BHVR_SETGROUP>("setgroup"));
|
||||
addEntry(new RlvForceProcessor<RLV_BHVR_SIT>("sit"));
|
||||
addEntry(new RlvForceProcessor<RLV_BHVR_TPTO>("tpto"));
|
||||
addEntry(new RlvBehaviourInfo("unsit", RLV_BHVR_UNSIT, RLV_TYPE_FORCE));
|
||||
|
||||
//
|
||||
// Reply-only
|
||||
//
|
||||
addEntry(new RlvBehaviourInfo("findfolder", RLV_BHVR_FINDFOLDER, RLV_TYPE_REPLY));
|
||||
addEntry(new RlvBehaviourInfo("findfolders", RLV_BHVR_FINDFOLDERS, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXTENDED));
|
||||
addEntry(new RlvBehaviourInfo("getaddattachnames", RLV_BHVR_GETADDATTACHNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
|
||||
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_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));
|
||||
addEntry(new RlvBehaviourInfo("getinvworn", RLV_BHVR_GETINVWORN, RLV_TYPE_REPLY));
|
||||
addEntry(new RlvBehaviourInfo("getoutfit", RLV_BHVR_GETOUTFIT, RLV_TYPE_REPLY));
|
||||
addEntry(new RlvBehaviourInfo("getoutfitnames", RLV_BHVR_GETOUTFITNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
|
||||
addEntry(new RlvBehaviourInfo("getpath", RLV_BHVR_GETPATH, RLV_TYPE_REPLY));
|
||||
addEntry(new RlvBehaviourInfo("getpathnew", RLV_BHVR_GETPATHNEW, RLV_TYPE_REPLY));
|
||||
addEntry(new RlvBehaviourInfo("getremattachnames", RLV_BHVR_GETREMATTACHNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
|
||||
addEntry(new RlvBehaviourInfo("getremoutfitnames", RLV_BHVR_GETREMOUTFITNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
|
||||
addEntry(new RlvBehaviourInfo("getsitid", RLV_BHVR_GETSITID, RLV_TYPE_REPLY));
|
||||
addEntry(new RlvBehaviourInfo("getstatus", RLV_BHVR_GETSTATUS, RLV_TYPE_REPLY));
|
||||
addEntry(new RlvBehaviourInfo("getstatusall", RLV_BHVR_GETSTATUSALL, RLV_TYPE_REPLY));
|
||||
addEntry(new RlvBehaviourInfo("version", RLV_BHVR_VERSION, RLV_TYPE_REPLY));
|
||||
addEntry(new RlvBehaviourInfo("versionnew", RLV_BHVR_VERSIONNEW, RLV_TYPE_REPLY));
|
||||
addEntry(new RlvBehaviourInfo("versionnum", RLV_BHVR_VERSIONNUM, RLV_TYPE_REPLY));
|
||||
|
||||
// Populate m_String2InfoMap (the tuple <behaviour, type> should be unique)
|
||||
for (const RlvBehaviourInfo* pBhvrInfo : m_BhvrInfoList)
|
||||
{
|
||||
RLV_ASSERT(m_String2InfoMap.insert(std::make_pair(std::make_pair(pBhvrInfo->getBehaviour(), (ERlvParamType)pBhvrInfo->getParamTypeMask()), pBhvrInfo)).second == true);
|
||||
}
|
||||
|
||||
// Populate m_Bhvr2InfoMap (there can be multiple entries per ERlvBehaviour)
|
||||
for (const RlvBehaviourInfo* pBhvrInfo : m_BhvrInfoList)
|
||||
{
|
||||
if ( (pBhvrInfo->getParamTypeMask() & RLV_TYPE_ADDREM) && (!pBhvrInfo->isSynonym()) )
|
||||
{
|
||||
#ifdef RLV_DEBUG
|
||||
for (const rlv_bhvr2info_map_t::value_type& itBhvr : boost::make_iterator_range(m_Bhvr2InfoMap.lower_bound(pBhvrInfo->getBehaviourType()), m_Bhvr2InfoMap.upper_bound(pBhvrInfo->getBehaviourType())))
|
||||
{
|
||||
RLV_ASSERT( (itBhvr.first != pBhvrInfo->getBehaviourType()) || (itBhvr.second->getBehaviourFlags() != pBhvrInfo->getBehaviourFlags()) );
|
||||
}
|
||||
#endif // RLV_DEBUG
|
||||
m_Bhvr2InfoMap.insert(std::pair<ERlvBehaviour, const RlvBehaviourInfo*>(pBhvrInfo->getBehaviourType(), pBhvrInfo));
|
||||
}
|
||||
}
|
||||
|
||||
// Process blocked commands
|
||||
if (RlvSettings::getNoSetEnv())
|
||||
toggleBehaviourFlag("setenv", RLV_TYPE_ADDREM, RlvBehaviourInfo::BHVR_BLOCKED, true);
|
||||
}
|
||||
|
||||
RlvBehaviourDictionary::~RlvBehaviourDictionary()
|
||||
{
|
||||
for (const RlvBehaviourInfo* pBhvrInfo : m_BhvrInfoList)
|
||||
delete pBhvrInfo;
|
||||
m_BhvrInfoList.clear();
|
||||
|
||||
for (int idxBhvrMod = 0; idxBhvrMod < RLV_MODIFIER_COUNT; idxBhvrMod++)
|
||||
{
|
||||
delete m_BehaviourModifiers[idxBhvrMod];
|
||||
m_BehaviourModifiers[idxBhvrMod] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void RlvBehaviourDictionary::addEntry(const RlvBehaviourInfo* pEntry)
|
||||
{
|
||||
// Filter experimental commands (if disabled)
|
||||
static LLCachedControl<bool> sEnableExperimental(gSavedSettings, "RLVaExperimentalCommands");
|
||||
if ( (!pEntry) || ((!sEnableExperimental) && (pEntry->isExperimental())) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Sanity check for duplicate entries
|
||||
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
||||
std::for_each(m_BhvrInfoList.begin(), m_BhvrInfoList.end(),
|
||||
[&pEntry](const RlvBehaviourInfo* pBhvrInfo) {
|
||||
RLV_ASSERT_DBG( ((pBhvrInfo->getBehaviour()) != (pEntry->getBehaviour())) || ((pBhvrInfo->getParamTypeMask() & pEntry->getParamTypeMask()) == 0) );
|
||||
});
|
||||
#endif // LL_RELEASE_FOR_DOWNLOAD
|
||||
|
||||
m_BhvrInfoList.push_back(pEntry);
|
||||
}
|
||||
|
||||
void RlvBehaviourDictionary::addModifier(ERlvBehaviour eBhvr, ERlvBehaviourModifier eModifier, RlvBehaviourModifier* pModifierEntry)
|
||||
{
|
||||
if (eModifier < RLV_MODIFIER_COUNT)
|
||||
{
|
||||
m_BehaviourModifiers[eModifier] = pModifierEntry;
|
||||
m_Bhvr2ModifierMap.insert(std::make_pair(eBhvr, eModifier));
|
||||
}
|
||||
}
|
||||
|
||||
const RlvBehaviourInfo* RlvBehaviourDictionary::getBehaviourInfo(const std::string& strBhvr, ERlvParamType eParamType, bool* pfStrict) const
|
||||
{
|
||||
bool fStrict = boost::algorithm::ends_with(strBhvr, "_sec");
|
||||
if (pfStrict)
|
||||
*pfStrict = fStrict;
|
||||
|
||||
rlv_string2info_map_t::const_iterator itBhvr = m_String2InfoMap.find(std::make_pair(strBhvr, (eParamType & RLV_TYPE_ADDREM) ? RLV_TYPE_ADDREM : eParamType));
|
||||
return ( (itBhvr != m_String2InfoMap.end()) && ((!fStrict) || (itBhvr->second->hasStrict())) ) ? itBhvr->second : NULL;
|
||||
}
|
||||
|
||||
ERlvBehaviour RlvBehaviourDictionary::getBehaviourFromString(const std::string& strBhvr, ERlvParamType eParamType, bool* pfStrict) const
|
||||
{
|
||||
const RlvBehaviourInfo* pBhvrInfo = getBehaviourInfo(strBhvr, eParamType, pfStrict);
|
||||
return (pBhvrInfo) ? pBhvrInfo->getBehaviourType() : RLV_BHVR_UNKNOWN;
|
||||
}
|
||||
|
||||
bool RlvBehaviourDictionary::getCommands(const std::string& strMatch, ERlvParamType eParamType, std::list<std::string>& cmdList) const
|
||||
{
|
||||
cmdList.clear();
|
||||
for (const RlvBehaviourInfo* pBhvrInfo : m_BhvrInfoList)
|
||||
{
|
||||
if ( (pBhvrInfo->getParamTypeMask() & eParamType) || (RLV_TYPE_UNKNOWN == eParamType) )
|
||||
{
|
||||
std::string strCmd = pBhvrInfo->getBehaviour();
|
||||
if ( (std::string::npos != strCmd.find(strMatch)) || (strMatch.empty()) )
|
||||
cmdList.push_back(strCmd);
|
||||
if ( (pBhvrInfo->hasStrict()) && ((std::string::npos != strCmd.append("_sec").find(strMatch)) || (strMatch.empty())) )
|
||||
cmdList.push_back(strCmd);
|
||||
}
|
||||
}
|
||||
return !cmdList.empty();
|
||||
}
|
||||
|
||||
bool RlvBehaviourDictionary::getHasStrict(ERlvBehaviour eBhvr) const
|
||||
{
|
||||
for (const rlv_bhvr2info_map_t::value_type& itBhvr : boost::make_iterator_range(m_Bhvr2InfoMap.lower_bound(eBhvr), m_Bhvr2InfoMap.upper_bound(eBhvr)))
|
||||
{
|
||||
// Only restrictions can be strict
|
||||
if (RLV_TYPE_ADDREM != itBhvr.second->getParamTypeMask())
|
||||
continue;
|
||||
return itBhvr.second->hasStrict();
|
||||
}
|
||||
RLV_ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
RlvBehaviourModifier* RlvBehaviourDictionary::getModifierFromBehaviour(ERlvBehaviour eBhvr) const
|
||||
{
|
||||
rlv_bhvr2mod_map_t::const_iterator itMod = m_Bhvr2ModifierMap.find(eBhvr);
|
||||
ERlvBehaviourModifier eBhvrMod = (m_Bhvr2ModifierMap.end() != itMod) ? itMod->second : RLV_MODIFIER_UNKNOWN;
|
||||
return (eBhvrMod < RLV_MODIFIER_UNKNOWN) ? m_BehaviourModifiers[eBhvrMod] : nullptr;
|
||||
}
|
||||
|
||||
void RlvBehaviourDictionary::toggleBehaviourFlag(const std::string& strBhvr, ERlvParamType eParamType, RlvBehaviourInfo::EBehaviourFlags eBhvrFlag, bool fEnable)
|
||||
{
|
||||
rlv_string2info_map_t::const_iterator itBhvr = m_String2InfoMap.find(std::make_pair(strBhvr, (eParamType & RLV_TYPE_ADDREM) ? RLV_TYPE_ADDREM : eParamType));
|
||||
if (m_String2InfoMap.end() != itBhvr)
|
||||
{
|
||||
const_cast<RlvBehaviourInfo*>(itBhvr->second)->toggleBehaviourFlag(eBhvrFlag, fEnable);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// RlvBehaviourModifier
|
||||
//
|
||||
|
||||
RlvBehaviourModifier::RlvBehaviourModifier(const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator)
|
||||
: m_DefaultValue(defaultValue), m_fAddDefaultOnEmpty(fAddDefaultOnEmpty), m_pValueComparator(pValueComparator)
|
||||
{
|
||||
}
|
||||
|
||||
bool RlvBehaviourModifier::addValue(const RlvBehaviourModifierValue& modValue, const LLUUID& idObject)
|
||||
{
|
||||
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();
|
||||
m_ChangeSignal(getValue());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void RlvBehaviourModifier::removeValue(const RlvBehaviourModifierValue& modValue, const LLUUID& idObject)
|
||||
{
|
||||
if ( (modValue.which() == m_DefaultValue.which()) )
|
||||
{
|
||||
auto itValue = std::find(m_Values.begin(), m_Values.end(), std::make_pair(modValue, idObject));
|
||||
if (m_Values.end() != itValue)
|
||||
{
|
||||
m_Values.erase(itValue);
|
||||
onValueChange();
|
||||
m_ChangeSignal(getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RlvBehaviourModifier::setPrimaryObject(const LLUUID& idPrimaryObject)
|
||||
{
|
||||
if (m_pValueComparator)
|
||||
{
|
||||
m_pValueComparator->m_idPrimaryObject = idPrimaryObject;
|
||||
m_Values.sort(boost::bind(&RlvBehaviourModifier_Comp::operator(), m_pValueComparator, _1, _2));
|
||||
onValueChange();
|
||||
m_ChangeSignal(getValue());
|
||||
}
|
||||
}
|
||||
|
||||
bool RlvBehaviourModifier::convertOptionValue(const std::string& optionValue, RlvBehaviourModifierValue& modValue) const
|
||||
{
|
||||
try
|
||||
{
|
||||
if (typeid(float) == m_DefaultValue.type())
|
||||
{
|
||||
modValue = std::stof(optionValue.c_str());
|
||||
return true;
|
||||
}
|
||||
else if (typeid(int) == m_DefaultValue.type())
|
||||
{
|
||||
modValue = std::stoi(optionValue.c_str());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
catch (const std::invalid_argument&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// RlvCommmand
|
||||
//
|
||||
|
||||
RlvCommand::bhvr_map_t RlvCommand::m_BhvrMap;
|
||||
|
||||
// Checked: 2009-12-27 (RLVa-1.1.0k) | Modified: RLVa-1.1.0k
|
||||
RlvCommand::RlvCommand(const LLUUID& idObj, const std::string& strCommand)
|
||||
: m_fValid(false), m_idObj(idObj), m_eBehaviour(RLV_BHVR_UNKNOWN), m_fStrict(false), m_eParamType(RLV_TYPE_UNKNOWN), m_eRet(RLV_RET_UNKNOWN)
|
||||
: m_fValid(false), m_idObj(idObj), m_pBhvrInfo(NULL), m_eParamType(RLV_TYPE_UNKNOWN), m_fStrict(false), m_eRet(RLV_RET_UNKNOWN)
|
||||
{
|
||||
if ((m_fValid = parseCommand(strCommand, m_strBehaviour, m_strOption, m_strParam)))
|
||||
std::string strBehaviour;
|
||||
if (m_fValid = parseCommand(strCommand, 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 (m_strBehaviour == "clear") // clear is the odd one out so just make it its own type
|
||||
else if (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;
|
||||
|
|
@ -60,25 +459,13 @@ RlvCommand::RlvCommand(const LLUUID& idObj, const std::string& strCommand)
|
|||
|
||||
if (!m_fValid)
|
||||
{
|
||||
m_strBehaviour = m_strOption = m_strParam = "";
|
||||
m_strOption = m_strParam = "";
|
||||
return;
|
||||
}
|
||||
|
||||
// HACK: all those @*overorreplace synonyms are rather tedious (and error-prone) to deal with so replace them their equivalent
|
||||
if ( (RLV_TYPE_FORCE == m_eParamType) &&
|
||||
(m_strBehaviour.length() > 13) && (m_strBehaviour.length() - 13 == m_strBehaviour.rfind("overorreplace")) )
|
||||
{
|
||||
m_strBehaviour.erase(m_strBehaviour.length() - 13, 13);
|
||||
}
|
||||
// HACK: all those @addoutfit* synonyms are rather tedious (and error-prone) to deal with so replace them their @attach* equivalent
|
||||
if ( (RLV_TYPE_FORCE == m_eParamType) && (0 == m_strBehaviour.find("addoutfit")) )
|
||||
{
|
||||
m_strBehaviour.replace(0, 9, "attach");
|
||||
}
|
||||
m_eBehaviour = getBehaviourFromString(m_strBehaviour, &m_fStrict);
|
||||
m_pBhvrInfo = RlvBehaviourDictionary::instance().getBehaviourInfo(strBehaviour, m_eParamType, &m_fStrict);
|
||||
}
|
||||
|
||||
|
||||
bool RlvCommand::parseCommand(const std::string& strCommand, std::string& strBehaviour, std::string& strOption, std::string& strParam)
|
||||
{
|
||||
// (See behaviour notes for the command parsing truth table)
|
||||
|
|
@ -113,100 +500,142 @@ bool RlvCommand::parseCommand(const std::string& strCommand, std::string& strBeh
|
|||
return true;
|
||||
}
|
||||
|
||||
// Checked: 2009-12-05 (RLVa-1.1.0h) | Added: RLVa-1.1.0h
|
||||
ERlvBehaviour RlvCommand::getBehaviourFromString(const std::string& strBhvr, bool* pfStrict /*=NULL*/)
|
||||
{
|
||||
std::string::size_type idxStrict = strBhvr.find("_sec");
|
||||
bool fStrict = (std::string::npos != idxStrict) && (idxStrict + 4 == strBhvr.length());
|
||||
if (pfStrict)
|
||||
*pfStrict = fStrict;
|
||||
// ============================================================================
|
||||
// Command option parsing utility classes
|
||||
//
|
||||
|
||||
RLV_ASSERT(m_BhvrMap.size() > 0);
|
||||
bhvr_map_t::const_iterator itBhvr = m_BhvrMap.find( (!fStrict) ? strBhvr : strBhvr.substr(0, idxStrict));
|
||||
if ( (itBhvr != m_BhvrMap.end()) && ((!fStrict) || (hasStrictVariant(itBhvr->second))) )
|
||||
return itBhvr->second;
|
||||
return RLV_BHVR_UNKNOWN;
|
||||
template<>
|
||||
bool RlvCommandOptionHelper::parseOption<LLUUID>(const std::string& strOption, LLUUID& idOption)
|
||||
{
|
||||
idOption.set(strOption);
|
||||
return idOption.notNull();
|
||||
}
|
||||
|
||||
// Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c
|
||||
bool RlvCommand::getCommands(bhvr_map_t& cmdList, const std::string &strMatch)
|
||||
template<>
|
||||
bool RlvCommandOptionHelper::parseOption<int>(const std::string& strOption, int& nOption)
|
||||
{
|
||||
if (strMatch.empty())
|
||||
try
|
||||
{
|
||||
nOption = std::stoi(strOption);
|
||||
}
|
||||
catch (const std::invalid_argument&)
|
||||
{
|
||||
return false;
|
||||
cmdList.clear();
|
||||
|
||||
RLV_ASSERT(m_BhvrMap.size() > 0);
|
||||
for (bhvr_map_t::const_iterator itBhvr = m_BhvrMap.begin(); itBhvr != m_BhvrMap.end(); ++itBhvr)
|
||||
{
|
||||
std::string strCmd = itBhvr->first; ERlvBehaviour eBhvr = itBhvr->second;
|
||||
if (std::string::npos != strCmd.find(strMatch))
|
||||
cmdList.insert(std::pair<std::string, ERlvBehaviour>(strCmd, eBhvr));
|
||||
if ( (hasStrictVariant(eBhvr)) && (std::string::npos != strCmd.append("_sec").find(strMatch)) )
|
||||
cmdList.insert(std::pair<std::string, ERlvBehaviour>(strCmd, eBhvr));
|
||||
}
|
||||
return (0 != cmdList.size());
|
||||
return true;
|
||||
}
|
||||
|
||||
// Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-1.1.0h
|
||||
void RlvCommand::initLookupTable()
|
||||
template<>
|
||||
bool RlvCommandOptionHelper::parseOption<float>(const std::string& strOption, float& nOption)
|
||||
{
|
||||
static bool fInitialized = false;
|
||||
if (!fInitialized)
|
||||
try
|
||||
{
|
||||
// NOTE: keep this matched with the enumeration at all times
|
||||
std::string arBehaviours[RLV_BHVR_COUNT] =
|
||||
{
|
||||
"detach", "attach", "addattach", "remattach", "addoutfit", "remoutfit", "sharedwear", "sharedunwear",
|
||||
"unsharedwear", "unsharedunwear", "emote", "sendchat", "recvchat", "recvchatfrom", "recvemote", "recvemotefrom",
|
||||
"redirchat", "rediremote", "chatwhisper", "chatnormal", "chatshout", "sendchannel", "sendim", "sendimto",
|
||||
"recvim", "recvimfrom", "startim", "startimto", "permissive", "notify", "showinv", "showminimap", "showworldmap", "showloc",
|
||||
"shownames", "showhovertext", "showhovertexthud", "showhovertextworld", "showhovertextall", "tplm", "tploc", "tplure", "tprequest",
|
||||
"viewnote", "viewscript", "viewtexture", "acceptpermission", "accepttp", "accepttprequest", "allowidle", "edit", "editobj", "rez",
|
||||
"fartouch", "interact", "touchthis", "touchattach", "touchattachself", "touchattachother", "touchhud", "touchworld", "touchall",
|
||||
"touchme", "fly", "setgroup", "unsit", "sit", "sittp", "standtp", "setdebug", "setenv", "alwaysrun", "temprun", "detachme",
|
||||
"attachover", "attachthis", "attachthisover", "attachthis_except", "detachthis", "detachthis_except", "attachall",
|
||||
"attachallover", "detachall", "attachallthis", "attachallthis_except", "attachallthisover", "detachallthis",
|
||||
"detachallthis_except", "adjustheight", "tpto", "version", "versionnew", "versionnum", "getattach", "getattachnames",
|
||||
"getaddattachnames", "getremattachnames", "getoutfit", "getoutfitnames", "getaddoutfitnames", "getremoutfitnames",
|
||||
"findfolder", "findfolders", "getpath", "getpathnew", "getinv", "getinvworn", "getgroup", "getsitid", "getcommand",
|
||||
"getstatus", "getstatusall"
|
||||
};
|
||||
|
||||
for (int idxBvhr = 0; idxBvhr < RLV_BHVR_COUNT; idxBvhr++)
|
||||
m_BhvrMap.insert(std::pair<std::string, ERlvBehaviour>(arBehaviours[idxBvhr], (ERlvBehaviour)idxBvhr));
|
||||
|
||||
fInitialized = true;
|
||||
nOption = std::stof(strOption);
|
||||
}
|
||||
catch (const std::invalid_argument&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool RlvCommandOptionHelper::parseOption<LLWearableType::EType>(const std::string& strOption, LLWearableType::EType& wtOption)
|
||||
{
|
||||
wtOption = LLWearableType::typeNameToType(strOption);
|
||||
return (LLWearableType::WT_INVALID != wtOption) && (LLWearableType::WT_NONE != wtOption);
|
||||
}
|
||||
|
||||
template<>
|
||||
bool RlvCommandOptionHelper::parseOption<LLViewerJointAttachment*>(const std::string& strOption, LLViewerJointAttachment*& pAttachPt)
|
||||
{
|
||||
pAttachPt = RlvAttachPtLookup::getAttachPoint(strOption);
|
||||
return pAttachPt != NULL;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool RlvCommandOptionHelper::parseOption<ERlvAttachGroupType>(const std::string& strOption, ERlvAttachGroupType& eAttachGroup)
|
||||
{
|
||||
eAttachGroup = rlvAttachGroupFromString(strOption);
|
||||
return eAttachGroup != RLV_ATTACHGROUP_INVALID;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool RlvCommandOptionHelper::parseOption<LLViewerInventoryCategory*>(const std::string& strOption, LLViewerInventoryCategory*& pFolder)
|
||||
{
|
||||
pFolder = RlvInventory::instance().getSharedFolder(strOption);
|
||||
return pFolder != NULL;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool RlvCommandOptionHelper::parseOption<LLVector3>(const std::string& strOption, LLVector3& vecOption)
|
||||
{
|
||||
if (!strOption.empty())
|
||||
{
|
||||
S32 cntToken = sscanf(strOption.c_str(), "%f/%f/%f", vecOption.mV + 0, vecOption.mV + 1, vecOption.mV + 2);
|
||||
return (3 == cntToken);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool RlvCommandOptionHelper::parseOption<LLVector3d>(const std::string& strOption, LLVector3d& vecOption)
|
||||
{
|
||||
if (!strOption.empty())
|
||||
{
|
||||
S32 cntToken = sscanf(strOption.c_str(), "%lf/%lf/%lf", vecOption.mdV + 0, vecOption.mdV + 1, vecOption.mdV + 2);
|
||||
return (3 == cntToken);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool RlvCommandOptionHelper::parseOption<RlvCommandOptionGeneric>(const std::string& strOption, RlvCommandOptionGeneric& genericOption)
|
||||
{
|
||||
LLWearableType::EType wtType(LLWearableType::WT_INVALID); LLUUID idOption; ERlvAttachGroupType eAttachGroup(RLV_ATTACHGROUP_INVALID);
|
||||
LLViewerJointAttachment* pAttachPt = NULL; LLViewerInventoryCategory* pFolder = NULL; LLVector3d posOption; float nOption;
|
||||
|
||||
if (!strOption.empty()) // <option> could be an empty string
|
||||
{
|
||||
if (RlvCommandOptionHelper::parseOption(strOption, wtType))
|
||||
genericOption = wtType; // ... or specify a (valid) clothing layer
|
||||
else if (RlvCommandOptionHelper::parseOption(strOption, pAttachPt))
|
||||
genericOption = pAttachPt; // ... or specify an attachment point
|
||||
else if (RlvCommandOptionHelper::parseOption(strOption, idOption))
|
||||
genericOption = idOption; // ... or specify an UUID
|
||||
else if (RlvCommandOptionHelper::parseOption(strOption, pFolder))
|
||||
genericOption = pFolder; // ... or specify a shared folder path
|
||||
else if (RlvCommandOptionHelper::parseOption(strOption, eAttachGroup))
|
||||
genericOption = eAttachGroup; // ... or specify an attachment point group
|
||||
else if (RlvCommandOptionHelper::parseOption(strOption, posOption))
|
||||
genericOption = posOption; // ... or specify a vector (region or global coordinates)
|
||||
else if (RlvCommandOptionHelper::parseOption(strOption, nOption))
|
||||
genericOption = nOption; // ... or specify a number
|
||||
else
|
||||
genericOption = strOption; // ... or it might just be a string
|
||||
}
|
||||
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())
|
||||
boost::split(optionList, strOption, boost::is_any_of(strSeparator));
|
||||
return !optionList.empty();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// RlvCommandOption structures
|
||||
//
|
||||
|
||||
// Checked: 2010-09-28 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
|
||||
RlvCommandOptionGeneric::RlvCommandOptionGeneric(const std::string& strOption)
|
||||
{
|
||||
LLWearableType::EType wtType(LLWearableType::WT_INVALID); LLUUID idOption; ERlvAttachGroupType eAttachGroup(RLV_ATTACHGROUP_INVALID);
|
||||
LLViewerJointAttachment* pAttachPt = NULL; LLViewerInventoryCategory* pFolder = NULL;
|
||||
|
||||
if (!(m_fEmpty = strOption.empty())) // <option> could be an empty string
|
||||
{
|
||||
if ( ((wtType = LLWearableType::typeNameToType(strOption)) != LLWearableType::WT_INVALID) && (wtType != LLWearableType::WT_NONE) )
|
||||
m_varOption = wtType; // ... or specify a (valid) clothing layer
|
||||
else if ((pAttachPt = RlvAttachPtLookup::getAttachPoint(strOption)) != NULL)
|
||||
m_varOption = pAttachPt; // ... or specify an attachment point
|
||||
else if ( ((UUID_STR_LENGTH - 1) == strOption.length()) && (idOption.set(strOption)) )
|
||||
m_varOption = idOption; // ... or specify an UUID
|
||||
else if ((pFolder = RlvInventory::instance().getSharedFolder(strOption)) != NULL)
|
||||
m_varOption = pFolder; // ... or specify a shared folder path
|
||||
else if ((eAttachGroup = rlvAttachGroupFromString(strOption)) != RLV_ATTACHGROUP_INVALID)
|
||||
m_varOption = eAttachGroup; // ... or specify an attachment point group
|
||||
else
|
||||
m_varOption = strOption; // ... or it might just be a string
|
||||
}
|
||||
m_fValid = true;
|
||||
}
|
||||
|
||||
// Checked: 2012-07-28 (RLVa-1.4.7)
|
||||
class RlvCommandOptionGetPathCallback
|
||||
{
|
||||
|
|
@ -257,7 +686,7 @@ RlvCommandOptionGetPath::RlvCommandOptionGetPath(const RlvCommand& rlvCmd, getpa
|
|||
m_fValid = true; // Assume the option will be a valid one until we find out otherwise
|
||||
|
||||
// @getpath[:<option>]=<channel> => <option> is transformed to a list of inventory item UUIDs to get the path of
|
||||
RlvCommandOptionGeneric rlvCmdOption(rlvCmd.getOption());
|
||||
RlvCommandOptionGeneric rlvCmdOption = RlvCommandOptionHelper::parseOption<RlvCommandOptionGeneric>(rlvCmd.getOption());
|
||||
if (rlvCmdOption.isWearableType()) // <option> can be a clothing layer
|
||||
{
|
||||
getItemIDs(rlvCmdOption.getWearableType(), m_idItems);
|
||||
|
|
@ -266,6 +695,14 @@ RlvCommandOptionGetPath::RlvCommandOptionGetPath(const RlvCommand& rlvCmd, getpa
|
|||
{
|
||||
getItemIDs(rlvCmdOption.getAttachmentPoint(), m_idItems);
|
||||
}
|
||||
else if (rlvCmdOption.isUUID()) // ... or it can specify a specific attachment
|
||||
{
|
||||
const LLViewerObject* pAttachObj = gObjectList.findObject(rlvCmdOption.getUUID());
|
||||
if ( (pAttachObj) && (pAttachObj->isAttachment()) && (pAttachObj->permYouOwner()) )
|
||||
m_idItems.push_back(pAttachObj->getAttachmentItemID());
|
||||
else
|
||||
m_fValid = false;
|
||||
}
|
||||
else if (rlvCmdOption.isEmpty()) // ... or it can be empty (in which case we act on the object that issued the command)
|
||||
{
|
||||
const LLViewerObject* pObj = gObjectList.findObject(rlvCmd.getObjectID());
|
||||
|
|
@ -348,17 +785,6 @@ RlvCommandOptionAdjustHeight::RlvCommandOptionAdjustHeight(const RlvCommand& rlv
|
|||
}
|
||||
}
|
||||
|
||||
// Checked: 2011-03-28 (RLVa-1.3.0f) | Added: RLVa-1.3.0f
|
||||
RlvCommandOptionTpTo::RlvCommandOptionTpTo(const RlvCommand &rlvCmd)
|
||||
{
|
||||
std::vector<std::string> cmdTokens;
|
||||
boost::split(cmdTokens, rlvCmd.getOption(), boost::is_any_of(std::string("/")));
|
||||
|
||||
m_fValid = (3 == cmdTokens.size());
|
||||
for (int idxAxis = 0; (idxAxis < 3) && (m_fValid); idxAxis++)
|
||||
m_fValid &= (bool)LLStringUtil::convertToF64(cmdTokens[idxAxis], m_posGlobal[idxAxis]);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// RlvObject
|
||||
//
|
||||
|
|
@ -586,7 +1012,6 @@ void RlvForceWear::forceFolder(const LLViewerInventoryCategory* pFolder, EWearAc
|
|||
}
|
||||
break;
|
||||
|
||||
#ifdef RLV_EXTENSION_FORCEWEAR_GESTURES
|
||||
case LLAssetType::AT_GESTURE:
|
||||
if (isWearAction(eAction))
|
||||
{
|
||||
|
|
@ -599,7 +1024,6 @@ void RlvForceWear::forceFolder(const LLViewerInventoryCategory* pFolder, EWearAc
|
|||
m_remGestures.push_back(pRlvItem);
|
||||
}
|
||||
break;
|
||||
#endif // RLV_EXTENSION_FORCEWEAR_GESTURES
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
@ -619,13 +1043,13 @@ bool RlvForceWear::isForceDetachable(const LLViewerObject* pAttachObj, bool fChe
|
|||
#endif // RLV_EXPERIMENTAL_COMPOSITEFOLDERS
|
||||
return
|
||||
(
|
||||
(pAttachObj) && (pAttachObj->isAttachment())
|
||||
(pAttachObj) && (pAttachObj->isAttachment())
|
||||
&& ( (idExcept.isNull()) ? (!gRlvAttachmentLocks.isLockedAttachment(pAttachObj))
|
||||
: (!gRlvAttachmentLocks.isLockedAttachmentExcept(pAttachObj, idExcept)) )
|
||||
: (!gRlvAttachmentLocks.isLockedAttachmentExcept(pAttachObj, idExcept)) )
|
||||
&& (isStrippable(pAttachObj->getAttachmentItemID()))
|
||||
#ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS
|
||||
&& ( (!fCheckComposite) || (!RlvSettings::getEnableComposites()) ||
|
||||
(!gRlvHandler.getCompositeInfo(pAttachPt->getItemID(), NULL, &pFolder)) || (gRlvHandler.canTakeOffComposite(pFolder)) )
|
||||
(!gRlvHandler.getCompositeInfo(pAttachPt->getItemID(), NULL, &pFolder)) || (gRlvHandler.canTakeOffComposite(pFolder)) )
|
||||
#endif // RLV_EXPERIMENTAL_COMPOSITEFOLDERS
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright (c) 2009-2011, Kitty Barnett
|
||||
* 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;
|
||||
|
|
@ -25,6 +25,325 @@
|
|||
#include "rlvdefines.h"
|
||||
#include "rlvcommon.h"
|
||||
|
||||
// ============================================================================
|
||||
// RlvBehaviourInfo class - Generic behaviour descriptor (used by restrictions, reply and force commands)
|
||||
//
|
||||
|
||||
class RlvBehaviourInfo
|
||||
{
|
||||
public:
|
||||
enum EBehaviourFlags
|
||||
{
|
||||
// General behaviour flags
|
||||
BHVR_STRICT = 0x0001, // Behaviour has a "_sec" version
|
||||
BHVR_SYNONYM = 0x0002, // Behaviour is a synonym of another
|
||||
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_GENERAL_MASK = 0x0FFF,
|
||||
|
||||
// Force-wear specific flags
|
||||
FORCEWEAR_WEAR_REPLACE = 0x0001 << 16,
|
||||
FORCEWEAR_WEAR_ADD = 0x0002 << 16,
|
||||
FORCEWEAR_WEAR_REMOVE = 0x0004 << 16,
|
||||
FORCEWEAR_NODE = 0x0010 << 16,
|
||||
FORCEWEAR_SUBTREE = 0x0020 << 16,
|
||||
FORCEWEAR_CONTEXT_NONE = 0x0100 << 16,
|
||||
FORCEWEAR_CONTEXT_OBJECT = 0x0200 << 16,
|
||||
FORCEWEAR_MASK = 0xFFFF << 16
|
||||
};
|
||||
|
||||
RlvBehaviourInfo(std::string strBhvr, ERlvBehaviour eBhvr, U32 maskParamType, U32 nBhvrFlags = 0)
|
||||
: m_strBhvr(strBhvr), m_eBhvr(eBhvr), m_maskParamType(maskParamType), m_nBhvrFlags(nBhvrFlags) {}
|
||||
virtual ~RlvBehaviourInfo() {}
|
||||
|
||||
const std::string& getBehaviour() const { return m_strBhvr; }
|
||||
ERlvBehaviour getBehaviourType() const { return m_eBhvr; }
|
||||
U32 getBehaviourFlags() const { return m_nBhvrFlags; }
|
||||
U32 getParamTypeMask() const { return m_maskParamType; }
|
||||
bool hasStrict() const { return m_nBhvrFlags & BHVR_STRICT; }
|
||||
bool isBlocked() const { return m_nBhvrFlags & BHVR_BLOCKED; }
|
||||
bool isExperimental() const { return m_nBhvrFlags & BHVR_EXPERIMENTAL; }
|
||||
bool isExtended() const { return m_nBhvrFlags & BHVR_EXTENDED; }
|
||||
bool isSynonym() const { return m_nBhvrFlags & BHVR_SYNONYM; }
|
||||
void toggleBehaviourFlag(EBehaviourFlags eBhvrFlag, bool fEnable);
|
||||
|
||||
virtual ERlvCmdRet processCommand(const RlvCommand& rlvCmd) const { return RLV_RET_NO_PROCESSOR; }
|
||||
|
||||
protected:
|
||||
std::string m_strBhvr;
|
||||
ERlvBehaviour m_eBhvr;
|
||||
U32 m_nBhvrFlags;
|
||||
U32 m_maskParamType;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// RlvCommandHandler and related classes
|
||||
//
|
||||
|
||||
typedef ERlvCmdRet(RlvBhvrHandlerFunc)(const RlvCommand&, bool&);
|
||||
typedef void(RlvBhvrToggleHandlerFunc)(ERlvBehaviour, bool);
|
||||
typedef ERlvCmdRet(RlvForceHandlerFunc)(const RlvCommand&);
|
||||
typedef ERlvCmdRet(RlvReplyHandlerFunc)(const RlvCommand&, std::string&);
|
||||
|
||||
//
|
||||
// RlvCommandHandlerBaseImpl - Base implementation for each command type (the old process(AddRem|Force|Reply)Command functions)
|
||||
//
|
||||
template<ERlvParamType paramType> struct RlvCommandHandlerBaseImpl;
|
||||
template<> struct RlvCommandHandlerBaseImpl<RLV_TYPE_ADDREM> { static ERlvCmdRet processCommand(const RlvCommand&, RlvBhvrHandlerFunc*, RlvBhvrToggleHandlerFunc* = nullptr); };
|
||||
template<> struct RlvCommandHandlerBaseImpl<RLV_TYPE_FORCE> { static ERlvCmdRet processCommand(const RlvCommand&, RlvForceHandlerFunc*); };
|
||||
template<> struct RlvCommandHandlerBaseImpl<RLV_TYPE_REPLY> { static ERlvCmdRet processCommand(const RlvCommand&, RlvReplyHandlerFunc*);
|
||||
};
|
||||
|
||||
//
|
||||
// RlvCommandHandler - The actual command handler (Note that a handler is more general than a processor; a handler can - for instance - be used by multiple processors)
|
||||
//
|
||||
template <ERlvParamType paramType, ERlvBehaviour eBhvr>
|
||||
struct RlvCommandHandler
|
||||
{
|
||||
template<typename = typename std::enable_if<paramType == RLV_TYPE_ADDREM>::type> static ERlvCmdRet onCommand(const RlvCommand&, bool&);
|
||||
template<typename = typename std::enable_if<paramType == RLV_TYPE_ADDREM>::type> static void onCommandToggle(ERlvBehaviour, bool);
|
||||
template<typename = typename std::enable_if<paramType == RLV_TYPE_FORCE>::type> static ERlvCmdRet onCommand(const RlvCommand&);
|
||||
template<typename = typename std::enable_if<paramType == RLV_TYPE_REPLY>::type> static ERlvCmdRet onCommand(const RlvCommand&, std::string&);
|
||||
};
|
||||
|
||||
// Aliases to improve readability in definitions
|
||||
template<ERlvBehaviour eBhvr> using RlvBehaviourHandler = RlvCommandHandler<RLV_TYPE_ADDREM, eBhvr>;
|
||||
template<ERlvBehaviour eBhvr> using RlvBehaviourToggleHandler = RlvBehaviourHandler<eBhvr>;
|
||||
template<ERlvBehaviour eBhvr> using RlvForceHandler = RlvCommandHandler<RLV_TYPE_FORCE, eBhvr>;
|
||||
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
|
||||
|
||||
//
|
||||
// RlvCommandProcessor - Templated glue class that brings RlvBehaviourInfo, RlvCommandHandlerBaseImpl and RlvCommandHandler together
|
||||
//
|
||||
template <ERlvParamType paramType, ERlvBehaviour eBhvr, typename handlerImpl = RlvCommandHandler<paramType, eBhvr>, typename baseImpl = RlvCommandHandlerBaseImpl<paramType>>
|
||||
class RlvCommandProcessor : public RlvBehaviourInfo
|
||||
{
|
||||
public:
|
||||
// Default constructor used by behaviour specializations
|
||||
template<typename = typename std::enable_if<eBhvr != RLV_BHVR_UNKNOWN>::type>
|
||||
RlvCommandProcessor(const std::string& strBhvr, U32 nBhvrFlags = 0) : RlvBehaviourInfo(strBhvr, eBhvr, paramType, nBhvrFlags) {}
|
||||
|
||||
// Constructor used when we don't want to specialize on behaviour (see RlvBehaviourGenericProcessor)
|
||||
template<typename = typename std::enable_if<eBhvr == RLV_BHVR_UNKNOWN>::type>
|
||||
RlvCommandProcessor(const std::string& strBhvr, ERlvBehaviour eBhvr, U32 nBhvrFlags = 0) : RlvBehaviourInfo(strBhvr, eBhvr, paramType, nBhvrFlags) {}
|
||||
|
||||
ERlvCmdRet processCommand(const RlvCommand& rlvCmd) const override { return baseImpl::processCommand(rlvCmd, &handlerImpl::onCommand); }
|
||||
};
|
||||
|
||||
// Aliases to improve readability in definitions
|
||||
template<ERlvBehaviour eBhvr, typename handlerImpl = RlvCommandHandler<RLV_TYPE_ADDREM, eBhvr>> using RlvBehaviourProcessor = RlvCommandProcessor<RLV_TYPE_ADDREM, eBhvr, handlerImpl>;
|
||||
template<ERlvBehaviour eBhvr, typename handlerImpl = RlvCommandHandler<RLV_TYPE_FORCE, eBhvr>> using RlvForceProcessor = RlvCommandProcessor<RLV_TYPE_FORCE, eBhvr, handlerImpl>;
|
||||
template<ERlvBehaviour eBhvr, typename handlerImpl = RlvCommandHandler<RLV_TYPE_REPLY, eBhvr>> using RlvReplyProcessor = RlvCommandProcessor<RLV_TYPE_REPLY, eBhvr, handlerImpl>;
|
||||
|
||||
// Provides pre-defined generic implementations of basic behaviours (template voodoo - see original commit for something that still made sense)
|
||||
template<ERlvBehaviourOptionType optionType> struct RlvBehaviourGenericHandler { static ERlvCmdRet onCommand(const RlvCommand& rlvCmd, bool& fRefCount); };
|
||||
template<ERlvBehaviourOptionType optionType> using RlvBehaviourGenericProcessor = RlvBehaviourProcessor<RLV_BHVR_UNKNOWN, RlvBehaviourGenericHandler<optionType>>;
|
||||
|
||||
// ============================================================================
|
||||
// RlvBehaviourProcessor and related classes - Handles add/rem comamnds aka "restrictions)
|
||||
//
|
||||
|
||||
template <ERlvBehaviour eBhvr, ERlvBehaviourOptionType optionType, 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); }
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// RlvBehaviourModifier - stores behaviour modifiers in an - optionally - sorted list and returns the first element (or default value if there are no modifiers)
|
||||
//
|
||||
|
||||
typedef std::pair<RlvBehaviourModifierValue, LLUUID> RlvBehaviourModifierValueTuple;
|
||||
|
||||
struct RlvBehaviourModifier_Comp
|
||||
{
|
||||
virtual ~RlvBehaviourModifier_Comp() {}
|
||||
virtual bool operator()(const RlvBehaviourModifierValueTuple& lhs, const RlvBehaviourModifierValueTuple& rhs)
|
||||
{
|
||||
// Values that match the primary object take precedence (otherwise maintain relative ordering)
|
||||
if ( (rhs.second == m_idPrimaryObject) && (lhs.second != m_idPrimaryObject) )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
LLUUID m_idPrimaryObject;
|
||||
};
|
||||
struct RlvBehaviourModifier_CompMin : public RlvBehaviourModifier_Comp
|
||||
{
|
||||
bool operator()(const RlvBehaviourModifierValueTuple& lhs, const RlvBehaviourModifierValueTuple& rhs) override
|
||||
{
|
||||
if ( (m_idPrimaryObject.isNull()) || ((lhs.second == m_idPrimaryObject) && (rhs.second == m_idPrimaryObject)) )
|
||||
return lhs.first < rhs.first;
|
||||
return RlvBehaviourModifier_Comp::operator()(lhs, rhs);
|
||||
}
|
||||
};
|
||||
struct RlvBehaviourModifier_CompMax : public RlvBehaviourModifier_Comp
|
||||
{
|
||||
bool operator()(const RlvBehaviourModifierValueTuple& lhs, const RlvBehaviourModifierValueTuple& rhs) override
|
||||
{
|
||||
if ( (m_idPrimaryObject.isNull()) || ((lhs.second == m_idPrimaryObject) && (rhs.second == m_idPrimaryObject)) )
|
||||
return rhs.first < lhs.first;
|
||||
return RlvBehaviourModifier_Comp::operator()(lhs, rhs);
|
||||
}
|
||||
};
|
||||
|
||||
class RlvBehaviourModifier
|
||||
{
|
||||
public:
|
||||
RlvBehaviourModifier(const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator);
|
||||
virtual ~RlvBehaviourModifier() {}
|
||||
|
||||
/*
|
||||
* Member functions
|
||||
*/
|
||||
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; }
|
||||
const RlvBehaviourModifierValue& getDefaultValue() const { return m_DefaultValue; }
|
||||
const RlvBehaviourModifierValue& getValue() const { return (!m_Values.empty()) ? 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);
|
||||
|
||||
typedef boost::signals2::signal<void(const RlvBehaviourModifierValue& newValue)> change_signal_t;
|
||||
change_signal_t& getSignal() { return m_ChangeSignal; }
|
||||
|
||||
/*
|
||||
* Member variables
|
||||
*/
|
||||
protected:
|
||||
RlvBehaviourModifierValue m_DefaultValue;
|
||||
bool m_fAddDefaultOnEmpty;
|
||||
std::list<RlvBehaviourModifierValueTuple> m_Values;
|
||||
change_signal_t m_ChangeSignal;
|
||||
RlvBehaviourModifier_Comp* m_pValueComparator;
|
||||
};
|
||||
|
||||
template<ERlvBehaviourModifier eBhvrMod>
|
||||
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) {}
|
||||
protected:
|
||||
void onValueChange() const override;
|
||||
};
|
||||
|
||||
// Inspired by LLControlCache<T>
|
||||
template<typename T>
|
||||
class RlvBehaviourModifierCache : public LLRefCount, public LLInstanceTracker<RlvBehaviourModifierCache<T>, ERlvBehaviourModifier>
|
||||
{
|
||||
public:
|
||||
RlvBehaviourModifierCache(ERlvBehaviourModifier eModifier)
|
||||
: LLInstanceTracker<RlvBehaviourModifierCache<T>, ERlvBehaviourModifier>(eModifier)
|
||||
{
|
||||
RlvBehaviourModifier* pBhvrModifier = (eModifier < RLV_MODIFIER_COUNT) ? RlvBehaviourDictionary::instance().getModifier(eModifier) : nullptr;
|
||||
if (pBhvrModifier)
|
||||
{
|
||||
mConnection = pBhvrModifier->getSignal().connect(boost::bind(&RlvBehaviourModifierCache<T>::handleValueChange, this, _1));
|
||||
mCachedValue = pBhvrModifier->getValue<T>();
|
||||
}
|
||||
else
|
||||
{
|
||||
mCachedValue = {};
|
||||
}
|
||||
}
|
||||
~RlvBehaviourModifierCache() {}
|
||||
|
||||
/*
|
||||
* Member functions
|
||||
*/
|
||||
public:
|
||||
const T& getValue() const { return mCachedValue; }
|
||||
protected:
|
||||
void handleValueChange(const RlvBehaviourModifierValue& newValue) { mCachedValue = boost::get<T>(newValue); }
|
||||
|
||||
/*
|
||||
* Member variables
|
||||
*/
|
||||
protected:
|
||||
T mCachedValue;
|
||||
boost::signals2::scoped_connection mConnection;
|
||||
};
|
||||
|
||||
// Inspired by LLCachedControl<T>
|
||||
template <typename T>
|
||||
class RlvCachedBehaviourModifier
|
||||
{
|
||||
public:
|
||||
RlvCachedBehaviourModifier(ERlvBehaviourModifier eModifier)
|
||||
{
|
||||
if ((mCachedModifierPtr = RlvBehaviourModifierCache<T>::getInstance(eModifier)) == nullptr)
|
||||
mCachedModifierPtr = new RlvBehaviourModifierCache<T>(eModifier);
|
||||
}
|
||||
|
||||
/*
|
||||
* Operators
|
||||
*/
|
||||
public:
|
||||
operator const T&() const { return mCachedModifierPtr->getValue(); }
|
||||
const T& operator()() { return mCachedModifierPtr->getValue(); }
|
||||
|
||||
/*
|
||||
* Member variables
|
||||
*/
|
||||
protected:
|
||||
LLPointer<RlvBehaviourModifierCache<T>> mCachedModifierPtr;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// RlvBehaviourDictionary and related classes
|
||||
//
|
||||
|
||||
class RlvBehaviourDictionary : public LLSingleton<RlvBehaviourDictionary>
|
||||
{
|
||||
friend class LLSingleton<RlvBehaviourDictionary>;
|
||||
protected:
|
||||
RlvBehaviourDictionary();
|
||||
~RlvBehaviourDictionary();
|
||||
public:
|
||||
void addEntry(const RlvBehaviourInfo* pEntry);
|
||||
void addModifier(ERlvBehaviour eBhvr, ERlvBehaviourModifier eModifier, RlvBehaviourModifier* pModifierEntry);
|
||||
|
||||
/*
|
||||
* General helper functions
|
||||
*/
|
||||
public:
|
||||
ERlvBehaviour getBehaviourFromString(const std::string& strBhvr, ERlvParamType eParamType, bool* pfStrict = NULL) const;
|
||||
const RlvBehaviourInfo* getBehaviourInfo(const std::string& strBhvr, ERlvParamType eParamType, bool* pfStrict = NULL) const;
|
||||
bool getCommands(const std::string& strMatch, ERlvParamType eParamType, std::list<std::string>& cmdList) const;
|
||||
bool getHasStrict(ERlvBehaviour eBhvr) const;
|
||||
RlvBehaviourModifier* getModifier(ERlvBehaviourModifier eBhvrMod) const { return (eBhvrMod < RLV_MODIFIER_COUNT) ? m_BehaviourModifiers[eBhvrMod] : nullptr; }
|
||||
RlvBehaviourModifier* getModifierFromBehaviour(ERlvBehaviour eBhvr) const;
|
||||
void toggleBehaviourFlag(const std::string& strBhvr, ERlvParamType eParamType, RlvBehaviourInfo::EBehaviourFlags eBvhrFlag, bool fEnable);
|
||||
|
||||
/*
|
||||
* Member variables
|
||||
*/
|
||||
protected:
|
||||
typedef std::list<const RlvBehaviourInfo*> rlv_bhvrinfo_list_t;
|
||||
typedef std::map<std::pair<std::string, ERlvParamType>, const RlvBehaviourInfo*> rlv_string2info_map_t;
|
||||
typedef std::multimap<ERlvBehaviour, const RlvBehaviourInfo*> rlv_bhvr2info_map_t;
|
||||
typedef std::map<ERlvBehaviour, ERlvBehaviourModifier> rlv_bhvr2mod_map_t;
|
||||
|
||||
rlv_bhvrinfo_list_t m_BhvrInfoList;
|
||||
rlv_string2info_map_t m_String2InfoMap;
|
||||
rlv_bhvr2info_map_t m_Bhvr2InfoMap;
|
||||
rlv_bhvr2mod_map_t m_Bhvr2ModifierMap;
|
||||
RlvBehaviourModifier* m_BehaviourModifiers[RLV_MODIFIER_COUNT];
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// RlvCommand
|
||||
//
|
||||
|
|
@ -39,24 +358,20 @@ public:
|
|||
*/
|
||||
public:
|
||||
std::string asString() const;
|
||||
const std::string& getBehaviour() const { return m_strBehaviour; }
|
||||
ERlvBehaviour getBehaviourType() const { return m_eBehaviour; }
|
||||
const std::string& getBehaviour() const { return (m_pBhvrInfo) ? m_pBhvrInfo->getBehaviour() : LLStringUtil::null; }
|
||||
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; }
|
||||
const std::string& getOption() const { return m_strOption; }
|
||||
const std::string& getParam() const { return m_strParam; }
|
||||
ERlvParamType getParamType() const { return m_eParamType; }
|
||||
ERlvCmdRet getReturnType() const { return m_eRet; }
|
||||
bool hasOption() const { return !m_strOption.empty(); }
|
||||
bool isBlocked() const { return (m_pBhvrInfo) ? m_pBhvrInfo->isBlocked() : false; }
|
||||
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; }
|
||||
|
||||
typedef std::map<std::string, ERlvBehaviour> bhvr_map_t;
|
||||
static ERlvBehaviour getBehaviourFromString(const std::string& strBhvr, bool* pfStrict = NULL);
|
||||
static bool getCommands(bhvr_map_t& cmdList, const std::string& strMatch);
|
||||
static const std::string& getStringFromBehaviour(ERlvBehaviour eBhvr);
|
||||
static bool hasStrictVariant(ERlvBehaviour eBhvr);
|
||||
|
||||
static void initLookupTable();
|
||||
protected:
|
||||
static bool parseCommand(const std::string& strCommand, std::string& strBehaviour, std::string& strOption, std::string& strParam);
|
||||
|
||||
|
|
@ -70,24 +385,61 @@ public:
|
|||
* Member variables
|
||||
*/
|
||||
protected:
|
||||
bool m_fValid;
|
||||
LLUUID m_idObj;
|
||||
std::string m_strBehaviour;
|
||||
ERlvBehaviour m_eBehaviour;
|
||||
bool m_fStrict;
|
||||
std::string m_strOption;
|
||||
std::string m_strParam;
|
||||
ERlvParamType m_eParamType;
|
||||
ERlvCmdRet m_eRet;
|
||||
|
||||
static bhvr_map_t m_BhvrMap;
|
||||
bool m_fValid;
|
||||
LLUUID m_idObj;
|
||||
const RlvBehaviourInfo* m_pBhvrInfo;
|
||||
ERlvParamType m_eParamType;
|
||||
bool m_fStrict;
|
||||
std::string m_strOption;
|
||||
std::string m_strParam;
|
||||
ERlvCmdRet m_eRet;
|
||||
|
||||
friend class RlvHandler;
|
||||
friend class RlvObject;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// RlvCommandOption (and derived classed)
|
||||
// Command option parsing utility classes
|
||||
//
|
||||
|
||||
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);
|
||||
static bool parseStringList(const std::string& strOption, std::vector<std::string>& optionList, const std::string& strSeparator = std::string(RLV_OPTION_SEPARATOR));
|
||||
};
|
||||
|
||||
struct RlvCommandOptionGeneric
|
||||
{
|
||||
bool isAttachmentPoint() const { return (!isEmpty()) && (typeid(LLViewerJointAttachment*) == m_varOption.type()); }
|
||||
bool isAttachmentPointGroup() const { return (!isEmpty()) && (typeid(ERlvAttachGroupType) == m_varOption.type()); }
|
||||
bool isEmpty() const { return m_varOption.empty(); }
|
||||
bool isNumber() const { return (!isEmpty()) && (typeid(float) == m_varOption.type()); }
|
||||
bool isSharedFolder() const { return (!isEmpty()) && (typeid(LLViewerInventoryCategory*) == m_varOption.type()); }
|
||||
bool isString() const { return (!isEmpty()) && (typeid(std::string) == m_varOption.type()); }
|
||||
bool isUUID() const { return (!isEmpty()) && (typeid(LLUUID) == m_varOption.type()); }
|
||||
bool isVector() const { return (!isEmpty()) && (typeid(LLVector3d) == m_varOption.type()); }
|
||||
bool isWearableType() const { return (!isEmpty()) && (typeid(LLWearableType::EType) == m_varOption.type()); }
|
||||
|
||||
LLViewerJointAttachment* getAttachmentPoint() const { return (isAttachmentPoint()) ? boost::get<LLViewerJointAttachment*>(m_varOption) : NULL; }
|
||||
ERlvAttachGroupType getAttachmentPointGroup() const { return (isAttachmentPointGroup()) ? boost::get<ERlvAttachGroupType>(m_varOption) : RLV_ATTACHGROUP_INVALID; }
|
||||
LLViewerInventoryCategory* getSharedFolder() const { return (isSharedFolder()) ? boost::get<LLViewerInventoryCategory*>(m_varOption) : NULL; }
|
||||
float getNumber() const { return (isNumber()) ? boost::get<float>(m_varOption) : 0.0f; }
|
||||
const std::string& getString() const { return (isString()) ? boost::get<std::string>(m_varOption) : LLStringUtil::null; }
|
||||
const LLUUID& getUUID() const { return (isUUID()) ? boost::get<LLUUID>(m_varOption) : LLUUID::null; }
|
||||
const LLVector3d& getVector() const { return (isVector()) ? boost::get<LLVector3d>(m_varOption) : LLVector3d::zero; }
|
||||
LLWearableType::EType getWearableType() const { return (isWearableType()) ? boost::get<LLWearableType::EType>(m_varOption) : LLWearableType::WT_INVALID; }
|
||||
|
||||
typedef boost::variant<LLViewerJointAttachment*, ERlvAttachGroupType, LLViewerInventoryCategory*, std::string, LLUUID, LLWearableType::EType, LLVector3d, float> rlv_option_generic_t;
|
||||
void operator=(const rlv_option_generic_t& optionValue) { m_varOption = optionValue; }
|
||||
protected:
|
||||
rlv_option_generic_t m_varOption;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// Command option parsing utility classes (these still need refactoring to fit the new methodology)
|
||||
//
|
||||
|
||||
struct RlvCommandOption
|
||||
|
|
@ -104,36 +456,6 @@ protected:
|
|||
bool m_fValid;
|
||||
};
|
||||
|
||||
struct RlvCommandOptionGeneric : public RlvCommandOption
|
||||
{
|
||||
explicit RlvCommandOptionGeneric(const std::string& strOption);
|
||||
|
||||
bool isAttachmentPoint() const { return (!isEmpty()) && (typeid(LLViewerJointAttachment*) == m_varOption.type()); }
|
||||
bool isAttachmentPointGroup() const { return (!isEmpty()) && (typeid(ERlvAttachGroupType) == m_varOption.type()); }
|
||||
bool isEmpty() const { return m_fEmpty; }
|
||||
bool isSharedFolder() const { return (!isEmpty()) && (typeid(LLViewerInventoryCategory*) == m_varOption.type()); }
|
||||
bool isString() const { return (!isEmpty()) && (typeid(std::string) == m_varOption.type()); }
|
||||
bool isUUID() const { return (!isEmpty()) && (typeid(LLUUID) == m_varOption.type()); }
|
||||
bool isWearableType() const { return (!isEmpty()) && (typeid(LLWearableType::EType) == m_varOption.type()); }
|
||||
|
||||
LLViewerJointAttachment* getAttachmentPoint() const
|
||||
{ return (isAttachmentPoint()) ? boost::get<LLViewerJointAttachment*>(m_varOption) : NULL; }
|
||||
ERlvAttachGroupType getAttachmentPointGroup() const
|
||||
{ return (isAttachmentPointGroup()) ? boost::get<ERlvAttachGroupType>(m_varOption) : RLV_ATTACHGROUP_INVALID; }
|
||||
LLViewerInventoryCategory* getSharedFolder() const
|
||||
{ return (isSharedFolder()) ? boost::get<LLViewerInventoryCategory*>(m_varOption) : NULL; }
|
||||
const std::string& getString() const
|
||||
{ return (isString()) ? boost::get<std::string>(m_varOption) : LLStringUtil::null; }
|
||||
const LLUUID& getUUID() const
|
||||
{ return (isUUID()) ? boost::get<LLUUID>(m_varOption) : LLUUID::null; }
|
||||
LLWearableType::EType getWearableType() const
|
||||
{ return (isWearableType()) ? boost::get<LLWearableType::EType>(m_varOption) : LLWearableType::WT_INVALID; }
|
||||
|
||||
protected:
|
||||
bool m_fEmpty;
|
||||
boost::variant<LLViewerJointAttachment*, ERlvAttachGroupType, LLViewerInventoryCategory*, std::string, LLUUID, LLWearableType::EType> m_varOption;
|
||||
};
|
||||
|
||||
struct RlvCommandOptionGetPath : public RlvCommandOption
|
||||
{
|
||||
typedef boost::function<void(const uuid_vec_t&)> getpath_callback_t;
|
||||
|
|
@ -161,13 +483,6 @@ struct RlvCommandOptionAdjustHeight : public RlvCommandOption
|
|||
F32 m_nPelvisToFootOffset;
|
||||
};
|
||||
|
||||
struct RlvCommandOptionTpTo : public RlvCommandOption
|
||||
{
|
||||
RlvCommandOptionTpTo(const RlvCommand& rlvCmd);
|
||||
|
||||
LLVector3d m_posGlobal;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// RlvObject
|
||||
//
|
||||
|
|
@ -189,10 +504,16 @@ public:
|
|||
bool hasBehaviour(ERlvBehaviour eBehaviour, bool fStrictOnly) const;
|
||||
bool hasBehaviour(ERlvBehaviour eBehaviour, const std::string& strOption, bool fStrictOnly) const;
|
||||
|
||||
const rlv_command_list_t* getCommandList() const { return &m_Commands; }
|
||||
|
||||
const LLUUID& getObjectID() const { return m_idObj; }
|
||||
const LLUUID& getRootID() const { return m_idRoot; }
|
||||
/*
|
||||
* Accessors
|
||||
*/
|
||||
public:
|
||||
S32 getAttachPt() const { return m_idxAttachPt; }
|
||||
const LLUUID& getObjectID() const { return m_idObj; }
|
||||
const LLUUID& getRootID() const { return m_idRoot; }
|
||||
bool hasLookup() const { return m_fLookup; }
|
||||
const rlv_command_list_t* getCommandList() const { return &m_Commands; }
|
||||
|
||||
/*
|
||||
* Member variables
|
||||
|
|
@ -431,39 +752,30 @@ std::string rlvGetLastParenthesisedText(const std::string& strText, std::string:
|
|||
// Inlined class member functions
|
||||
//
|
||||
|
||||
inline void RlvBehaviourInfo::toggleBehaviourFlag(EBehaviourFlags eBhvrFlag, bool fEnable)
|
||||
{
|
||||
if (fEnable)
|
||||
m_nBhvrFlags |= eBhvrFlag;
|
||||
else
|
||||
m_nBhvrFlags &= ~eBhvrFlag;
|
||||
}
|
||||
|
||||
// Checked: 2009-09-19 (RLVa-1.0.3d)
|
||||
inline std::string RlvCommand::asString() const
|
||||
{
|
||||
// NOTE: @clear=<param> should be represented as clear:<param>
|
||||
return (m_eParamType != RLV_TYPE_CLEAR)
|
||||
? (!m_strOption.empty()) ? (std::string(m_strBehaviour)).append(":").append(m_strOption) : (std::string(m_strBehaviour))
|
||||
: (!m_strParam.empty()) ? (std::string(m_strBehaviour)).append(":").append(m_strParam) : (std::string(m_strBehaviour));
|
||||
? (!m_strOption.empty()) ? (std::string(getBehaviour())).append(":").append(m_strOption) : (std::string(getBehaviour()))
|
||||
: (!m_strParam.empty()) ? (std::string(getBehaviour())).append(":").append(m_strParam) : (std::string(getBehaviour()));
|
||||
}
|
||||
|
||||
inline bool RlvCommand::operator ==(const RlvCommand& rhs) const
|
||||
{
|
||||
// The specification notes that "@detach=n" is semantically identical to "@detach=add" (same for "y" and "rem"
|
||||
return (m_strBehaviour == rhs.m_strBehaviour) && (m_strOption == rhs.m_strOption) &&
|
||||
return (getBehaviour() == rhs.getBehaviour()) && (m_strOption == rhs.m_strOption) &&
|
||||
( (RLV_TYPE_UNKNOWN != m_eParamType) ? (m_eParamType == rhs.m_eParamType) : (m_strParam == rhs.m_strParam) );
|
||||
}
|
||||
|
||||
inline bool RlvCommand::hasStrictVariant(ERlvBehaviour eBhvr)
|
||||
{
|
||||
switch (eBhvr)
|
||||
{
|
||||
case RLV_BHVR_RECVCHAT:
|
||||
case RLV_BHVR_RECVEMOTE:
|
||||
case RLV_BHVR_RECVIM:
|
||||
case RLV_BHVR_SENDIM:
|
||||
case RLV_BHVR_TPLURE:
|
||||
case RLV_BHVR_TPREQUEST:
|
||||
case RLV_BHVR_SENDCHANNEL:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Checked: 2010-04-05 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d
|
||||
inline bool RlvForceWear::isWearableItem(const LLInventoryItem* pItem)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include "llagent.h"
|
||||
#include "llappearancemgr.h"
|
||||
#include "llstartup.h"
|
||||
#include "llviewermessage.h"
|
||||
#include "llviewerfoldertype.h"
|
||||
|
||||
#include "rlvinventory.h"
|
||||
|
|
@ -364,6 +365,27 @@ S32 RlvInventory::getDirectDescendentsItemCount(const LLInventoryCategory* pFold
|
|||
return cntType;
|
||||
}
|
||||
|
||||
// Checked: 2012-11-28 (RLVa-1.4.8)
|
||||
bool RlvInventory::isGiveToRLVOffer(const LLOfferInfo& offerInfo)
|
||||
{
|
||||
if ( (!RlvSettings::getForbidGiveToRLV()) && (RlvInventory::instance().getSharedRoot()) )
|
||||
{
|
||||
if (offerInfo.mFromObject)
|
||||
{
|
||||
return
|
||||
(IM_TASK_INVENTORY_OFFERED == offerInfo.mIM) &&
|
||||
(LLAssetType::AT_CATEGORY == offerInfo.mType) && (offerInfo.mDesc.find(RLV_PUTINV_PREFIX) == 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return
|
||||
(IM_INVENTORY_OFFERED == offerInfo.mIM) &&
|
||||
(LLAssetType::AT_CATEGORY == offerInfo.mType) && (offerInfo.mDesc.find(RLV_PUTINV_PREFIX) == 0);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// RlvRenameOnWearObserver member functions
|
||||
//
|
||||
|
|
@ -809,12 +831,9 @@ bool RlvWearableItemCollector::onCollectItem(const LLInventoryItem* pItem)
|
|||
(m_Folded.end() != std::find(m_Folded.begin(), m_Folded.end(), idParent)) ) &&
|
||||
( (!fAttach) || (RlvAttachPtLookup::hasAttachPointName(pItem)) || (RlvSettings::getEnableSharedWear()) );
|
||||
break;
|
||||
#ifdef RLV_EXTENSION_FORCEWEAR_GESTURES
|
||||
case LLAssetType::AT_GESTURE:
|
||||
fRet = (m_Wearable.end() != std::find(m_Wearable.begin(), m_Wearable.end(), idParent));
|
||||
break;
|
||||
#endif // RLV_EXTENSION_FORCEWEAR_GESTURES
|
||||
#ifdef RLV_EXTENSION_FORCEWEAR_FOLDERLINKS
|
||||
case LLAssetType::AT_CATEGORY:
|
||||
if (LLAssetType::AT_LINK_FOLDER == pItem->getActualType())
|
||||
{
|
||||
|
|
@ -831,7 +850,6 @@ bool RlvWearableItemCollector::onCollectItem(const LLInventoryItem* pItem)
|
|||
}
|
||||
}
|
||||
break;
|
||||
#endif // RLV_EXTENSION_FORCEWEAR_FOLDERLINKS
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
#include "rlvhelper.h"
|
||||
#include "rlvlocks.h"
|
||||
|
||||
class LLOfferInfo;
|
||||
|
||||
// ============================================================================
|
||||
// RlvInventory class declaration
|
||||
//
|
||||
|
|
@ -60,6 +62,8 @@ public:
|
|||
std::string getSharedPath(const LLUUID& idFolder) const;
|
||||
// Returns TRUE if the supplied folder is a descendent of the #RLV folder
|
||||
bool isSharedFolder(const LLUUID& idFolder);
|
||||
// Returns TRUE if the inventory offer is a "give to #RLV" offer
|
||||
bool isGiveToRLVOffer(const LLOfferInfo& offerInfo);
|
||||
|
||||
/*
|
||||
* Inventory fetching
|
||||
|
|
|
|||
|
|
@ -19,22 +19,15 @@
|
|||
#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 "llenvmanager.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 "lloutfitslist.h" // "My Outfits" sidebar panel
|
||||
#include "llpaneloutfitsinventory.h" // "My Appearance" sidebar panel
|
||||
#include "llpanelpeople.h" // "People" sidebar panel
|
||||
#include "llpanelwearing.h" // "Current Outfit" sidebar panel
|
||||
#include "llparcel.h"
|
||||
#include "llpaneltopinfobar.h"
|
||||
#include "llsidepanelappearance.h"
|
||||
#include "lltabcontainer.h"
|
||||
#include "llteleporthistory.h"
|
||||
#include "lltoolmgr.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llvoavatar.h"
|
||||
|
|
@ -70,11 +63,6 @@ RlvUIEnabler::RlvUIEnabler()
|
|||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_VIEWTEXTURE, boost::bind(&RlvUIEnabler::onToggleViewXXX, this)));
|
||||
|
||||
// onToggleXXX
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_EDIT, boost::bind(&RlvUIEnabler::onToggleEdit, this)));
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SENDIM, boost::bind(&RlvUIEnabler::onToggleSendIM, this)));
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SETDEBUG, boost::bind(&RlvUIEnabler::onToggleSetDebug, this)));
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SETENV, boost::bind(&RlvUIEnabler::onToggleSetEnv, this)));
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWINV, boost::bind(&RlvUIEnabler::onToggleShowInv, this, _1)));
|
||||
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)));
|
||||
|
|
@ -86,10 +74,8 @@ RlvUIEnabler::RlvUIEnabler()
|
|||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_TPLM, boost::bind(&RlvUIEnabler::onToggleTp, this)));
|
||||
|
||||
// onUpdateLoginLastLocation
|
||||
#ifdef RLV_EXTENSION_STARTLOCATION
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_TPLOC, boost::bind(&RlvUIEnabler::onUpdateLoginLastLocation, this, _1)));
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_UNSIT, boost::bind(&RlvUIEnabler::onUpdateLoginLastLocation, this, _1)));
|
||||
#endif // RLV_EXTENSION_STARTLOCATION
|
||||
}
|
||||
|
||||
// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a
|
||||
|
|
@ -112,32 +98,6 @@ void RlvUIEnabler::onRefreshHoverText()
|
|||
LLHUDText::refreshAllObjectText();
|
||||
}
|
||||
|
||||
// Checked: 2010-03-17 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
|
||||
void RlvUIEnabler::onToggleEdit()
|
||||
{
|
||||
bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_EDIT);
|
||||
|
||||
if (!fEnable)
|
||||
{
|
||||
// Turn off "View / Highlight Transparent"
|
||||
LLDrawPoolAlpha::sShowDebugAlpha = FALSE;
|
||||
|
||||
// Hide the beacons floater if it's currently visible
|
||||
if (LLFloaterReg::instanceVisible("beacons"))
|
||||
LLFloaterReg::hideInstance("beacons");
|
||||
|
||||
// Hide the build floater if it's currently visible
|
||||
if (LLFloaterReg::instanceVisible("build"))
|
||||
LLToolMgr::instance().toggleBuildMode();
|
||||
}
|
||||
|
||||
// Start or stop filtering opening the beacons floater
|
||||
if (!fEnable)
|
||||
addGenericFloaterFilter("beacons");
|
||||
else
|
||||
removeGenericFloaterFilter("beacons");
|
||||
}
|
||||
|
||||
// Checked: 2010-03-02 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a
|
||||
void RlvUIEnabler::onToggleMovement()
|
||||
{
|
||||
|
|
@ -152,113 +112,6 @@ void RlvUIEnabler::onToggleMovement()
|
|||
LLFloaterMove::sUpdateMovementStatus();
|
||||
}
|
||||
|
||||
// Checked: 2013-05-11 (RLVa-1.4.9)
|
||||
void RlvUIEnabler::onToggleSendIM()
|
||||
{
|
||||
bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM);
|
||||
gSavedPerAccountSettings.getControl("DoNotDisturbModeResponse")->setHiddenFromSettingsEditor(!fEnable);
|
||||
}
|
||||
|
||||
// Checked: 2011-05-28 (RLVa-1.4.0a) | Added: RLVa-1.4.0a
|
||||
void RlvUIEnabler::onToggleSetDebug()
|
||||
{
|
||||
bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SETDEBUG);
|
||||
for (std::map<std::string, S16>::const_iterator itSetting = RlvExtGetSet::m_DbgAllowed.begin();
|
||||
itSetting != RlvExtGetSet::m_DbgAllowed.end(); ++itSetting)
|
||||
{
|
||||
if (itSetting->second & RlvExtGetSet::DBG_WRITE)
|
||||
gSavedSettings.getControl(itSetting->first)->setHiddenFromSettingsEditor(!fEnable);
|
||||
}
|
||||
}
|
||||
|
||||
// Checked: 2011-09-04 (RLVa-1.4.1a) | Modified: RLVa-1.4.1a
|
||||
void RlvUIEnabler::onToggleSetEnv()
|
||||
{
|
||||
bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SETENV);
|
||||
|
||||
const std::string strEnvFloaters[] =
|
||||
{ "env_post_process", "env_settings", "env_delete_preset", "env_edit_sky", "env_edit_water", "env_edit_day_cycle" };
|
||||
for (int idxFloater = 0, cntFloater = sizeof(strEnvFloaters) / sizeof(std::string); idxFloater < cntFloater; idxFloater++)
|
||||
{
|
||||
if (!fEnable)
|
||||
{
|
||||
// Hide the floater if it's currently visible
|
||||
if (LLFloaterReg::instanceVisible(strEnvFloaters[idxFloater]))
|
||||
LLFloaterReg::hideInstance(strEnvFloaters[idxFloater]);
|
||||
|
||||
addGenericFloaterFilter(strEnvFloaters[idxFloater]);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeGenericFloaterFilter(strEnvFloaters[idxFloater]);
|
||||
}
|
||||
}
|
||||
|
||||
// Don't allow toggling "Basic Shaders" and/or "Atmopsheric Shaders" through the debug settings under @setenv=n
|
||||
gSavedSettings.getControl("VertexShaderEnable")->setHiddenFromSettingsEditor(!fEnable);
|
||||
gSavedSettings.getControl("WindLightUseAtmosShaders")->setHiddenFromSettingsEditor(!fEnable);
|
||||
|
||||
// Restore the user's WindLight preferences when releasing
|
||||
if (fEnable)
|
||||
LLEnvManagerNew::instance().usePrefs();
|
||||
}
|
||||
|
||||
// Checked: 2011-11-04 (RLVa-1.4.4a) | Modified: RLVa-1.4.4a
|
||||
void RlvUIEnabler::onToggleShowInv(bool fQuitting)
|
||||
{
|
||||
if (fQuitting)
|
||||
return; // Nothing to do if the viewer is shutting down
|
||||
|
||||
bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV);
|
||||
|
||||
//
|
||||
// When disabling, close any inventory floaters that may be open
|
||||
//
|
||||
if (!fEnable)
|
||||
{
|
||||
LLFloaterReg::const_instance_list_t lFloaters = LLFloaterReg::getFloaterList("inventory");
|
||||
for (LLFloaterReg::const_instance_list_t::const_iterator itFloater = lFloaters.begin(); itFloater != lFloaters.end(); ++itFloater)
|
||||
(*itFloater)->closeFloater();
|
||||
}
|
||||
|
||||
//
|
||||
// Enable/disable the "My Outfits" panel on the "My Appearance" sidebar tab
|
||||
//
|
||||
LLPanelOutfitsInventory* pAppearancePanel = LLPanelOutfitsInventory::findInstance();
|
||||
RLV_ASSERT(pAppearancePanel);
|
||||
if (pAppearancePanel)
|
||||
{
|
||||
LLTabContainer* pAppearanceTabs = pAppearancePanel->getAppearanceTabs();
|
||||
LLOutfitsList* pMyOutfitsPanel = pAppearancePanel->getMyOutfitsPanel();
|
||||
if ( (pAppearanceTabs) && (pMyOutfitsPanel) )
|
||||
{
|
||||
S32 idxTab = pAppearanceTabs->getIndexForPanel(pMyOutfitsPanel);
|
||||
RLV_ASSERT(-1 != idxTab);
|
||||
pAppearanceTabs->enableTabButton(idxTab, fEnable);
|
||||
|
||||
// When disabling, switch to the COF tab if "My Outfits" is currently active
|
||||
if ( (!fEnable) && (pAppearanceTabs->getCurrentPanelIndex() == idxTab) )
|
||||
pAppearanceTabs->selectTabPanel(pAppearancePanel->getCurrentOutfitPanel());
|
||||
}
|
||||
|
||||
LLSidepanelAppearance* pCOFPanel = pAppearancePanel->getAppearanceSP();
|
||||
RLV_ASSERT(pCOFPanel);
|
||||
if ( (!fEnable) && (pCOFPanel) && (pCOFPanel->isOutfitEditPanelVisible()) )
|
||||
{
|
||||
// TODO-RLVa: we should really just be collapsing the "Add more..." inventory panel (and disable the button)
|
||||
pCOFPanel->showOutfitsInventoryPanel();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Filter (or stop filtering) opening new inventory floaters
|
||||
//
|
||||
if (!fEnable)
|
||||
addGenericFloaterFilter("inventory");
|
||||
else
|
||||
removeGenericFloaterFilter("inventory");
|
||||
}
|
||||
|
||||
// Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
|
||||
void RlvUIEnabler::onToggleShowLoc()
|
||||
{
|
||||
|
|
@ -414,7 +267,10 @@ void RlvUIEnabler::onToggleShowWorldMap()
|
|||
void RlvUIEnabler::onToggleTp()
|
||||
{
|
||||
// Disable the navigation bar "Home" button if both @tplm=n *and* @tploc=n restricted
|
||||
LLButton* pNavBarHomeBtn = LLNavigationBar::getInstance()->findChild<LLButton>("home_btn");
|
||||
// <FS:Zi> Make navigation bar part of the UI
|
||||
// LLButton* pNavBarHomeBtn = LLNavigationBar::getInstance()->findChild<LLButton>("home_btn");
|
||||
LLButton* pNavBarHomeBtn = LLNavigationBar::instance().getView()->findChild<LLButton>("home_btn");
|
||||
// </FS:Zi>
|
||||
RLV_ASSERT(pNavBarHomeBtn);
|
||||
if (pNavBarHomeBtn)
|
||||
pNavBarHomeBtn->setEnabled(!(gRlvHandler.hasBehaviour(RLV_BHVR_TPLM) && gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)));
|
||||
|
|
|
|||
|
|
@ -44,12 +44,7 @@ public:
|
|||
*/
|
||||
protected:
|
||||
void onRefreshHoverText(); // showloc, shownames, showhovertext(all|world|hud)
|
||||
void onToggleEdit(); // edit
|
||||
void onToggleMovement(); // fly, alwaysrun and temprun
|
||||
void onToggleSendIM(); // sendim
|
||||
void onToggleSetDebug(); // setdebug
|
||||
void onToggleSetEnv(); // setenv
|
||||
void onToggleShowInv(bool fQuitting); // showinv
|
||||
void onToggleShowLoc(); // showloc
|
||||
void onToggleShowMinimap(); // showminimap
|
||||
void onToggleShowNames(bool fQuitting); // shownames
|
||||
|
|
@ -62,10 +57,11 @@ protected:
|
|||
/*
|
||||
* Floater and sidebar validation callbacks
|
||||
*/
|
||||
protected:
|
||||
public:
|
||||
void addGenericFloaterFilter(const std::string& strFloaterName);
|
||||
void removeGenericFloaterFilter(const std::string& strFloaterName);
|
||||
|
||||
protected:
|
||||
bool filterFloaterGeneric(const std::string&, const LLSD&);
|
||||
boost::signals2::connection m_ConnFloaterGeneric;
|
||||
bool filterFloaterShowLoc(const std::string&, const LLSD& );
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater
|
||||
can_resize="true"
|
||||
height="400"
|
||||
layout="topleft"
|
||||
min_height="300"
|
||||
min_width="300"
|
||||
name="rlv_console"
|
||||
title="RLVa console"
|
||||
width="600"
|
||||
>
|
||||
<text_editor
|
||||
follows="all"
|
||||
left="10"
|
||||
length="1"
|
||||
font="Monospace"
|
||||
height="366"
|
||||
ignore_tab="false"
|
||||
layout="topleft"
|
||||
max_length="65536"
|
||||
name="console_output"
|
||||
read_only="true"
|
||||
track_end="true"
|
||||
type="string"
|
||||
width="576"
|
||||
word_wrap="true"
|
||||
>
|
||||
</text_editor>
|
||||
<line_editor
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
bottom_delta="20"
|
||||
follows="left|right|bottom"
|
||||
font="SansSerif"
|
||||
height="19"
|
||||
layout="topleft"
|
||||
max_length="127"
|
||||
name="console_input"
|
||||
top_delta="0"
|
||||
width="576"
|
||||
>
|
||||
</line_editor>
|
||||
</floater>
|
||||
|
|
@ -2301,6 +2301,16 @@
|
|||
parameter="RLVaWearReplaceUnlocked" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator />
|
||||
<menu_item_check
|
||||
label="Console..."
|
||||
name="Console">
|
||||
<menu_item_check.on_check
|
||||
function="Floater.Visible"
|
||||
parameter="rlv_console" />
|
||||
<menu_item_check.on_click
|
||||
function="Floater.Toggle"
|
||||
parameter="rlv_console" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Restrictions..."
|
||||
name="Restrictions">
|
||||
|
|
|
|||
|
|
@ -110,28 +110,6 @@
|
|||
<key>customizable</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
|
||||
<!-- System messages -->
|
||||
<key>message_toggle_restart</key>
|
||||
<map>
|
||||
<key>value</key>
|
||||
<string>RestrainedLove Support will be %s after you restart</string>
|
||||
</map>
|
||||
<key>message_toggle_restart_pending</key>
|
||||
<map>
|
||||
<key>value</key>
|
||||
<string> (pending restart)</string>
|
||||
</map>
|
||||
<key>message_toggle_restart_enabled</key>
|
||||
<map>
|
||||
<key>value</key>
|
||||
<string>enabled</string>
|
||||
</map>
|
||||
<key>message_toggle_restart_disabled</key>
|
||||
<map>
|
||||
<key>value</key>
|
||||
<string>disabled</string>
|
||||
</map>
|
||||
</map>
|
||||
|
||||
<!-- Generic names used to replace resident names when @shownames restricted -->
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ You are at [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_L
|
|||
SLURL: <nolink>[SLURL]</nolink>
|
||||
(global coordinates [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1])
|
||||
[SERVER_VERSION]
|
||||
[SERVER_RELEASE_NOTES_URL]
|
||||
</string>
|
||||
<string name="AboutPositionRLVShowLoc">
|
||||
You are in [REGION]
|
||||
[SERVER_VERSION]
|
||||
[SERVER_RELEASE_NOTES_URL]
|
||||
</string>
|
||||
<!-- *NOTE: Do not translate text like GPU, Graphics Card, etc -
|
||||
|
|
@ -2703,6 +2708,12 @@ Try enclosing path to the editor with double quotes.
|
|||
<!-- Spell check settings floater -->
|
||||
<string name="UserDictionary">[User]</string>
|
||||
|
||||
<!-- RLVa -->
|
||||
<string name="RLVaPendingRestart"> (pending restart)</string>
|
||||
<string name="RLVaToggleMessage">RestrainedLove Support will be %s after you restart</string>
|
||||
<string name="RLVaToggleEnabled">enabled</string>
|
||||
<string name="RLVaToggleDisabled">disabled</string>
|
||||
|
||||
<!-- Experience Tools strings -->
|
||||
<string name="experience_tools_experience">Experience</string>
|
||||
<string name="ExperienceNameNull">(no experience)</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue