summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2009-12-09 13:46:05 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2009-12-09 13:46:05 -0800
commit2554a88ec17998c092368e814254c6ad3928d920 (patch)
tree39d3e0d9abd21f36dee6d96cc02d2cb5dda3867b /indra/newview/llviewerinventory.cpp
parent2af183c51d8911a7242b838394863e2606ed3fe7 (diff)
parent6260ce6a9210192963a77e5b1f44b0d2c2c86591 (diff)
merge!
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r--indra/newview/llviewerinventory.cpp78
1 files changed, 14 insertions, 64 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 4482683400..9856cb2b7f 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1095,72 +1095,22 @@ void menu_create_inventory_item(LLFolderView* folder, LLFolderBridge *bridge, co
LLInventoryType::IT_GESTURE,
PERM_ALL);
}
- else if ("shirt" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- LLFolderBridge::createWearable(parent_id, WT_SHIRT);
- }
- else if ("pants" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- LLFolderBridge::createWearable(parent_id, WT_PANTS);
- }
- else if ("shoes" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- LLFolderBridge::createWearable(parent_id, WT_SHOES);
- }
- else if ("socks" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- LLFolderBridge::createWearable(parent_id, WT_SOCKS);
- }
- else if ("jacket" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- LLFolderBridge::createWearable(parent_id, WT_JACKET);
- }
- else if ("skirt" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- LLFolderBridge::createWearable(parent_id, WT_SKIRT);
- }
- else if ("gloves" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- LLFolderBridge::createWearable(parent_id, WT_GLOVES);
- }
- else if ("undershirt" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- LLFolderBridge::createWearable(parent_id, WT_UNDERSHIRT);
- }
- else if ("underpants" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- LLFolderBridge::createWearable(parent_id, WT_UNDERPANTS);
- }
- else if ("shape" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART);
- LLFolderBridge::createWearable(parent_id, WT_SHAPE);
- }
- else if ("skin" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART);
- LLFolderBridge::createWearable(parent_id, WT_SKIN);
- }
- else if ("hair" == type_name)
- {
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART);
- LLFolderBridge::createWearable(parent_id, WT_HAIR);
- }
- else if ("eyes" == type_name)
+ else
{
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART);
- LLFolderBridge::createWearable(parent_id, WT_EYES);
+ // Use for all clothing and body parts. Adding new wearable types requires updating LLWearableDictionary.
+ EWearableType wearable_type = LLWearableDictionary::typeNameToType(type_name);
+ if (wearable_type >= WT_SHAPE && wearable_type < WT_COUNT)
+ {
+ LLAssetType::EType asset_type = LLWearableDictionary::getAssetType(wearable_type);
+ LLFolderType::EType folder_type = LLFolderType::assetTypeToFolderType(asset_type);
+ const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(folder_type);
+ LLFolderBridge::createWearable(parent_id, wearable_type);
+ }
+ else
+ {
+ llwarns << "Can't create unrecognized type " << type_name << llendl;
+ }
}
-
folder->setNeedsAutoRename(TRUE);
}