本文整理汇总了C++中LLViewerObject::getInventoryContents方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerObject::getInventoryContents方法的具体用法?C++ LLViewerObject::getInventoryContents怎么用?C++ LLViewerObject::getInventoryContents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerObject
的用法示例。
在下文中一共展示了LLViewerObject::getInventoryContents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refresh
//.........这里部分代码省略.........
}
if (valid_base_perms && is_nonpermanent_enforced &&
(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE))))
{
has_change_sale_ability = TRUE;
}
if (!has_change_perm_ability && !has_change_sale_ability && !root_selected)
{
// ...must select root to choose permissions
getChild<LLUICtrl>("perm_modify")->setValue(getString("text modify warning"));
}
if (has_change_perm_ability)
{
getChildView("checkbox share with group")->setEnabled(TRUE);
getChildView("text anyone can")->setEnabled(true);
getChildView("checkbox allow everyone move")->setEnabled(owner_mask_on & PERM_MOVE);
getChildView("checkbox allow everyone copy")->setEnabled(owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER);
}
else
{
getChildView("checkbox share with group")->setEnabled(FALSE);
getChildView("text anyone can")->setEnabled(false);
getChildView("checkbox allow everyone move")->setEnabled(FALSE);
getChildView("checkbox allow everyone copy")->setEnabled(FALSE);
}
// Is this user allowed to toggle export on this object?
if (supports_export && self_owned && mCreatorID == mOwnerID && can_set_export(base_mask_on, owner_mask_on, next_owner_mask_on))
{
bool can_export = true;
LLInventoryObject::object_list_t objects;
objectp->getInventoryContents(objects);
for (LLInventoryObject::object_list_t::iterator i = objects.begin(); can_export && i != objects.end() ; ++i) //The object's inventory must have EXPORT.
{
LLViewerInventoryItem* item = static_cast<LLViewerInventoryItem*>(i->get()); //getInventoryContents() filters out categories, static_cast.
can_export = perms_allow_export(item->getPermissions());
}
for (U8 i = 0; can_export && i < objectp->getNumTEs(); ++i) // Can the textures be exported?
if (LLTextureEntry* texture = objectp->getTE(i))
can_export = is_asset_exportable(texture->getID());
getChildView("checkbox allow export")->setEnabled(can_export);
}
else
{
getChildView("checkbox allow export")->setEnabled(false);
if (!gHippoGridManager->getCurrentGrid()->isSecondLife())
getChildView("checkbox allow everyone copy")->setVisible(true);
}
if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER))
{
getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale));
// Set the checkbox to tentative if the prices of each object selected
// are not the same.
getChild<LLUICtrl>("checkbox for sale")->setTentative( is_for_sale_mixed);
getChildView("sale type")->setEnabled(num_for_sale && can_transfer && !is_sale_price_mixed);
bool no_export = everyone_mask_off & PERM_EXPORT; // Next owner perms can't be changed if set
getChildView("Next owner can:")->setEnabled(no_export);
getChildView("checkbox next owner can modify")->setEnabled(no_export && base_mask_on & PERM_MODIFY);
getChildView("checkbox next owner can copy")->setEnabled(no_export && base_mask_on & PERM_COPY);
getChildView("checkbox next owner can transfer")->setEnabled(no_export && next_owner_mask_on & PERM_COPY);
}