diff options
author | James Cook <james@lindenlab.com> | 2009-12-09 13:24:21 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-12-09 13:24:21 -0800 |
commit | 6260ce6a9210192963a77e5b1f44b0d2c2c86591 (patch) | |
tree | 949f5d4e19149ecea3d4dd05f72e1a480aaf8c38 /indra/newview/llviewerinventory.cpp | |
parent | 7193e97b982d69de75ee6bb5769f5e53ccfb517d (diff) | |
parent | 883ef71722a27fdb1c09abfa4a4421569d416cd2 (diff) |
Merge
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 78 |
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); } |