diff options
Diffstat (limited to 'indra/newview/llcofwearables.cpp')
-rw-r--r-- | indra/newview/llcofwearables.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 29c32b6fa2..498aeec682 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -114,7 +114,7 @@ void LLCOFWearables::refresh() populateAttachmentsAndBodypartsLists(cof_items); - LLAppearanceMgr::wearables_by_type_t clothing_by_type(WT_COUNT); + LLAppearanceMgr::wearables_by_type_t clothing_by_type(LLWearableType::WT_COUNT); LLAppearanceMgr::getInstance()->divvyWearablesByType(cof_items, clothing_by_type); populateClothingList(clothing_by_type); @@ -150,7 +150,7 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel LLPanelInventoryListItemBase* item_panel = NULL; if (item_type == LLAssetType::AT_OBJECT) { - item_panel = LLPanelInventoryListItemBase::create(item); + item_panel = buildAttachemntListItem(item); mAttachments->addItem(item_panel, item->getUUID(), ADD_BOTTOM, false); } else if (item_type == LLAssetType::AT_BODYPART) @@ -232,11 +232,26 @@ LLPanelBodyPartsListItem* LLCOFWearables::buildBodypartListItem(LLViewerInventor return item_panel; } +LLPanelDeletableWearableListItem* LLCOFWearables::buildAttachemntListItem(LLViewerInventoryItem* item) +{ + llassert(item); + if (!item) return NULL; + + LLPanelDeletableWearableListItem* item_panel = LLPanelDeletableWearableListItem::create(item); + if (!item_panel) return NULL; + + //setting callbacks + //*TODO move that item panel's inner structure disclosing stuff into the panels + item_panel->childSetAction("btn_delete", mCOFCallbacks.mDeleteWearable); + + return item_panel; +} + void LLCOFWearables::populateClothingList(LLAppearanceMgr::wearables_by_type_t& clothing_by_type) { - llassert(clothing_by_type.size() == WT_COUNT); + llassert(clothing_by_type.size() == LLWearableType::WT_COUNT); - for (U32 type = WT_SHIRT; type < WT_COUNT; ++type) + for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; ++type) { U32 size = clothing_by_type[type].size(); if (!size) continue; @@ -263,14 +278,14 @@ void LLCOFWearables::populateClothingList(LLAppearanceMgr::wearables_by_type_t& //adding dummy items for missing wearable types void LLCOFWearables::addClothingTypesDummies(const LLAppearanceMgr::wearables_by_type_t& clothing_by_type) { - llassert(clothing_by_type.size() == WT_COUNT); + llassert(clothing_by_type.size() == LLWearableType::WT_COUNT); - for (U32 type = WT_SHIRT; type < WT_COUNT; type++) + for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; type++) { U32 size = clothing_by_type[type].size(); if (size) continue; - EWearableType w_type = static_cast<EWearableType>(type); + LLWearableType::EType w_type = static_cast<LLWearableType::EType>(type); LLPanelInventoryListItemBase* item_panel = LLPanelDummyClothingListItem::create(w_type); if(!item_panel) continue; mClothing->addItem(item_panel, LLUUID::null, ADD_BOTTOM, false); |