本文整理汇总了C++中LLViewerInventoryItem::setAssetUUID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerInventoryItem::setAssetUUID方法的具体用法?C++ LLViewerInventoryItem::setAssetUUID怎么用?C++ LLViewerInventoryItem::setAssetUUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerInventoryItem
的用法示例。
在下文中一共展示了LLViewerInventoryItem::setAssetUUID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle
// static
void LLAssetIDAcquirer::handle(LLMessageSystem* mesgsys)
{
if(!mBusy) return;
LLUUID agent_id;
gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if(agent_id != gAgent.getID()) return;
S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData);
for(int i = 0; i < num_wearables; i++)
{
U8 type_u8 = 0;
gMessageSystem->getU8Fast(_PREHASH_WearableData, _PREHASH_WearableType, type_u8, i );
if(type_u8 == WT_UNDERPANTS)
{
LLUUID item_id;
gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_ItemID, item_id, i );
LLUUID asset_id;
gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_AssetID, asset_id, i );
if(item_id == mItemID)
{
LLViewerInventoryItem* item = gInventory.getItem(item_id);
if(item)
{
item->setAssetUUID(asset_id);
}
}
// anyway
// remove from queue
std::vector<LLUUID>::iterator iter = std::find(mQueue.begin(), mQueue.end(), item_id);
if(iter != mQueue.end())
mQueue.erase(iter);
// continue
mBusy = false;
work();
}
}
}
示例2: onSaveComplete
// static
void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLSaveNotecardInfo* info = static_cast<LLSaveNotecardInfo*>(user_data);
if (0 == status)
{
if(info->mObjectUUID.isNull())
{
LLViewerInventoryItem* item;
item = (LLViewerInventoryItem*)gInventory.getItem(info->mItemUUID);
if(item)
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setAssetUUID(asset_uuid);
new_item->setTransactionID(info->mTransactionID);
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
{
llwarns << "Inventory item for script " << info->mItemUUID
<< " is no longer in agent inventory." << llendl;
}
}
else
{
LLViewerObject* object = gObjectList.findObject(info->mObjectUUID);
LLViewerInventoryItem* item = NULL;
if(object)
{
item = (LLViewerInventoryItem*)object->getInventoryObject(info->mItemUUID);
}
if(object && item)
{
item->setAssetUUID(asset_uuid);
item->setTransactionID(info->mTransactionID);
object->updateInventory(item, TASK_INVENTORY_ITEM_KEY, false);
dialog_refresh_all();
}
else
{
LLNotificationsUtil::add("SaveNotecardFailObjectNotFound");
}
}
// Perform item copy to inventory
if (info->mCopyItem.notNull())
{
if (LLViewerTextEditor* editor = info->mSelf->findChild<LLViewerTextEditor>("Notecard Editor"))
{
editor->copyInventory(info->mCopyItem);
}
}
// Find our window and close it if requested.
LLPreviewNotecard* previewp = (LLPreviewNotecard*)LLPreview::find(info->mItemUUID);
if (previewp && previewp->mCloseAfterSave)
{
previewp->close();
}
}
else
{
llwarns << "Problem saving notecard: " << status << llendl;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("SaveNotecardFailReason", args);
}
std::string uuid_string;
asset_uuid.toString(uuid_string);
std::string filename;
filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string) + ".tmp";
LLFile::remove(filename);
delete info;
}
示例3: onSaveComplete
// TODO: This is very similar to LLPreviewNotecard::onSaveComplete.
// Could merge code.
// static
void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLSaveInfo* info = (LLSaveInfo*)user_data;
if (info && (status == 0))
{
if(info->mObjectUUID.isNull())
{
// Saving into user inventory
LLViewerInventoryItem* item;
item = (LLViewerInventoryItem*)gInventory.getItem(info->mItemUUID);
if(item)
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setDescription(info->mDesc);
new_item->setTransactionID(info->mTransactionID);
new_item->setAssetUUID(asset_uuid);
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
{
llwarns << "Inventory item for gesture " << info->mItemUUID
<< " is no longer in agent inventory." << llendl;
}
}
else
{
// Saving into in-world object inventory
LLViewerObject* object = gObjectList.findObject(info->mObjectUUID);
LLViewerInventoryItem* item = NULL;
if(object)
{
item = (LLViewerInventoryItem*)object->getInventoryObject(info->mItemUUID);
}
if(object && item)
{
item->setDescription(info->mDesc);
item->setAssetUUID(asset_uuid);
item->setTransactionID(info->mTransactionID);
object->updateInventory(item, TASK_INVENTORY_ITEM_KEY, false);
dialog_refresh_all();
}
else
{
LLNotifications::instance().add("GestureSaveFailedObjectNotFound");
}
}
// Find our window and close it if requested.
LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(info->mItemUUID);
if (previewp && previewp->mCloseAfterSave)
{
previewp->close();
}
}
else
{
llwarns << "Problem saving gesture: " << status << llendl;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotifications::instance().add("GestureSaveFailedReason", args);
}
delete info;
info = NULL;
}
示例4: onSaveComplete
// static
void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLSaveNotecardInfo* info = (LLSaveNotecardInfo*)user_data;
if(info && (0 == status))
{
if(info->mObjectUUID.isNull())
{
LLViewerInventoryItem* item;
item = (LLViewerInventoryItem*)gInventory.getItem(info->mItemUUID);
if(item)
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setAssetUUID(asset_uuid);
new_item->setTransactionID(info->mTransactionID);
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
{
llwarns << "Inventory item for script " << info->mItemUUID
<< " is no longer in agent inventory." << llendl;
}
}
else
{
LLViewerObject* object = gObjectList.findObject(info->mObjectUUID);
LLViewerInventoryItem* item = NULL;
if(object)
{
item = (LLViewerInventoryItem*)object->getInventoryObject(info->mItemUUID);
}
if(object && item)
{
item->setAssetUUID(asset_uuid);
item->setTransactionID(info->mTransactionID);
object->updateInventory(item, TASK_INVENTORY_ITEM_KEY, false);
dialog_refresh_all();
}
else
{
gViewerWindow->alertXml("SaveNotecardFailObjectNotFound");
}
}
// Perform item copy to inventory
if (info->mCopyItem.notNull())
{
LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(info->mSelf, "Notecard Editor");
if (editor)
{
editor->copyInventory(info->mCopyItem);
}
}
// Find our window and close it if requested.
LLPreviewNotecard* previewp = (LLPreviewNotecard*)LLPreview::find(info->mItemUUID);
if (previewp && previewp->mCloseAfterSave)
{
previewp->close();
}
}
else
{
llwarns << "Problem saving notecard: " << status << llendl;
LLStringBase<char>::format_map_t args;
args["[REASON]"] = std::string(LLAssetStorage::getErrorString(status));
gViewerWindow->alertXml("SaveNotecardFailReason",args);
}
char uuid_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
asset_uuid.toString(uuid_string);
char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
snprintf(filename, LL_MAX_PATH, "%s.tmp", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /* Flawfinder: ignore */
LLFile::remove(filename);
delete info;
}