本文整理汇总了C++中LLInventoryItem::setPermissions方法的典型用法代码示例。如果您正苦于以下问题:C++ LLInventoryItem::setPermissions方法的具体用法?C++ LLInventoryItem::setPermissions怎么用?C++ LLInventoryItem::setPermissions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLInventoryItem
的用法示例。
在下文中一共展示了LLInventoryItem::setPermissions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fire
void fire(const LLUUID &inv_item)
{
LLPreviewGesture::show(inv_item, LLUUID::null);
LLInventoryItem* item = gInventory.getItem(inv_item);
if (item)
{
LLPermissions perm = item->getPermissions();
perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Gestures"));
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Gestures"));
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Gestures"));
item->setPermissions(perm);
item->updateServer(FALSE);
}
}
示例2: handleDragAndDrop
// Allow calling cards to be dropped onto text fields. Append the name and
// a carriage return.
// virtual
BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
EAcceptance *accept,
std::string& tooltip_msg)
{
BOOL handled = FALSE;
LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
if (LLToolDragAndDrop::SOURCE_NOTECARD == source)
{
// We currently do not handle dragging items from one notecard to another
// since items in a notecard must be in Inventory to be verified. See DEV-2891.
return FALSE;
}
if (mTakesNonScrollClicks)
{
if (getEnabled() && acceptsTextInput())
{
switch( cargo_type )
{
// <edit>
// This does not even appear to be used maybe
// Throwing it out so I can embed calling cards
/*
case DAD_CALLINGCARD:
if(acceptsCallingCardNames())
{
if (drop)
{
LLInventoryItem *item = (LLInventoryItem *)cargo_data;
std::string name = item->getName();
appendText(name, true, true);
}
*accept = ACCEPT_YES_COPY_SINGLE;
}
else
{
*accept = ACCEPT_NO;
}
break;
*/
case DAD_CALLINGCARD:
// </edit>
case DAD_TEXTURE:
case DAD_SOUND:
case DAD_LANDMARK:
case DAD_SCRIPT:
case DAD_CLOTHING:
case DAD_OBJECT:
case DAD_NOTECARD:
case DAD_BODYPART:
case DAD_ANIMATION:
case DAD_GESTURE:
{
LLInventoryItem *item = (LLInventoryItem *)cargo_data;
// <edit>
if((item->getPermissions().getMaskOwner() & PERM_ITEM_UNRESTRICTED) != PERM_ITEM_UNRESTRICTED)
{
if(gSavedSettings.getBOOL("ForceNotecardDragCargoPermissive"))
{
item = new LLInventoryItem((LLInventoryItem *)cargo_data);
LLPermissions old = item->getPermissions();
LLPermissions perm;
perm.init(old.getCreator(), old.getOwner(), old.getLastOwner(), old.getGroup());
perm.setMaskBase(PERM_ITEM_UNRESTRICTED);
perm.setMaskEveryone(PERM_ITEM_UNRESTRICTED);
perm.setMaskGroup(PERM_ITEM_UNRESTRICTED);
perm.setMaskNext(PERM_ITEM_UNRESTRICTED);
perm.setMaskOwner(PERM_ITEM_UNRESTRICTED);
item->setPermissions(perm);
}
}
// </edit>
if( item && allowsEmbeddedItems() )
{
U32 mask_next = item->getPermissions().getMaskNextOwner();
// <edit>
//if((mask_next & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)
if(((mask_next & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) || gSavedSettings.getBOOL("ForceNotecardDragCargoAcceptance"))
{
if( drop )
{
deselect();
S32 old_cursor = mCursorPos;
setCursorAtLocalPos( x, y, TRUE );
S32 insert_pos = mCursorPos;
setCursorPos(old_cursor);
BOOL inserted = insertEmbeddedItem( insert_pos, item );
if( inserted && (old_cursor > mCursorPos) )
{
setCursorPos(mCursorPos + 1);
}
updateLineStartList();
}
*accept = ACCEPT_YES_COPY_MULTI;
//.........这里部分代码省略.........