本文整理汇总了C++中LLWearableItemsList::updateChangedItems方法的典型用法代码示例。如果您正苦于以下问题:C++ LLWearableItemsList::updateChangedItems方法的具体用法?C++ LLWearableItemsList::updateChangedItems怎么用?C++ LLWearableItemsList::updateChangedItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLWearableItemsList
的用法示例。
在下文中一共展示了LLWearableItemsList::updateChangedItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCOFChanged
void LLOutfitsList::onCOFChanged()
{
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
// Collect current COF items
gInventory.collectDescendents(
LLAppearanceMgr::instance().getCOF(),
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH);
uuid_vec_t vnew;
uuid_vec_t vadded;
uuid_vec_t vremoved;
// From gInventory we get the UUIDs of links that are currently in COF.
// These links UUIDs are not the same UUIDs that we have in each wearable items list.
// So we collect base items' UUIDs to find them or links that point to them in wearable
// items lists and update their worn state there.
for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin();
iter != item_array.end();
++iter)
{
vnew.push_back((*iter)->getLinkedUUID());
}
// We need to update only items that were added or removed from COF.
LLCommonUtils::computeDifference(vnew, mCOFLinkedItems, vadded, vremoved);
// Store the ids of items currently linked from COF.
mCOFLinkedItems = vnew;
for (outfits_map_t::iterator iter = mOutfitsMap.begin();
iter != mOutfitsMap.end();
++iter)
{
LLAccordionCtrlTab* tab = iter->second;
if (!tab) continue;
LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
if (!list) continue;
// Append removed ids to added ids because we should update all of them.
vadded.reserve(vadded.size() + vremoved.size());
vadded.insert(vadded.end(), vremoved.begin(), vremoved.end());
// Every list updates the labels of changed items or
// the links that point to these items.
list->updateChangedItems(vadded);
}
}
示例2: onCOFChanged
void LLOutfitsList::onCOFChanged()
{
LLInventoryModel::changed_items_t changed_linked_items;
const LLInventoryModel::changed_items_t& changed_items = gInventory.getChangedIDs();
for (LLInventoryModel::changed_items_t::const_iterator iter = changed_items.begin();
iter != changed_items.end();
++iter)
{
LLViewerInventoryItem* item = gInventory.getItem(*iter);
if (item)
{
// From gInventory we get the UUIDs of new links added to COF
// or removed from COF. These links UUIDs are not the same UUIDs
// that we have in each wearable items list. So we collect base items
// UUIDs to find all items or links that point to same base items in wearable
// items lists and update their worn state there.
changed_linked_items.insert(item->getLinkedUUID());
}
}
for (outfits_map_t::iterator iter = mOutfitsMap.begin();
iter != mOutfitsMap.end();
++iter)
{
LLAccordionCtrlTab* tab = iter->second;
if (!tab) continue;
LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
if (!list) continue;
// Every list updates the labels of changed items or
// the links that point to these items.
list->updateChangedItems(changed_linked_items);
}
}