本文整理汇总了C++中LLInventoryItem::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ LLInventoryItem::getName方法的具体用法?C++ LLInventoryItem::getName怎么用?C++ LLInventoryItem::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLInventoryItem
的用法示例。
在下文中一共展示了LLInventoryItem::getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCopyPasteAction
void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
{
std::string command_name = command.asString();
// since we select this comman inventory item had already arrived .
if("copy_gesture" == command_name)
{
uuid_vec_t ids;
getSelectedIds(ids);
// make sure that clopboard is empty
LLInventoryClipboard::instance().reset();
for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLInventoryClipboard::instance().add(item->getUUID());
}
}
}
else if ("paste" == command_name)
{
LLInventoryClipboard& clipbord = LLInventoryClipboard::instance();
LLDynamicArray<LLUUID> ids;
clipbord.retrieve(ids);
if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
return;
LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
llassert(gesture_dir);
LLPointer<GestureCopiedCallback> cb = new GestureCopiedCallback(this);
for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(gesture_dir && item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLStringUtil::format_map_t string_args;
string_args["[COPY_NAME]"] = item->getName();
LL_DEBUGS("Gesture")<< "Copying gesture " << item->getName() << " "<< item->getUUID() << " into "
<< gesture_dir->getName() << " "<< gesture_dir->getUUID() << LL_ENDL;
copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(),
gesture_dir->getUUID(), getString("copy_name", string_args), cb);
}
}
clipbord.reset();
}
else if ("copy_uuid" == command_name)
{
gClipboard.copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID());
}
}
示例2: onCopyPasteAction
void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
{
std::string command_name = command.asString();
// Since we select this command, the inventory items must have already arrived
if("copy_gesture" == command_name)
{
uuid_vec_t ids;
getSelectedIds(ids);
// Make sure the clipboard is empty
LLClipboard::instance().reset();
for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLClipboard::instance().addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE);
}
}
}
else if ("paste" == command_name)
{
LLDynamicArray<LLUUID> ids;
LLClipboard::instance().pasteFromClipboard(ids);
if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
return;
LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
llassert(gesture_dir);
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(gesture_copied_cb, _1, this));
for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(gesture_dir && item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLStringUtil::format_map_t string_args;
string_args["[COPY_NAME]"] = item->getName();
LL_DEBUGS("Gesture")<< "Copying gesture " << item->getName() << " "<< item->getUUID() << " into "
<< gesture_dir->getName() << " "<< gesture_dir->getUUID() << LL_ENDL;
copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(),
gesture_dir->getUUID(), getString("copy_name", string_args), cb);
}
}
LLClipboard::instance().reset();
}
else if ("copy_uuid" == command_name)
{
LLClipboard::instance().copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE);
}
}
示例3: doDialog
//static
bool LLDelayedGestureError::doDialog(const LLErrorEntry &ent, bool uuid_ok)
{
LLStringUtil::format_map_t args;
LLInventoryItem *item = gInventory.getItem( ent.mItemID );
if ( item )
{
args["[NAME]"] = item->getName();
}
else
{
if ( uuid_ok || ent.mTimer.getElapsedTimeF32() > MAX_NAME_WAIT_TIME )
{
args["[NAME]"] = std::string( ent.mItemID.asString() );
}
else
{
return false;
}
}
LLNotifyBox::showXml(ent.mNotifyName, args);
return true;
}
示例4: 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() );
}
}
示例5: 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);
}
}
}
示例6: refreshName
void LLWearable::refreshName()
{
LLUUID item_id = getItemID();
LLInventoryItem* item = gInventory.getItem(item_id);
if( item )
{
mName = item->getName();
}
}
示例7: refreshNameAndDescription
void LLViewerWearable::refreshNameAndDescription()
{
LLUUID item_id = getItemID();
LLInventoryItem* item = gInventory.getItem(item_id);
if( item )
{
mName = item->getName();
mDescription = item->getDescription();
}
}
示例8: addAnimations
// TODO: Sort the legacy and non-legacy together?
void LLPreviewGesture::addAnimations()
{
LLComboBox* combo = mAnimationCombo;
combo->removeall();
std::string none_text = getString("none_text");
combo->add(none_text, LLUUID::null);
// Add all the default (legacy) animations
S32 i;
for (i = 0; i < gUserAnimStatesCount; ++i)
{
// Use the user-readable name
std::string label = LLAnimStateLabels::getStateLabel( gUserAnimStates[i].mName );
const LLUUID& id = gUserAnimStates[i].mID;
combo->add(label, id);
}
// Get all inventory items that are animations
LLViewerInventoryCategory::cat_array_t cats;
LLViewerInventoryItem::item_array_t items;
LLIsTypeWithPermissions is_copyable_animation(LLAssetType::AT_ANIMATION,
PERM_ITEM_UNRESTRICTED,
gAgent.getID(),
gAgent.getGroupID());
gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
cats,
items,
LLInventoryModel::EXCLUDE_TRASH,
is_copyable_animation);
// Copy into something we can sort
std::vector<LLInventoryItem*> animations;
S32 count = items.count();
for(i = 0; i < count; ++i)
{
animations.push_back( items.get(i) );
}
// Do the sort
std::sort(animations.begin(), animations.end(), SortItemPtrsByName());
// And load up the combobox
std::vector<LLInventoryItem*>::iterator it;
for (it = animations.begin(); it != animations.end(); ++it)
{
LLInventoryItem* item = *it;
combo->add(item->getName(), item->getAssetUUID(), ADD_BOTTOM);
}
}
示例9: fire
// override
void fire(const LLUUID& inv_item)
{
if(!mTextEditor)
{
// The parent text editor may have vanished by now.
// In that case just quit.
return;
}
LLInventoryItem* item = gInventory.getItem(inv_item);
if(!item)
{
LL_WARNS() << "Item add reported, but not found in inventory!: " << inv_item << LL_ENDL;
}
else
{
// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a
if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE))
{
RlvUtil::notifyBlockedViewXXX(LLAssetType::AT_NOTECARD);
return;
}
// [/RLVa:KB]
// See if we can bring an existing preview to the front
if(!LLPreview::show(item->getUUID(), true))
{
if (gSavedSettings.getBOOL("ShowNewInventory")) // Singu Note: ShowNewInventory is true, not false, when they want a preview
{
// There isn't one, so make a new preview
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = gSavedSettings.getRect("NotecardEditorRect");
rect.translate(left - rect.mLeft, top - rect.mTop);
LLPreviewNotecard* preview;
preview = new LLPreviewNotecard("preview notecard",
rect,
std::string("Embedded Note: ") + item->getName(),
item->getUUID(),
LLUUID::null,
item->getAssetUUID(),
true,
(LLViewerInventoryItem*)item);
preview->setSourceID(LLUUID::null);
preview->setFocus(TRUE);
// Force to be entirely onscreen.
gFloaterView->adjustToFitScreen(preview, FALSE);
}
}
}
}
示例10: getEmbeddedItemToolTipAtPos
BOOL LLViewerTextEditor::getEmbeddedItemToolTipAtPos(S32 pos, LLWString &msg) const
{
if (pos < getLength())
{
LLInventoryItem* item = LLEmbeddedItems::getEmbeddedItem(getWChar(pos));
if( item )
{
msg = utf8str_to_wstring(item->getName());
msg += '\n';
msg += utf8str_to_wstring(item->getDescription());
return TRUE;
}
}
return FALSE;
}
示例11: addSounds
void LLPreviewGesture::addSounds()
{
LLComboBox* combo = mSoundCombo;
combo->removeall();
std::string none_text = getString("none_text");
combo->add(none_text, LLUUID::null);
// Get all inventory items that are sounds
LLViewerInventoryCategory::cat_array_t cats;
LLViewerInventoryItem::item_array_t items;
LLIsTypeWithPermissions is_copyable_sound(LLAssetType::AT_SOUND,
PERM_ITEM_UNRESTRICTED,
gAgent.getID(),
gAgent.getGroupID());
gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
cats,
items,
LLInventoryModel::EXCLUDE_TRASH,
is_copyable_sound);
// Copy sounds into something we can sort
std::vector<LLInventoryItem*> sounds;
S32 i;
S32 count = items.count();
for(i = 0; i < count; ++i)
{
sounds.push_back( items.get(i) );
}
// Do the sort
std::sort(sounds.begin(), sounds.end(), SortItemPtrsByName());
// And load up the combobox
std::vector<LLInventoryItem*>::iterator it;
for (it = sounds.begin(); it != sounds.end(); ++it)
{
LLInventoryItem* item = *it;
combo->add(item->getName(), item->getAssetUUID(), ADD_BOTTOM);
}
}
示例12: addAnimations
void LLFloaterAO::addAnimations()
{
mAnimListCombo->removeall();
std::string none_text = getString("none_text");
mAnimListCombo->add(none_text, LLUUID::null);
// Add all the default (legacy) animations
S32 i;
// Get all inventory items that are animations
LLViewerInventoryCategory::cat_array_t cats;
LLViewerInventoryItem::item_array_t items;
LLIsTypeWithPermissions is_copyable_animation(LLAssetType::AT_ANIMATION,
PERM_NONE,
gAgent.getID(),
gAgent.getGroupID());
gInventory.collectDescendentsIf(gAgent.getInventoryRootID(),
cats,
items,
LLInventoryModel::EXCLUDE_TRASH,
is_copyable_animation);
// Copy into something we can sort
std::vector<LLInventoryItem*> animations;
S32 count = items.count();
for(i = 0; i < count; ++i)
{
animations.push_back( items.get(i) );
}
// Do the sort
std::sort(animations.begin(), animations.end(), SortItemPtrsByName());
// And load up the combobox
std::vector<LLInventoryItem*>::iterator it;
for (it = animations.begin(); it != animations.end(); ++it)
{
LLInventoryItem* item = *it;
mAnimListCombo->add(item->getName(), item->getAssetUUID(), ADD_BOTTOM);
}
}
示例13: onClickEdit
// static
void LLFloaterGesture::onClickEdit(void* data)
{
LLFloaterGesture* self = (LLFloaterGesture*)data;
LLCtrlListInterface *list = self->childGetListInterface("gesture_list");
if (!list) return;
const LLUUID& item_id = list->getCurrentID();
LLInventoryItem* item = gInventory.getItem(item_id);
if (!item) return;
std::string title("Gesture: ");
title.append(item->getName());
LLPreviewGesture* previewp = LLPreviewGesture::show(title, item_id, LLUUID::null);
if (!previewp->getHost())
{
previewp->setRect(gFloaterView->findNeighboringPosition(self, previewp));
}
}
示例14: handleInventory
void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj, LLInventoryObject::object_list_t* inv)
{
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
LLInventoryObject::object_list_t::const_iterator it = inv->begin();
LLInventoryObject::object_list_t::const_iterator end = inv->end();
for ( ; it != end; ++it)
{
LLAssetType::EType asstype = (*it)->getType();
if(
( asstype == LLAssetType::AT_ANIMATION && gSavedSettings.getBOOL("BulkChangeIncludeAnimations")) ||
( asstype == LLAssetType::AT_BODYPART && gSavedSettings.getBOOL("BulkChangeIncludeBodyParts" )) ||
( asstype == LLAssetType::AT_CLOTHING && gSavedSettings.getBOOL("BulkChangeIncludeClothing" )) ||
( asstype == LLAssetType::AT_GESTURE && gSavedSettings.getBOOL("BulkChangeIncludeGestures" )) ||
( asstype == LLAssetType::AT_LANDMARK && gSavedSettings.getBOOL("BulkChangeIncludeLandmarks" )) ||
( asstype == LLAssetType::AT_NOTECARD && gSavedSettings.getBOOL("BulkChangeIncludeNotecards" )) ||
( asstype == LLAssetType::AT_OBJECT && gSavedSettings.getBOOL("BulkChangeIncludeObjects" )) ||
( asstype == LLAssetType::AT_LSL_TEXT && gSavedSettings.getBOOL("BulkChangeIncludeScripts" )) ||
( asstype == LLAssetType::AT_SOUND && gSavedSettings.getBOOL("BulkChangeIncludeSounds" )) ||
( asstype == LLAssetType::AT_TEXTURE && gSavedSettings.getBOOL("BulkChangeIncludeTextures" )))
{
LLViewerObject* object = gObjectList.findObject(viewer_obj->getID());
if (object)
{
LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
LLViewerInventoryItem* new_item = (LLViewerInventoryItem*)item;
LLPermissions perm(new_item->getPermissions());
U32 flags = new_item->getFlags();
U32 desired_next_owner_perms = LLFloaterPerms::getNextOwnerPerms("BulkChange");
U32 desired_everyone_perms = LLFloaterPerms::getEveryonePerms("BulkChange");
U32 desired_group_perms = LLFloaterPerms::getGroupPerms("BulkChange");
// If next owner permissions have changed (and this is an object)
// then set the slam permissions flag so that they are applied on rez.
if((perm.getMaskNextOwner() != desired_next_owner_perms)
&& (new_item->getType() == LLAssetType::AT_OBJECT))
{
flags |= LLInventoryItemFlags::II_FLAGS_OBJECT_SLAM_PERM;
}
// If everyone permissions have changed (and this is an object)
// then set the overwrite everyone permissions flag so they
// are applied on rez.
if ((perm.getMaskEveryone() != desired_everyone_perms)
&& (new_item->getType() == LLAssetType::AT_OBJECT))
{
flags |= LLInventoryItemFlags::II_FLAGS_OBJECT_PERM_OVERWRITE_EVERYONE;
}
// If group permissions have changed (and this is an object)
// then set the overwrite group permissions flag so they
// are applied on rez.
if ((perm.getMaskGroup() != desired_group_perms)
&& (new_item->getType() == LLAssetType::AT_OBJECT))
{
flags |= LLInventoryItemFlags::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP;
}
// chomp the inventory name so it fits in the scroll window nicely
// and the user can see the [OK]
std::string invname;
invname=item->getName().substr(0,item->getName().size() < 30 ? item->getName().size() : 30 );
LLUIString status_text = getString("status_text");
status_text.setArg("[NAME]", invname.c_str());
// Check whether we appear to have the appropriate permissions to change permission on this item.
// Although the server will disallow any forbidden changes, it is a good idea to guess correctly
// so that we can warn the user. The risk of getting this check wrong is therefore the possibility
// of incorrectly choosing to not attempt to make a valid change.
//
// Trouble is this is extremely difficult to do and even when we know the results
// it is difficult to design the best messaging. Therefore in this initial implementation
// we'll always try to set the requested permissions and consider all cases successful
// and perhaps later try to implement a smarter, friendlier solution. -MG
if(true
//gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE) // for group and everyone masks
//|| something else // for next owner perms
)
{
perm.setMaskNext(desired_next_owner_perms);
perm.setMaskEveryone(desired_everyone_perms);
perm.setMaskGroup(desired_group_perms);
new_item->setPermissions(perm); // here's the beef
new_item->setFlags(flags); // and the tofu
updateInventory(object,new_item,TASK_INVENTORY_ITEM_KEY,FALSE);
//status_text.setArg("[STATUS]", getString("status_ok_text"));
status_text.setArg("[STATUS]", "");
}
else
{
//status_text.setArg("[STATUS]", getString("status_bad_text"));
status_text.setArg("[STATUS]", "");
}
list->addSimpleElement(status_text.getString());
//TODO if we are an object inside an object we should check a recuse flag and if set
//open the inventory of the object and recurse - Michelle2 Zenovka
// if(recurse && ( (*it)->getType() == LLAssetType::AT_OBJECT && processObject))
//.........这里部分代码省略.........
示例15: buildLandmarkIDLists
void LLFloaterWorldMap::buildLandmarkIDLists()
{
LLCtrlListInterface *list = mListLandmarkCombo;
if (!list) return;
// Delete all but the "None" entry
S32 list_size = list->getItemCount();
if (list_size > 1)
{
list->selectItemRange(1, -1);
list->operateOnSelection(LLCtrlListInterface::OP_DELETE);
}
mLandmarkItemIDList.reset();
mLandmarkAssetIDList.reset();
// Get all of the current landmarks
mLandmarkAssetIDList.put( LLUUID::null );
mLandmarkItemIDList.put( LLUUID::null );
mLandmarkAssetIDList.put( sHomeID );
mLandmarkItemIDList.put( sHomeID );
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
LLIsType is_landmark(LLAssetType::AT_LANDMARK);
gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
cats,
items,
LLInventoryModel::EXCLUDE_TRASH,
is_landmark);
std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers());
std::list<LLInventoryItem*> usedLMs;
BOOL filterLandmarks = gSavedSettings.getBOOL("WorldmapFilterDuplicateLandmarks");
S32 count = items.count();
for(S32 i = 0; i < count; ++i)
{
LLInventoryItem* item = items.get(i);
if (filterLandmarks)
{
bool skip = false;
for (std::list<LLInventoryItem*>::iterator it = usedLMs.begin(); it != usedLMs.end(); ++it)
{
if ((*it)->getAssetUUID() == item->getAssetUUID())
{
skip = true;
break;
}
}
if (skip) continue;
usedLMs.push_front(item);
}
list->addSimpleElement(item->getName(), ADD_BOTTOM, item->getUUID());
mLandmarkAssetIDList.put( item->getAssetUUID() );
mLandmarkItemIDList.put( item->getUUID() );
}
list->selectFirstItem();
}