Inventory mesh type.

Conflicts:

	indra/llcommon/llassettype.cpp
	indra/llcommon/llassettype.h
This commit is contained in:
Siana Gearz
2011-10-05 15:54:57 +02:00
parent 4a14b75452
commit 6b4823429e
8 changed files with 97 additions and 17 deletions

View File

@@ -200,6 +200,7 @@ std::string ICON_NAME[ICON_NAME_COUNT] =
"inv_link_item.tga",
"inv_link_folder.tga"
"inv_item_mesh.png"
};
struct LLWearInfo
@@ -1119,6 +1120,13 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
// Only should happen for broken links.
new_listener = new LLLinkItemBridge(inventory, uuid);
break;
case LLAssetType::AT_MESH:
if(!(inv_type == LLInventoryType::IT_MESH))
{
llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
}
new_listener = new LLMeshBridge(inventory, uuid);
break;
default:
llinfos << "Unhandled asset type (llassetstorage.h): "
<< (S32)asset_type << llendl;
@@ -5685,3 +5693,59 @@ const LLUUID &LLLinkFolderBridge::getFolderID() const
return LLUUID::null;
}
// +=================================================+
// | LLMeshBridge |
// +=================================================+
LLUIImagePtr LLMeshBridge::getIcon() const
{
return get_item_icon(LLAssetType::AT_TEXTURE, LLInventoryType::IT_TEXTURE, 0, FALSE);
}
void LLMeshBridge::openItem()
{
LLViewerInventoryItem* item = getItem();
if (item)
{
// open mesh
}
}
void LLMeshBridge::previewItem()
{
LLViewerInventoryItem* item = getItem();
if(item)
{
// preview mesh
}
}
void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
lldebugs << "LLMeshBridge::buildContextMenu()" << llendl;
std::vector<std::string> items;
std::vector<std::string> disabled_items;
if(isItemInTrash())
{
items.push_back(std::string("Purge Item"));
if (!isItemRemovable())
{
disabled_items.push_back(std::string("Purge Item"));
}
items.push_back(std::string("Restore Item"));
}
else
{
items.push_back(std::string("Properties"));
getClipboardEntries(true, items, disabled_items, flags);
}
hide_context_entries(menu, items, disabled_items);
}