[RLVa] Miscellaneous other touches to rlva code
This commit is contained in:
@@ -263,11 +263,11 @@ RlvCommandOptionGetPath::RlvCommandOptionGetPath(const RlvCommand& rlvCmd, getpa
|
||||
RlvCommandOptionGeneric rlvCmdOption(rlvCmd.getOption());
|
||||
if (rlvCmdOption.isWearableType()) // <option> can be a clothing layer
|
||||
{
|
||||
getItemIDs(rlvCmdOption.getWearableType(), m_idItems, false);
|
||||
getItemIDs(rlvCmdOption.getWearableType(), m_idItems);
|
||||
}
|
||||
else if (rlvCmdOption.isAttachmentPoint()) // ... or it can specify an attachment point
|
||||
{
|
||||
getItemIDs(rlvCmdOption.getAttachmentPoint(), m_idItems, false);
|
||||
getItemIDs(rlvCmdOption.getAttachmentPoint(), m_idItems);
|
||||
}
|
||||
else if (rlvCmdOption.isEmpty()) // ... or it can be empty (in which case we act on the object that issued the command)
|
||||
{
|
||||
@@ -296,53 +296,40 @@ RlvCommandOptionGetPath::RlvCommandOptionGetPath(const RlvCommand& rlvCmd, getpa
|
||||
}
|
||||
}
|
||||
|
||||
// Checked: 2010-11-30 (RLVa-1.3.0b) | Modified: RLVa-1.3.0b
|
||||
bool RlvCommandOptionGetPath::getItemIDs(const LLViewerJointAttachment* pAttachPt, uuid_vec_t& idItems, bool fClear)
|
||||
// Checked: 2013-10-12 (RLVa-1.4.9)
|
||||
bool RlvCommandOptionGetPath::getItemIDs(const LLViewerJointAttachment* pAttachPt, uuid_vec_t& idItems)
|
||||
{
|
||||
if (fClear)
|
||||
idItems.clear();
|
||||
uuid_vec_t::size_type cntItemsPrev = idItems.size();
|
||||
if (pAttachPt)
|
||||
|
||||
LLInventoryModel::cat_array_t folders; LLInventoryModel::item_array_t items;
|
||||
RlvFindAttachmentsOnPoint f(pAttachPt);
|
||||
gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), folders, items, false, f);
|
||||
for (LLInventoryModel::item_array_t::const_iterator itItem = items.begin(); itItem != items.end(); ++itItem)
|
||||
{
|
||||
for (LLViewerJointAttachment::attachedobjs_vec_t::const_iterator itAttachObj = pAttachPt->mAttachedObjects.begin();
|
||||
itAttachObj != pAttachPt->mAttachedObjects.end(); ++itAttachObj)
|
||||
{
|
||||
idItems.push_back((*itAttachObj)->getAttachmentItemID());
|
||||
}
|
||||
const LLViewerInventoryItem* pItem = *itItem;
|
||||
if (pItem)
|
||||
idItems.push_back(pItem->getLinkedUUID());
|
||||
}
|
||||
|
||||
return (cntItemsPrev != idItems.size());
|
||||
}
|
||||
|
||||
// Checked: 2010-11-30 (RLVa-1.3.0b) | Modified: RLVa-1.3.0b
|
||||
bool RlvCommandOptionGetPath::getItemIDs(LLWearableType::EType wtType, uuid_vec_t& idItems, bool fClear)
|
||||
// Checked: 2013-10-12 (RLVa-1.4.9)
|
||||
bool RlvCommandOptionGetPath::getItemIDs(LLWearableType::EType wtType, uuid_vec_t& idItems)
|
||||
{
|
||||
if (fClear)
|
||||
idItems.clear();
|
||||
uuid_vec_t::size_type cntItemsPrev = idItems.size();
|
||||
for (S32 idxWearable = 0, cntWearable = gAgentWearables.getWearableCount(wtType); idxWearable < cntWearable; idxWearable++)
|
||||
{
|
||||
idItems.push_back(gAgentWearables.getWearableItemID(wtType, idxWearable));
|
||||
}
|
||||
return (cntItemsPrev != idItems.size());
|
||||
}
|
||||
|
||||
// Checked: 2011-03-28 (RLVa-1.3.0f) | Added: RLVa-1.3.0f
|
||||
RlvCommandOptionAdjustHeight::RlvCommandOptionAdjustHeight(const RlvCommand& rlvCmd)
|
||||
: m_nPelvisToFoot(0.0f), m_nPelvisToFootDeltaMult(0.0f), m_nPelvisToFootOffset(0.0f)
|
||||
{
|
||||
std::vector<std::string> cmdTokens;
|
||||
boost::split(cmdTokens, rlvCmd.getOption(), boost::is_any_of(std::string(";")));
|
||||
if (1 == cmdTokens.size())
|
||||
LLInventoryModel::cat_array_t folders; LLInventoryModel::item_array_t items;
|
||||
LLFindWearablesOfType f(wtType);
|
||||
gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), folders, items, false, f);
|
||||
for (LLInventoryModel::item_array_t::const_iterator itItem = items.begin(); itItem != items.end(); ++itItem)
|
||||
{
|
||||
m_fValid = (LLStringUtil::convertToF32(cmdTokens[0], m_nPelvisToFootOffset));
|
||||
m_nPelvisToFootOffset = llclamp<F32>(m_nPelvisToFootOffset / 100, -1.0f, 1.0f);
|
||||
}
|
||||
else if ( (2 <= cmdTokens.size()) && (cmdTokens.size() <= 3) )
|
||||
{
|
||||
m_fValid = (LLStringUtil::convertToF32(cmdTokens[0], m_nPelvisToFoot)) &&
|
||||
(LLStringUtil::convertToF32(cmdTokens[1], m_nPelvisToFootDeltaMult)) &&
|
||||
( (2 == cmdTokens.size()) || (LLStringUtil::convertToF32(cmdTokens[2], m_nPelvisToFootOffset)) );
|
||||
const LLViewerInventoryItem* pItem = *itItem;
|
||||
if (pItem)
|
||||
idItems.push_back(pItem->getLinkedUUID());
|
||||
}
|
||||
|
||||
return (cntItemsPrev != idItems.size());
|
||||
}
|
||||
|
||||
// Checked: 2011-03-28 (RLVa-1.3.0f) | Added: RLVa-1.3.0f
|
||||
|
||||
@@ -127,7 +127,7 @@ struct RlvCommandOptionGeneric : public RlvCommandOption
|
||||
{ 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
|
||||
LLWearableType::EType getWearableType() const
|
||||
{ return (isWearableType()) ? boost::get<LLWearableType::EType>(m_varOption) : LLWearableType::WT_INVALID; }
|
||||
|
||||
protected:
|
||||
@@ -144,8 +144,9 @@ struct RlvCommandOptionGetPath : public RlvCommandOption
|
||||
/*virtual*/ bool isEmpty() const { return m_idItems.empty(); }
|
||||
const uuid_vec_t& getItemIDs() const { return m_idItems; }
|
||||
|
||||
static bool getItemIDs(const LLViewerJointAttachment* pAttachPt, uuid_vec_t& idItems, bool fClear = true);
|
||||
static bool getItemIDs(LLWearableType::EType wtType, uuid_vec_t& idItems, bool fClear = true);
|
||||
// NOTE: Both functions are COF-based rather than items gathered from mAttachedObjects or gAgentWearables
|
||||
static bool getItemIDs(const LLViewerJointAttachment* pAttachPt, uuid_vec_t& idItems);
|
||||
static bool getItemIDs(LLWearableType::EType wtType, uuid_vec_t& idItems);
|
||||
|
||||
protected:
|
||||
bool m_fCallback; // TRUE if a callback is schedueled
|
||||
|
||||
@@ -787,3 +787,19 @@ bool RlvWearableItemCollector::operator()(LLInventoryCategory* pFolder, LLInvent
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// General purpose inventory helper classes
|
||||
//
|
||||
|
||||
// Checked: 2013-10-12 (RLVa-1.4.9)
|
||||
bool RlvFindAttachmentsOnPoint::operator()(LLInventoryCategory* pFolder, LLInventoryItem* pItem)
|
||||
{
|
||||
#ifndef RLV_DEPRECATE_ATTACHPTNAMING
|
||||
// First check if the item is attached to the attachment point; fall back to the item name otherwise
|
||||
return (pItem) && (LLAssetType::AT_OBJECT == pItem->getType()) &&
|
||||
( ((m_pAttachPt) && (m_pAttachPt->getAttachedObject(pItem->getLinkedUUID()))) || (RlvAttachPtLookup::getAttachPoint(pItem) == m_pAttachPt) );
|
||||
#else
|
||||
return (pItem) && (LLAssetType::AT_OBJECT == pItem->getType()) && (m_pAttachPt) && (m_pAttachPt->getAttachedObject(pItem->getLinkedUUID()));
|
||||
#endif // RLV_DEPRECATE_LEGACY_ATTACHPT
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
@@ -234,10 +234,21 @@ class RlvIsLinkType : public LLInventoryCollectFunctor
|
||||
{
|
||||
public:
|
||||
RlvIsLinkType() {}
|
||||
virtual ~RlvIsLinkType() {}
|
||||
/*virtual*/ ~RlvIsLinkType() {}
|
||||
virtual bool operator()(LLInventoryCategory* pFolder, LLInventoryItem* pItem) { return (pItem) && (pItem->getIsLinkType()); }
|
||||
};
|
||||
|
||||
// If the attachment item is linked in COF but isn't worn (or just detached) the function will return inconsistent information
|
||||
class RlvFindAttachmentsOnPoint : public LLInventoryCollectFunctor
|
||||
{
|
||||
public:
|
||||
RlvFindAttachmentsOnPoint(const LLViewerJointAttachment* pAttachPt) : m_pAttachPt(pAttachPt) {}
|
||||
/*virtual*/ ~RlvFindAttachmentsOnPoint() {}
|
||||
virtual bool operator()(LLInventoryCategory* pFolder, LLInventoryItem* pItem);
|
||||
protected:
|
||||
const LLViewerJointAttachment* m_pAttachPt;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// RlvInventory inlined member functions
|
||||
//
|
||||
|
||||
@@ -250,6 +250,7 @@ bool RlvAttachmentLocks::canAttach() const
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Checked: 2010-08-07 (RLVa-1.2.0i) | Modified: RLVa-1.2.0i
|
||||
bool RlvAttachmentLocks::canDetach(const LLViewerJointAttachment* pAttachPt, bool fDetachAll /*=false*/) const
|
||||
{
|
||||
@@ -1143,7 +1144,7 @@ bool RlvFolderLocks::getLockedFolders(const folderlock_source_t& lockSource, LLI
|
||||
case ST_WEARABLETYPE:
|
||||
{
|
||||
RLV_ASSERT( ((ST_ATTACHMENTPOINT == lockSource.first) && (typeid(S32) == lockSource.second.type())) ||
|
||||
((ST_WEARABLETYPE == lockSource.first) && (typeid(LLWearableType::EType) == lockSource.second.type())) );
|
||||
((ST_WEARABLETYPE == lockSource.first) && (typeid(LLWearableType::EType) == lockSource.second.type())) );
|
||||
|
||||
uuid_vec_t idItems;
|
||||
if (ST_ATTACHMENTPOINT == lockSource.first)
|
||||
|
||||
Reference in New Issue
Block a user