diff options
| author | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-06-02 18:24:15 +0300 |
|---|---|---|
| committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-06-02 18:24:15 +0300 |
| commit | f09e53da5f3bc56649c3f08894eb71c5fb907c10 (patch) | |
| tree | 85b467bd4b8e1a0b599d52c96e546f0e620dd49c /indra/newview/llwearableitemslist.cpp | |
| parent | 129d504dd90c9819d6cc60f70f3bcbb1489f3ade (diff) | |
| parent | 4896da3598d00095f573fddde21a84b05661aa79 (diff) | |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llwearableitemslist.cpp')
| -rw-r--r-- | indra/newview/llwearableitemslist.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 161cd40cfc..cfb48a22bb 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -94,6 +94,47 @@ LLPanelWearableListItem::LLPanelWearableListItem(LLViewerInventoryItem* item) ////////////////////////////////////////////////////////////////////////// // static +LLPanelWearableOutfitItem* LLPanelWearableOutfitItem::create(LLViewerInventoryItem* item) +{ + LLPanelWearableOutfitItem* list_item = NULL; + if (item) + { + list_item = new LLPanelWearableOutfitItem(item); + list_item->init(); + } + return list_item; +} + +BOOL LLPanelWearableOutfitItem::handleDoubleClick(S32 x, S32 y, MASK mask) +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLUUID id = item->getUUID(); + + if (get_is_item_worn(id)) + { + LLAppearanceMgr::getInstance()->removeItemFromAvatar(id); + } + else + { + LLAppearanceMgr::getInstance()->wearItemOnAvatar(id, true, false); + } + } + + return LLUICtrl::handleDoubleClick(x, y, mask); +} + +LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item) +: LLPanelInventoryListItemBase(item) +{ +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +// static LLPanelClothingListItem* LLPanelClothingListItem::create(LLViewerInventoryItem* item) { LLPanelClothingListItem* list_item = NULL; @@ -402,6 +443,27 @@ LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p) LLWearableItemsList::~LLWearableItemsList() {} +// virtual +void LLWearableItemsList::addNewItem(LLViewerInventoryItem* item, bool rearrange /*= true*/) +{ + if (!item) + { + llwarns << "No inventory item. Couldn't create flat list item." << llendl; + llassert(item != NULL); + } + + LLPanelWearableOutfitItem *list_item = LLPanelWearableOutfitItem::create(item); + if (!list_item) + return; + + bool is_item_added = addItem(list_item, item->getUUID(), ADD_BOTTOM, rearrange); + if (!is_item_added) + { + llwarns << "Couldn't add flat list item." << llendl; + llassert(is_item_added); + } +} + void LLWearableItemsList::updateList(const LLUUID& category_id) { LLInventoryModel::cat_array_t cat_array; |
