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

@@ -103,12 +103,10 @@ LLAssetDictionary::LLAssetDictionary()
//addEntry(LLAssetType::AT_FAVORITE, new AssetEntry("FAVORITE", "favorite", "", false, false, false)); //addEntry(LLAssetType::AT_FAVORITE, new AssetEntry("FAVORITE", "favorite", "", false, false, false));
addEntry(LLAssetType::AT_LINK, new AssetEntry("LINK", "link", "sym link", false, false, true)); addEntry(LLAssetType::AT_LINK, new AssetEntry("LINK", "link", "sym link", false, false, true));
addEntry(LLAssetType::AT_LINK_FOLDER, new AssetEntry("FOLDER_LINK", "link_f", "sym folder link", false, false, true)); addEntry(LLAssetType::AT_LINK_FOLDER, new AssetEntry("FOLDER_LINK", "link_f", "sym folder link", false, false, true));
//addEntry(LLAssetType::AT_CURRENT_OUTFIT, new AssetEntry("FOLDER_LINK", "current", "current outfit", false, false, false)); addEntry(LLAssetType::AT_CURRENT_OUTFIT, new AssetEntry("FOLDER_LINK", "current", "current outfit", false, false, false));
//addEntry(LLAssetType::AT_OUTFIT, new AssetEntry("OUTFIT", "outfit", "outfit", false, false, false)); addEntry(LLAssetType::AT_OUTFIT, new AssetEntry("OUTFIT", "outfit", "outfit", false, false, false));
//addEntry(LLAssetType::AT_MY_OUTFITS, new AssetEntry("MY_OUTFITS", "my_otfts", "my outfits", false, false, false)); addEntry(LLAssetType::AT_MY_OUTFITS, new AssetEntry("MY_OUTFITS", "my_otfts", "my outfits", false, false, false));
#if MESH_ENABLED addEntry(LLAssetType::AT_MESH, new AssetEntry("MESH", "mesh", "mesh", false, true, true));
addEntry(LLAssetType::AT_MESH, new AssetEntry("MESH", "mesh", "mesh", false, false, false));
#endif //MESH_ENABLED
addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, false, false, false)); addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, false, false, false));
}; };

View File

@@ -139,18 +139,16 @@ public:
// Inventory folder link // Inventory folder link
AT_LINK_FOLDER = 25, AT_LINK_FOLDER = 25,
//AT_CURRENT_OUTFIT = 46, AT_CURRENT_OUTFIT = 46,
//AT_OUTFIT = 47, AT_OUTFIT = 47,
//AT_MY_OUTFITS = 48, AT_MY_OUTFITS = 48,
#if MESH_ENABLED
AT_MESH = 49, AT_MESH = 49,
// Mesh data in our proprietary SLM format // Mesh data in our proprietary SLM format
AT_COUNT = 50, AT_COUNT = 50,
#endif //MESH_ENABLED
// +*********************************************+ // +*********************************************+
// | TO ADD AN ELEMENT TO THIS ENUM: | // | TO ADD AN ELEMENT TO THIS ENUM: |
// +*********************************************+ // +*********************************************+
@@ -160,10 +158,6 @@ public:
// | 4. ADD TO LLAssetType::mAssetTypeHumanNames | // | 4. ADD TO LLAssetType::mAssetTypeHumanNames |
// +*********************************************+ // +*********************************************+
//AT_COUNT = 49,
#if !MESH_ENABLED
AT_COUNT = 26,
#endif //!MESH_ENABLED
AT_NONE = -1 AT_NONE = -1
}; };

View File

@@ -55,7 +55,8 @@ enum EDragAndDropType
DAD_ANIMATION = 12, DAD_ANIMATION = 12,
DAD_GESTURE = 13, DAD_GESTURE = 13,
DAD_LINK = 14, DAD_LINK = 14,
DAD_COUNT = 15, // number of types in this enum DAD_MESH = 15,
DAD_COUNT = 16, // number of types in this enum
}; };
// Reasons for drags to be denied. // Reasons for drags to be denied.

View File

@@ -67,7 +67,9 @@ public:
IT_WEARABLE = 18, IT_WEARABLE = 18,
IT_ANIMATION = 19, IT_ANIMATION = 19,
IT_GESTURE = 20, IT_GESTURE = 20,
IT_COUNT = 21,
IT_MESH = 22,
IT_COUNT = 23,
IT_NONE = -1 IT_NONE = -1
}; };

View File

@@ -200,6 +200,7 @@ std::string ICON_NAME[ICON_NAME_COUNT] =
"inv_link_item.tga", "inv_link_item.tga",
"inv_link_folder.tga" "inv_link_folder.tga"
"inv_item_mesh.png"
}; };
struct LLWearInfo struct LLWearInfo
@@ -1119,6 +1120,13 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
// Only should happen for broken links. // Only should happen for broken links.
new_listener = new LLLinkItemBridge(inventory, uuid); new_listener = new LLLinkItemBridge(inventory, uuid);
break; 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: default:
llinfos << "Unhandled asset type (llassetstorage.h): " llinfos << "Unhandled asset type (llassetstorage.h): "
<< (S32)asset_type << llendl; << (S32)asset_type << llendl;
@@ -5685,3 +5693,59 @@ const LLUUID &LLLinkFolderBridge::getFolderID() const
return LLUUID::null; 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);
}

View File

@@ -85,6 +85,7 @@ enum EInventoryIcon
LINKITEM_ICON_NAME, LINKITEM_ICON_NAME,
LINKFOLDER_ICON_NAME, LINKFOLDER_ICON_NAME,
MESH_ICON_NAME,
ICON_NAME_COUNT ICON_NAME_COUNT
}; };
@@ -646,6 +647,21 @@ protected:
static std::string sPrefix; static std::string sPrefix;
}; };
class LLMeshBridge : public LLItemBridge
{
friend class LLInvFVBridge;
public:
virtual LLUIImagePtr getIcon() const;
virtual void openItem();
virtual void previewItem();
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
protected:
LLMeshBridge(LLInventoryPanel* inventory,
const LLUUID& uuid) :
LLItemBridge(inventory, uuid) {}
};
void rez_attachment(LLViewerInventoryItem* item, void rez_attachment(LLViewerInventoryItem* item,
LLViewerJointAttachment* attachment, LLViewerJointAttachment* attachment,
bool replace = false); bool replace = false);

View File

@@ -1541,6 +1541,9 @@ std::string get_item_icon_name(LLAssetType::EType asset_type,
case LLAssetType::AT_GESTURE: case LLAssetType::AT_GESTURE:
idx = GESTURE_ICON_NAME; idx = GESTURE_ICON_NAME;
break; break;
case LLAssetType::AT_MESH:
idx = MESH_ICON_NAME;
break;
default: default:
break; break;
} }

View File

@@ -86,6 +86,8 @@ LLViewerAssetDictionary::LLViewerAssetDictionary()
addEntry(LLViewerAssetType::AT_LINK, new ViewerAssetEntry(DAD_LINK)); addEntry(LLViewerAssetType::AT_LINK, new ViewerAssetEntry(DAD_LINK));
addEntry(LLViewerAssetType::AT_LINK_FOLDER, new ViewerAssetEntry(DAD_LINK)); addEntry(LLViewerAssetType::AT_LINK_FOLDER, new ViewerAssetEntry(DAD_LINK));
addEntry(LLViewerAssetType::AT_MESH, new ViewerAssetEntry(DAD_MESH));
addEntry(LLViewerAssetType::AT_NONE, new ViewerAssetEntry(DAD_NONE)); addEntry(LLViewerAssetType::AT_NONE, new ViewerAssetEntry(DAD_NONE));
}; };