本文整理汇总了C++中LLInventoryItem::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ LLInventoryItem::getType方法的具体用法?C++ LLInventoryItem::getType怎么用?C++ LLInventoryItem::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLInventoryItem
的用法示例。
在下文中一共展示了LLInventoryItem::getType方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bindEmbeddedChars
void LLEmbeddedItems::bindEmbeddedChars( const LLFontGL* font ) const
{
if( sEntries.empty() )
{
return;
}
for (std::set<llwchar>::const_iterator iter1 = mEmbeddedUsedChars.begin(); iter1 != mEmbeddedUsedChars.end(); ++iter1)
{
llwchar wch = *iter1;
item_map_t::iterator iter2 = sEntries.find(wch);
if (iter2 == sEntries.end())
{
continue;
}
LLInventoryItem* item = iter2->second.mItem;
if (!item)
{
continue;
}
LLUIImagePtr image = get_item_icon(item->getType(),
item->getInventoryType(),
0,
item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS);//LLUI::getUIImage(img_name);
font->addEmbeddedChar( wch, image->getImage(), item->getName() );
}
}
示例2: showAddedLandmarkInfo
void LLPanelPlaces::showAddedLandmarkInfo(const uuid_vec_t& items)
{
for (uuid_vec_t::const_iterator item_iter = items.begin();
item_iter != items.end();
++item_iter)
{
const LLUUID& item_id = (*item_iter);
if(!highlight_offered_object(item_id))
{
continue;
}
LLInventoryItem* item = gInventory.getItem(item_id);
llassert(item);
if (item && (LLAssetType::AT_LANDMARK == item->getType()) )
{
// Created landmark is passed to Places panel to allow its editing.
// If the panel is closed we don't reopen it until created landmark is loaded.
if("create_landmark" == getPlaceInfoType() && !getItem())
{
setItem(item);
}
}
}
}
示例3: handleInventory
void LLFloaterCompileQueue::handleInventory(LLViewerObject *viewer_object,
InventoryObjectList* inv)
{
// find all of the lsl, leaving off duplicates. We'll remove
// all matching asset uuids on compilation success.
typedef std::multimap<LLUUID, LLPointer<LLInventoryItem> > uuid_item_map;
uuid_item_map asset_item_map;
InventoryObjectList::const_iterator it = inv->begin();
InventoryObjectList::const_iterator end = inv->end();
for ( ; it != end; ++it)
{
if((*it)->getType() == LLAssetType::AT_LSL_TEXT)
{
LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
// Check permissions before allowing the user to retrieve data.
if (item->getPermissions().allowModifyBy(gAgent.getID(), gAgent.getGroupID()) &&
item->getPermissions().allowCopyBy(gAgent.getID(), gAgent.getGroupID()) )
{
LLPointer<LLViewerInventoryItem> script = new LLViewerInventoryItem(item);
mCurrentScripts.put(script);
asset_item_map.insert(std::make_pair(item->getAssetUUID(), item));
}
}
}
if (asset_item_map.empty())
{
// There are no scripts in this object. move on.
nextObject();
}
else
{
// request all of the assets.
uuid_item_map::iterator iter;
for(iter = asset_item_map.begin(); iter != asset_item_map.end(); iter++)
{
LLInventoryItem *itemp = iter->second;
LLScriptQueueData* datap = new LLScriptQueueData(getID(),
itemp->getName(),
viewer_object->getID(),
itemp->getUUID());
//llinfos << "ITEM NAME 2: " << names.get(i) << llendl;
gAssetStorage->getInvItemAsset(viewer_object->getRegion()->getHost(),
gAgent.getID(),
gAgent.getSessionID(),
itemp->getPermissions().getOwner(),
viewer_object->getID(),
itemp->getUUID(),
itemp->getAssetUUID(),
itemp->getType(),
LLFloaterCompileQueue::scriptArrived,
(void*)datap);
}
}
}
示例4: handleDragAndDrop
BOOL LLPanelOutfitEdit::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg)
{
if (cargo_data == NULL)
{
llwarns << "cargo_data is NULL" << llendl;
return TRUE;
}
switch (cargo_type)
{
case DAD_BODYPART:
case DAD_CLOTHING:
case DAD_OBJECT:
case DAD_LINK:
*accept = ACCEPT_YES_MULTI;
break;
default:
*accept = ACCEPT_NO;
}
if (drop)
{
LLInventoryItem* item = static_cast<LLInventoryItem*>(cargo_data);
if (LLAssetType::lookupIsAssetIDKnowable(item->getType()))
{
mCOFDragAndDropObserver->watchAsset(item->getAssetUUID());
/*
* Adding request to wear item. If the item is a link, then getLinkedUUID() will
* return the ID of the linked item. Otherwise it will return the item's ID. The
* second argument is used to delay the appearance update until all dragged items
* are added to optimize user experience.
*/
LLAppearanceMgr::instance().addCOFItemLink(item->getLinkedUUID(), false);
}
else
{
// if asset id is not available for the item we must wear it immediately (attachments only)
LLAppearanceMgr::instance().addCOFItemLink(item->getLinkedUUID(), true);
}
}
return TRUE;
}
示例5: getItemImage
LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const
{
LLInventoryItem* item = getEmbeddedItemPtr(ext_char);
if (item)
{
const char* img_name = "";
switch( item->getType() )
{
case LLAssetType::AT_TEXTURE:
if(item->getInventoryType() == LLInventoryType::IT_SNAPSHOT)
{
img_name = "Inv_Snapshot";
}
else
{
img_name = "Inv_Texture";
}
break;
case LLAssetType::AT_SOUND: img_name = "Inv_Sound"; break;
case LLAssetType::AT_CLOTHING: img_name = "Inv_Clothing"; break;
case LLAssetType::AT_OBJECT:
img_name = LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS & item->getFlags() ?
"Inv_Object_Multi" : "Inv_Object";
break;
case LLAssetType::AT_CALLINGCARD: img_name = "Inv_CallingCard"; break;
case LLAssetType::AT_LANDMARK: img_name = "Inv_Landmark"; break;
case LLAssetType::AT_NOTECARD: img_name = "Inv_Notecard"; break;
case LLAssetType::AT_LSL_TEXT: img_name = "Inv_Script"; break;
case LLAssetType::AT_BODYPART: img_name = "Inv_Skin"; break;
case LLAssetType::AT_ANIMATION: img_name = "Inv_Animation"; break;
case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break;
case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break;
default: img_name = "Inv_Invalid"; break; // use the Inv_Invalid icon for undefined object types (see MAINT-3981)
}
return LLUI::getUIImage(img_name);
}
return LLUIImagePtr();
}
示例6:
/*virtual*/ void done()
{
std::vector<LLUUID>::const_iterator it = mAdded.begin(), end = mAdded.end();
for(; it != end; ++it)
{
LLInventoryItem* item = gInventory.getItem(*it);
if (!item || item->getType() != LLAssetType::AT_LANDMARK)
continue;
// Start loading the landmark.
LLLandmark* lm = gLandmarkList.getAsset(
item->getAssetUUID(),
boost::bind(&LLLocationInputCtrl::onLandmarkLoaded, mInput, _1));
if (lm)
{
// Already loaded? Great, handle it immediately (the callback won't be called).
mInput->onLandmarkLoaded(lm);
}
}
mAdded.clear();
}
示例7: buildNewViews
LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id)
{
LLInventoryObject const* objectp = gInventory.getObject(id);
LLUUID root_id = mFolderRoot.get()->getListener()->getUUID();
LLFolderViewFolder* parent_folder = NULL;
LLFolderViewItem* itemp = NULL;
if (id == root_id)
{
parent_folder = mFolderRoot.get();
}
else if (objectp)
{
const LLUUID &parent_id = objectp->getParentUUID();
parent_folder = (LLFolderViewFolder*)mFolderRoot.get()->getItemByID(parent_id);
if (parent_folder)
{
if (objectp->getType() <= LLAssetType::AT_NONE ||
objectp->getType() >= LLAssetType::AT_COUNT)
{
llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : "
<< ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID()
<< llendl;
return NULL;
}
if ((objectp->getType() == LLAssetType::AT_CATEGORY) &&
(objectp->getActualType() != LLAssetType::AT_LINK_FOLDER))
{
LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(),
objectp->getType(),
LLInventoryType::IT_CATEGORY,
this,
mFolderRoot.get(),
objectp->getUUID());
if (new_listener)
{
LLFolderViewFolder* folderp = createFolderViewFolder(new_listener);
if (folderp)
{
folderp->setItemSortOrder(mFolderRoot.get()->getSortOrder());
}
itemp = folderp;
}
}
else
{
// Build new view for item.
LLInventoryItem* item = (LLInventoryItem*)objectp;
LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(),
item->getActualType(),
item->getInventoryType(),
this,
mFolderRoot.get(),
item->getUUID(),
item->getFlags());
if (new_listener)
{
itemp = createFolderViewItem(new_listener);
}
}
if (itemp)
{
itemp->addToFolder(parent_folder, mFolderRoot.get());
}
}
}
// If this is a folder, add the children of the folder and recursively add any
// child folders.
if (id.isNull()
|| (objectp
&& objectp->getType() == LLAssetType::AT_CATEGORY))
{
LLViewerInventoryCategory::cat_array_t* categories;
LLViewerInventoryItem::item_array_t* items;
mInventory->lockDirectDescendentArrays(id, categories, items);
if(categories)
{
for (LLViewerInventoryCategory::cat_array_t::const_iterator cat_iter = categories->begin();
cat_iter != categories->end();
++cat_iter)
{
const LLViewerInventoryCategory* cat = (*cat_iter);
buildNewViews(cat->getUUID());
}
}
if(items && parent_folder)
{
for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin();
item_iter != items->end();
++item_iter)
{
const LLViewerInventoryItem* item = (*item_iter);
buildNewViews(item->getUUID());
//.........这里部分代码省略.........
示例8: buildNewViews
void LLInventoryPanel::buildNewViews(const LLUUID& id)
{
LLFolderViewItem* itemp = NULL;
LLInventoryObject* objectp = gInventory.getObject(id);
if (objectp)
{
if (objectp->getType() <= LLAssetType::AT_NONE ||
objectp->getType() >= LLAssetType::AT_COUNT)
{
llwarns << "LLInventoryPanel::buildNewViews called with objectp->mType == "
<< ((S32) objectp->getType())
<< " (shouldn't happen)" << llendl;
}
else if (objectp->getType() == LLAssetType::AT_CATEGORY) // build new view for category
{
LLInvFVBridge* new_listener = LLInvFVBridge::createBridge(objectp->getType(),
LLInventoryType::IT_CATEGORY,
this,
objectp->getUUID());
if (new_listener)
{
LLFolderViewFolder* folderp = new LLFolderViewFolder(new_listener->getDisplayName(),
new_listener->getIcon(),
mFolders,
new_listener);
folderp->setItemSortOrder(mFolders->getSortOrder());
itemp = folderp;
}
}
else // build new view for item
{
LLInventoryItem* item = (LLInventoryItem*)objectp;
LLInvFVBridge* new_listener = LLInvFVBridge::createBridge(
item->getType(),
item->getInventoryType(),
this,
item->getUUID(),
item->getFlags());
if (new_listener)
{
itemp = new LLFolderViewItem(new_listener->getDisplayName(),
new_listener->getIcon(),
new_listener->getCreationDate(),
mFolders,
new_listener);
}
}
LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolders->getItemByID(objectp->getParentUUID());
if (itemp)
{
if (parent_folder)
{
itemp->addToFolder(parent_folder, mFolders);
}
else
{
llwarns << "Couldn't find parent folder for child " << itemp->getLabel() << llendl;
delete itemp;
}
}
}
if ((id.isNull() ||
(objectp && objectp->getType() == LLAssetType::AT_CATEGORY)))
{
LLViewerInventoryCategory::cat_array_t* categories;
LLViewerInventoryItem::item_array_t* items;
mInventory->lockDirectDescendentArrays(id, categories, items);
if(categories)
{
S32 count = categories->count();
for(S32 i = 0; i < count; ++i)
{
LLInventoryCategory* cat = categories->get(i);
buildNewViews(cat->getUUID());
}
}
if(items)
{
S32 count = items->count();
for(S32 i = 0; i < count; ++i)
{
LLInventoryItem* item = items->get(i);
buildNewViews(item->getUUID());
}
}
mInventory->unlockDirectDescendentArrays(id);
}
}
示例9: bindEmbeddedChars
void LLEmbeddedItems::bindEmbeddedChars( const LLFontGL* font ) const
{
if( sEntries.empty() )
{
return;
}
for (std::set<llwchar>::const_iterator iter1 = mEmbeddedUsedChars.begin(); iter1 != mEmbeddedUsedChars.end(); ++iter1)
{
llwchar wch = *iter1;
item_map_t::iterator iter2 = sEntries.find(wch);
if (iter2 == sEntries.end())
{
continue;
}
LLInventoryItem* item = iter2->second.mItem;
if (!item)
{
continue;
}
const char* img_name;
switch( item->getType() )
{
case LLAssetType::AT_TEXTURE:
if(item->getInventoryType() == LLInventoryType::IT_SNAPSHOT)
{
img_name = "inv_item_snapshot.tga";
}
else
{
img_name = "inv_item_texture.tga";
}
break;
case LLAssetType::AT_SOUND: img_name = "inv_item_sound.tga"; break;
case LLAssetType::AT_CALLINGCARD: img_name = "inv_item_callingcard_online.tga"; break;
case LLAssetType::AT_LANDMARK:
if (item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED)
{
img_name = "inv_item_landmark_visited.tga";
}
else
{
img_name = "inv_item_landmark.tga";
}
break;
case LLAssetType::AT_CLOTHING: img_name = "inv_item_clothing.tga"; break;
case LLAssetType::AT_OBJECT:
if (item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
{
img_name = "inv_item_object_multi.tga";
}
else
{
img_name = "inv_item_object.tga";
}
break;
case LLAssetType::AT_NOTECARD: img_name = "inv_item_notecard.tga"; break;
case LLAssetType::AT_LSL_TEXT: img_name = "inv_item_script.tga"; break;
case LLAssetType::AT_BODYPART: img_name = "inv_item_skin.tga"; break;
case LLAssetType::AT_ANIMATION: img_name = "inv_item_animation.tga";break;
case LLAssetType::AT_GESTURE: img_name = "inv_item_gesture.tga"; break;
default: llassert(0); continue;
}
LLUIImagePtr image = LLUI::getUIImage(img_name);
font->addEmbeddedChar( wch, image->getImage(), item->getName() );
}
}
示例10: onClickGetItems
// <edit>
// static
void LLPreviewNotecard::onClickGetItems(void* user_data)
{
LLPreviewNotecard* preview = static_cast<LLPreviewNotecard*>(user_data);
if (LLViewerTextEditor* editor = preview->findChild<LLViewerTextEditor>("Notecard Editor"))
{
std::vector<LLPointer<LLInventoryItem> > items = editor->getEmbeddedItems();
if (items.size())
{
std::vector<LLPointer<LLInventoryItem> >::iterator iter = items.begin();
std::vector<LLPointer<LLInventoryItem> >::iterator end = items.end();
for ( ; iter != end; ++iter)
{
LLInventoryItem* item = static_cast<LLInventoryItem*>(*iter);
#if 0 //use_caps
{
copy_inventory_from_notecard(LLUUID::null, preview->getObjectID(), preview->getNotecardItemID(), item, 0);
}
#else
{
// Only one item per message actually works
gMessageSystem->newMessageFast(_PREHASH_CopyInventoryFromNotecard);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_NotecardData);
gMessageSystem->addUUIDFast(_PREHASH_NotecardItemID, preview->getNotecardItemID());
gMessageSystem->addUUIDFast(_PREHASH_ObjectID, preview->getObjectID());
gMessageSystem->nextBlockFast(_PREHASH_InventoryData);
gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getUUID());
gMessageSystem->addUUIDFast(_PREHASH_FolderID, gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(item->getType())));
gAgent.sendReliableMessage();
}
#endif
}
}
}
}
示例11: inventoryChanged
void FSLSLBridge::inventoryChanged(LLViewerObject* object,
LLInventoryObject::object_list_t* inventory,
S32 serial_num,
void* user_data)
{
object->removeInventoryListener(this);
llinfos << "Received object inventory for existing bridge prim. Checking contents..." << llendl;
//are we attaching the right thing? Check size and script
LLInventoryObject::object_list_t inventory_objects;
object->getInventoryContents(inventory_objects);
if (object->flagInventoryEmpty())
{
llinfos << "Empty bridge detected- re-enter creation process" << llendl;
mBridgeCreating = true;
}
else if (inventory_objects.size() > 0)
{
S32 count(0);
LLInventoryObject::object_list_t::iterator it = inventory_objects.begin();
LLInventoryObject::object_list_t::iterator end = inventory_objects.end();
bool isOurScript = false;
for ( ; it != end; ++it)
{
LLInventoryItem* item = ((LLInventoryItem*)((LLInventoryObject*)(*it)));
// AH: Somehow always contains a wonky object item with creator
// UUID = NULL UUID and asset type AT_NONE - don't count it
if (item->getType() != LLAssetType::AT_NONE)
{
count++;
}
if (item->getType() == LLAssetType::AT_LSL_TEXT)
{
if (item->getCreatorUUID() == gAgent.getID())
{
isOurScript = true;
}
else //problem, not our script
{
llwarns << "The bridge inventory contains a script not created by user." << llendl;
}
}
}
if (count == 1 && isOurScript) //We attached a valid bridge. Run along.
{
return;
}
else
{
reportToNearbyChat(LLTrans::getString("fsbridge_warning_unexpected_items"));
llwarns << "The bridge inventory contains items other than bridge script." << llendl;
if (!isOurScript) //some junk but no valid script? Unlikely to happen, but lets add script anyway.
{
mBridgeCreating = true;
}
else //Let the script disable competitors
{
return;
}
}
}
else
{
llwarns << "Bridge not empty, but we're unable to retrieve contents." << llendl;
}
//modify the rock size and texture
if (mBridgeCreating)
{
configureBridgePrim(object);
}
}
示例12: buildClothingList
void LLFloaterClothing::buildClothingList()
{
//llinfos << "buildClothingList" << llendl;
LLScrollListCtrl* list = gUICtrlFactory->getScrollListByName(this, "clothing_list");
if (!list) return;
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
LLIsClothing is_clothing;
gInventory.collectDescendentsIf(gAgent.getInventoryRootID(),
cats,
items,
LLInventoryModel::EXCLUDE_TRASH,
is_clothing);
S32 count = items.count();
for(S32 i = 0; i < count; ++i)
{
LLInventoryItem* item = items.get(i);
LLSD row;
row["id"] = item->getUUID();
BOOL item_is_multi = FALSE;
if ( item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS )
{
item_is_multi = TRUE;
}
LLUUID image_id = get_item_icon_uuid(item->getType(),
item->getInventoryType(),
item->getFlags(), item_is_multi); // flags = wearable type
row["columns"][0]["column"] = "icon";
row["columns"][0]["type"] = "icon";
row["columns"][0]["value"] = image_id;
LLString text = item->getName();
LLString style = "NORMAL";
if( gAgent.isWearingItem( item->getUUID() ) )
{
text.append(" (worn)");
style = "BOLD";
}
row["columns"][1]["column"] = "name";
row["columns"][1]["value"] = text;
row["columns"][1]["font"] = "SANSSERIFSMALL";
row["columns"][1]["font-style"] = style;
// hidden column for sorting
U32 flags = item->getFlags(); // flags = wearable type
enum EWearableType wearable_type = (enum EWearableType)flags;
const char* wearable_label = LLWearable::typeToTypeLabel(wearable_type);
//line->addColumn(wearable_label, FONT, -1); // invisible
row["columns"][2]["column"] = "sort";
row["columns"][2]["value"] = wearable_label;
list->addElement(row);
}
if (count > 0)
{
mAllowSelection = TRUE;
}
else if (LLInventoryModel::backgroundFetchActive())
{
// We're loading
list->addCommentText(LOADING_STRING);
mAllowSelection = FALSE;
}
else
{
// Weird case, we're done loading but have no clothing
list->addCommentText("No clothing found.");
mAllowSelection = FALSE;
}
}
示例13: buildNewViews
void LLBuildNewViewsScheduler::buildNewViews(LLInventoryPanel* panelp, LLInventoryObject* objectp)
{
LLFolderViewItem* itemp = NULL;
if (objectp)
{
if (objectp->getType() <= LLAssetType::AT_NONE ||
objectp->getType() >= LLAssetType::AT_COUNT)
{
llwarns << "called with objectp->mType == "
<< ((S32) objectp->getType())
<< " (shouldn't happen)" << llendl;
}
else if (objectp->getType() == LLAssetType::AT_CATEGORY) // build new view for category
{
LLInvFVBridge* new_listener = LLInvFVBridge::createBridge(objectp->getType(),
LLInventoryType::IT_CATEGORY,
panelp,
objectp->getUUID());
if (new_listener)
{
LLFolderViewFolder* folderp = new LLFolderViewFolder(new_listener->getDisplayName(),
new_listener->getIcon(),
panelp->getRootFolder(),
new_listener);
folderp->setItemSortOrder(panelp->getSortOrder());
itemp = folderp;
}
}
else // build new view for item
{
LLInventoryItem* item = (LLInventoryItem*)objectp;
LLInvFVBridge* new_listener = LLInvFVBridge::createBridge(
item->getType(),
item->getInventoryType(),
panelp,
item->getUUID(),
item->getFlags());
if (new_listener)
{
itemp = new LLFolderViewItem(new_listener->getDisplayName(),
new_listener->getIcon(),
new_listener->getCreationDate(),
panelp->getRootFolder(),
new_listener);
}
}
LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)panelp->getRootFolder()->getItemByID(objectp->getParentUUID());
if (itemp)
{
itemp->mDelayedDelete = TRUE;
if (parent_folder)
{
itemp->addToFolder(parent_folder, panelp->getRootFolder());
}
else
{
llwarns << "Couldn't find parent folder for child " << itemp->getLabel() << llendl;
delete itemp;
}
}
}
if (!objectp || (objectp && (objectp->getType() == LLAssetType::AT_CATEGORY)))
{
LLViewerInventoryCategory::cat_array_t* categories;
LLViewerInventoryItem::item_array_t* items;
panelp->getModel()->lockDirectDescendentArrays((objectp != NULL) ? objectp->getUUID() : LLUUID::null, categories, items);
if(categories)
{
S32 count = categories->count();
for(S32 i = 0; i < count; ++i)
{
LLInventoryCategory* cat = categories->get(i);
addJob(panelp, cat);
}
}
if(items)
{
S32 count = items->count();
for(S32 i = 0; i < count; ++i)
{
LLInventoryItem* item = items->get(i);
addJob(panelp, item);
}
}
panelp->getModel()->unlockDirectDescendentArrays(objectp->getUUID());
}
}
示例14: buildNewViews
void LLInventoryPanel::buildNewViews(const LLUUID& id)
{
LLMemType mt(LLMemType::MTYPE_INVENTORY_BUILD_NEW_VIEWS);
LLFolderViewItem* itemp = NULL;
LLInventoryObject* objectp = gInventory.getObject(id);
if (objectp)
{
const LLUUID &parent_id = objectp->getParentUUID();
LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id);
if (id == mStartFolderID)
{
parent_folder = mFolderRoot;
}
else if ((mStartFolderID != LLUUID::null) && (!gInventory.isObjectDescendentOf(id, mStartFolderID)))
{
// This item exists outside the inventory's hierarchy, so don't add it.
return;
}
if (objectp->getType() <= LLAssetType::AT_NONE ||
objectp->getType() >= LLAssetType::AT_COUNT)
{
llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : "
<< ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID()
<< llendl;
return;
}
if ((objectp->getType() == LLAssetType::AT_CATEGORY) &&
(objectp->getActualType() != LLAssetType::AT_LINK_FOLDER))
{
LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(),
objectp->getType(),
LLInventoryType::IT_CATEGORY,
this,
mFolderRoot,
objectp->getUUID());
if (new_listener)
{
LLFolderViewFolder::Params params;
params.name = new_listener->getDisplayName();
params.icon = new_listener->getIcon();
params.icon_open = new_listener->getOpenIcon();
if (mShowItemLinkOverlays) // if false, then links show up just like normal items
{
params.icon_overlay = LLUI::getUIImage("Inv_Link");
}
params.root = mFolderRoot;
params.listener = new_listener;
params.tool_tip = params.name;
LLFolderViewFolder* folderp = LLUICtrlFactory::create<LLFolderViewFolder>(params);
folderp->setItemSortOrder(mFolderRoot->getSortOrder());
itemp = folderp;
// Hide the root folder, so we can show the contents of a folder flat
// but still have the parent folder present for listener-related operations.
if (id == mStartFolderID)
{
folderp->setHidden(TRUE);
}
const LLViewerInventoryCategory *cat = dynamic_cast<LLViewerInventoryCategory *>(objectp);
if (cat && getIsHiddenFolderType(cat->getPreferredType()))
{
folderp->setHidden(TRUE);
}
}
}
else
{
// Build new view for item.
LLInventoryItem* item = (LLInventoryItem*)objectp;
LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(),
item->getActualType(),
item->getInventoryType(),
this,
mFolderRoot,
item->getUUID(),
item->getFlags());
if (new_listener)
{
LLFolderViewItem::Params params;
params.name = new_listener->getDisplayName();
params.icon = new_listener->getIcon();
params.icon_open = new_listener->getOpenIcon();
if (mShowItemLinkOverlays) // if false, then links show up just like normal items
{
params.icon_overlay = LLUI::getUIImage("Inv_Link");
}
params.creation_date = new_listener->getCreationDate();
params.root = mFolderRoot;
params.listener = new_listener;
params.rect = LLRect (0, 0, 0, 0);
params.tool_tip = params.name;
itemp = LLUICtrlFactory::create<LLFolderViewItem> (params);
}
}
if (itemp)
{
//.........这里部分代码省略.........