diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-04-19 21:14:33 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-04-19 21:14:33 +0800 |
commit | 9595a3dee48eb8b7f10cad02b4ebdda5f596664e (patch) | |
tree | aadbfc379b2028e1f22662d38b1094c745064ad9 /indra/newview/lloutfitslist.cpp | |
parent | ad9c801edb13568657c0964ebfb74257da6d9e00 (diff) | |
parent | 9a333e65c4019540d5675e72ac57ef5ab106aab0 (diff) |
Merge tag 'Second_Life_Release#9a333e65-2025.04' into 2025.04
Diffstat (limited to 'indra/newview/lloutfitslist.cpp')
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 6e666b8a4b..9d8493549d 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -819,6 +819,50 @@ void LLOutfitListBase::observerCallback(const LLUUID& category_id) refreshList(category_id); } +class LLIsOutfitListFolder : public LLInventoryCollectFunctor +{ +public: + LLIsOutfitListFolder() + { + mOutfitsId = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); + } + virtual ~LLIsOutfitListFolder() {} + + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override + { + if (cat) + { + if (cat->getPreferredType() == LLFolderType::FT_OUTFIT) + { + return true; + } + if (cat->getPreferredType() == LLFolderType::FT_NONE + && cat->getParentUUID() == mOutfitsId) + { + LLViewerInventoryCategory* inv_cat = dynamic_cast<LLViewerInventoryCategory*>(cat); + if (inv_cat && inv_cat->getDescendentCount() > 3) + { + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(inv_cat->getUUID(), cats, items); + if (cats->empty() // protection against outfits inside + && items->size() > 3) // eyes, skin, hair and shape are required + { + // For now assume this to be an old style outfit, not a subfolder + // but ideally no such 'outfits' should be left in My Outfits + // Todo: stop counting FT_NONE as outfits, + // convert obvious outfits into FT_OUTFIT + return true; + } + } + } + } + return false; + } +protected: + LLUUID mOutfitsId; +}; + void LLOutfitListBase::refreshList(const LLUUID& category_id) { bool wasNull = mRefreshListState.CategoryUUID.isNull(); @@ -828,13 +872,13 @@ void LLOutfitListBase::refreshList(const LLUUID& category_id) LLInventoryModel::item_array_t item_array; // Collect all sub-categories of a given category. - LLIsType is_category(LLAssetType::AT_CATEGORY); + LLIsOutfitListFolder is_outfit; gInventory.collectDescendentsIf( category_id, cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH, - is_category); + is_outfit); // Memorize item names for each UUID std::map<LLUUID, std::string> names; |