|
|
|
|
@ -119,8 +119,40 @@ void LLInitialWearablesFetch::processContents()
|
|
|
|
|
gInventory.collectDescendentsIf(mComplete.front(), cat_array, wearable_array,
|
|
|
|
|
LLInventoryModel::EXCLUDE_TRASH, is_wearable);
|
|
|
|
|
|
|
|
|
|
// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-05-18 (Catznip-2.6.0a) | Modified: Catznip-2.0.0h
|
|
|
|
|
// NOTE: don't use the current COF contents if 'wearable_array' is empty (ie first logon with 2.0 or some other problem)
|
|
|
|
|
bool fUpdateFromCOF = !wearable_array.empty();
|
|
|
|
|
if (fUpdateFromCOF)
|
|
|
|
|
{
|
|
|
|
|
LLAppearanceMgr::wearables_by_type_t items_by_type(LLWearableType::WT_COUNT);
|
|
|
|
|
LLAppearanceMgr::sortItemsByActualDescription(wearable_array);
|
|
|
|
|
LLAppearanceMgr::divvyWearablesByType(wearable_array, items_by_type);
|
|
|
|
|
|
|
|
|
|
// Compare the COF wearables against the initial wearables
|
|
|
|
|
for (initial_wearable_data_vec_t::const_iterator itWearableData = mAgentInitialWearables.begin();
|
|
|
|
|
(itWearableData != mAgentInitialWearables.end()) && (fUpdateFromCOF); ++itWearableData)
|
|
|
|
|
{
|
|
|
|
|
const LLUUID& idItem = itWearableData->mItemID; bool fFound = false;
|
|
|
|
|
for (S32 idxItem = 0, cntItem = items_by_type[itWearableData->mType].size(); idxItem < cntItem; idxItem++)
|
|
|
|
|
{
|
|
|
|
|
const LLViewerInventoryItem* pCOFItem = items_by_type[itWearableData->mType].get(idxItem);
|
|
|
|
|
if (idItem == pCOFItem->getLinkedUUID())
|
|
|
|
|
{
|
|
|
|
|
fFound = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!fFound)
|
|
|
|
|
fUpdateFromCOF = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// [/SL:KB]
|
|
|
|
|
|
|
|
|
|
LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true);
|
|
|
|
|
if (wearable_array.count() > 0)
|
|
|
|
|
// if (wearable_array.count() > 0)
|
|
|
|
|
// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-28 (Catznip-2.6.0a) | Modified: Catznip-2.0.0e
|
|
|
|
|
if (fUpdateFromCOF)
|
|
|
|
|
// [/SL:KB]
|
|
|
|
|
{
|
|
|
|
|
gAgentWearables.notifyLoadingStarted();
|
|
|
|
|
LLAppearanceMgr::instance().updateAppearanceFromCOF();
|
|
|
|
|
@ -147,7 +179,7 @@ public:
|
|
|
|
|
virtual void done()
|
|
|
|
|
{
|
|
|
|
|
gInventory.removeObserver(this);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
// Link to all fetched items in COF.
|
|
|
|
|
LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy;
|
|
|
|
|
for (uuid_vec_t::iterator it = mIDs.begin();
|
|
|
|
|
@ -170,7 +202,33 @@ public:
|
|
|
|
|
LLAssetType::AT_LINK,
|
|
|
|
|
link_waiter);
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-08-14 (Catznip-2.6.0a) | Added: Catznip-2.1.1d
|
|
|
|
|
doOnIdleOneTime(boost::bind(&LLFetchAndLinkObserver::doneIdle, this));
|
|
|
|
|
// [/SL:KB]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-02 (Catznip-2.6.0a) | Added: Catznip-2.0.0a
|
|
|
|
|
void doneIdle()
|
|
|
|
|
{
|
|
|
|
|
// NOTE: the code above makes the assumption that COF is empty which won't be the case the way it's used now
|
|
|
|
|
LLInventoryModel::item_array_t initial_items;
|
|
|
|
|
for (uuid_vec_t::iterator itItem = mIDs.begin(); itItem != mIDs.end(); ++itItem)
|
|
|
|
|
{
|
|
|
|
|
LLViewerInventoryItem* pItem = gInventory.getItem(*itItem);
|
|
|
|
|
if (!pItem)
|
|
|
|
|
{
|
|
|
|
|
llwarns << "fetch failed!" << llendl;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
initial_items.push_back(pItem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LLAppearanceMgr::instance().updateAppearanceFromInitialWearables(initial_items);
|
|
|
|
|
|
|
|
|
|
delete this;
|
|
|
|
|
}
|
|
|
|
|
// [/SL:KB]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void LLInitialWearablesFetch::processWearablesMessage()
|
|
|
|
|
@ -182,7 +240,11 @@ void LLInitialWearablesFetch::processWearablesMessage()
|
|
|
|
|
for (U8 i = 0; i < mAgentInitialWearables.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
// Populate the current outfit folder with links to the wearables passed in the message
|
|
|
|
|
InitialWearableData *wearable_data = new InitialWearableData(mAgentInitialWearables[i]); // This will be deleted in the callback.
|
|
|
|
|
// InitialWearableData *wearable_data = new InitialWearableData(mAgentInitialWearables[i]); // This will be deleted in the callback.
|
|
|
|
|
// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-05-02 (Catznip-2.6.0a) | Added: Catznip-2.0.0f
|
|
|
|
|
// Fixes minor leak: since COF is used onInitialWearableAssetArrived() will never get called and "wearable_data" leaks
|
|
|
|
|
InitialWearableData* wearable_data = &mAgentInitialWearables[i];
|
|
|
|
|
// [/SL:KB]
|
|
|
|
|
|
|
|
|
|
if (wearable_data->mAssetID.notNull())
|
|
|
|
|
{
|
|
|
|
|
@ -192,7 +254,7 @@ void LLInitialWearablesFetch::processWearablesMessage()
|
|
|
|
|
{
|
|
|
|
|
llinfos << "Invalid wearable, type " << wearable_data->mType << " itemID "
|
|
|
|
|
<< wearable_data->mItemID << " assetID " << wearable_data->mAssetID << llendl;
|
|
|
|
|
delete wearable_data;
|
|
|
|
|
// delete wearable_data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|