diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-29 20:51:58 +0300 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-29 20:51:58 +0300 |
commit | 205d6ef5d6d05f5a429f987a78f45bbb2359404d (patch) | |
tree | 44751b4fcef34305cba060973ea1db85708f0b0f | |
parent | 05a4485082b07208a3b5b8d5c2070243cb237e42 (diff) |
SL-19379 WIP show wearable type icons
-rw-r--r-- | indra/newview/llinventorygallery.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llinventorygallery.h | 4 |
2 files changed, 18 insertions, 8 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 8516ff37c2..e31b6b1527 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -461,7 +461,7 @@ void LLInventoryGallery::removeFromLastRow(LLInventoryGalleryItem* item) mItemPanels.pop_back(); } -LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, bool is_link) +LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, bool is_link) { LLInventoryGalleryItem::Params giparams; LLInventoryGalleryItem* gitem = LLUICtrlFactory::create<LLInventoryGalleryItem>(giparams); @@ -472,7 +472,7 @@ LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, L gitem->setName(name); gitem->setUUID(item_id); gitem->setGallery(this); - gitem->setType(type, is_link); + gitem->setType(type, inventory_type, flags, is_link); gitem->setThumbnail(thumbnail_id); gitem->setCreatorName(get_searchable_creator_name(&gInventory, item_id)); gitem->setDescription(get_searchable_description(&gInventory, item_id)); @@ -621,7 +621,8 @@ void LLInventoryGallery::updateAddedItem(LLUUID item_id) std::string name = obj->getName(); LLUUID thumbnail_id = obj->getThumbnailUUID();; - + LLInventoryType::EType inventory_type(LLInventoryType::IT_CATEGORY); + U32 misc_flags = 0; if (LLAssetType::AT_CATEGORY == obj->getType()) { name = get_localized_folder_name(item_id); @@ -630,8 +631,17 @@ void LLInventoryGallery::updateAddedItem(LLUUID item_id) thumbnail_id = getOutfitImageID(item_id); } } + else + { + LLInventoryItem* inv_item = gInventory.getItem(item_id); + if (inv_item) + { + inventory_type = inv_item->getInventoryType(); + misc_flags = inv_item->getFlags(); + } + } - LLInventoryGalleryItem* item = buildGalleryItem(name, item_id, obj->getType(), thumbnail_id, obj->getIsLinkType()); + LLInventoryGalleryItem* item = buildGalleryItem(name, item_id, obj->getType(), thumbnail_id, inventory_type, misc_flags, obj->getIsLinkType()); mItemMap.insert(LLInventoryGallery::gallery_item_map_t::value_type(item_id, item)); item->setRightMouseDownCallback(boost::bind(&LLInventoryGallery::showContextMenu, this, _1, _2, _3, item_id)); item->setFocusReceivedCallback(boost::bind(&LLInventoryGallery::onChangeItemSelection, this, item_id)); @@ -950,12 +960,12 @@ BOOL LLInventoryGalleryItem::postBuild() return TRUE; } -void LLInventoryGalleryItem::setType(LLAssetType::EType type, bool is_link) +void LLInventoryGalleryItem::setType(LLAssetType::EType type, LLInventoryType::EType inventory_type, U32 flags, bool is_link) { mType = type; mIsFolder = (mType == LLAssetType::AT_CATEGORY); - std::string icon_name = LLInventoryIcon::getIconName(mType); + std::string icon_name = LLInventoryIcon::getIconName(mType, inventory_type, flags); if(mIsFolder) { mSortGroup = SG_NORMAL_FOLDER; diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index 09eafc8396..9d1a277c65 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -144,7 +144,7 @@ private: void updateRowsIfNeeded(); void updateGalleryWidth(); - LLInventoryGalleryItem* buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, bool is_link); + LLInventoryGalleryItem* buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, bool is_link); void buildGalleryPanel(int row_count); void reshapeGalleryPanel(int row_count); @@ -237,7 +237,7 @@ public: bool isHidden() {return mHidden;} void setHidden(bool hidden) {mHidden = hidden;} - void setType(LLAssetType::EType type, bool is_link); + void setType(LLAssetType::EType type, LLInventoryType::EType inventory_type, U32 flags, bool is_link); void setThumbnail(LLUUID id); void setGallery(LLInventoryGallery* gallery) { mGallery = gallery; } bool isFolder() { return mIsFolder; } |