diff options
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/lloutfitgallery.cpp | 11 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 70 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.h | 2 |
4 files changed, 49 insertions, 36 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 61d2013224..8cfe4f3d97 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7841,7 +7841,7 @@ <key>RenderMinFreeMainMemoryThreshold</key> <map> <key>Comment</key> - <string>Minimum of available physical memory in MB before textures get scaled down</string> + <string>If available free physical memory is below this value textures get agresively scaled down</string> <key>Persist</key> <integer>0</integer> <key>Type</key> diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index b1d5cd9e16..b84b0b3a8c 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -793,6 +793,17 @@ void LLOutfitGallery::updateAddedCategory(LLUUID cat_id) LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); if (!cat) return; + if (!isOutfitFolder(cat)) + { + // Assume a subfolder that contains or will contain outfits, track it + const LLUUID outfits = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); + mOutfitsObserver->addCategory(cat_id, [this, outfits]() + { + observerCallback(outfits); + }); + return; + } + std::string name = cat->getName(); LLOutfitGalleryItem* item = buildGalleryItem(name, cat_id); mOutfitMap.insert(LLOutfitGallery::outfit_map_value_t(cat_id, item)); diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 4ad4cb8d2c..df53c66ec1 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -142,6 +142,17 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id) LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); if (!cat) return; + if (!isOutfitFolder(cat)) + { + // Assume a subfolder that contains or will contain outfits, track it + const LLUUID outfits = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); + mCategoriesObserver->addCategory(cat_id, [this, outfits]() + { + observerCallback(outfits); + }); + return; + } + std::string name = cat->getName(); outfit_accordion_tab_params tab_params(get_accordion_tab_params()); @@ -819,49 +830,38 @@ void LLOutfitListBase::observerCallback(const LLUUID& category_id) refreshList(category_id); } -class LLIsOutfitListFolder : public LLInventoryCollectFunctor +bool LLOutfitListBase::isOutfitFolder(LLViewerInventoryCategory* cat) const { -public: - LLIsOutfitListFolder() + if (!cat) { - mOutfitsId = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); + return false; } - virtual ~LLIsOutfitListFolder() {} - - bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override + if (cat->getPreferredType() == LLFolderType::FT_OUTFIT) { - if (cat) + return true; + } + // assumes that folder is somewhere inside MyOutfits + if (cat->getPreferredType() == LLFolderType::FT_NONE) + { + LLViewerInventoryCategory* inv_cat = dynamic_cast<LLViewerInventoryCategory*>(cat); + if (inv_cat && inv_cat->getDescendentCount() > 3) { - if (cat->getPreferredType() == LLFolderType::FT_OUTFIT) + 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) // arbitrary, if doesn't have at least base parts, not an outfit { + // 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; } - 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; -}; + return false; +} void LLOutfitListBase::refreshList(const LLUUID& category_id) { @@ -872,13 +872,13 @@ void LLOutfitListBase::refreshList(const LLUUID& category_id) LLInventoryModel::item_array_t item_array; // Collect all sub-categories of a given category. - LLIsOutfitListFolder is_outfit; + LLIsType is_category(LLAssetType::AT_CATEGORY); gInventory.collectDescendentsIf( category_id, cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH, - is_outfit); + is_category); // Memorize item names for each UUID std::map<LLUUID, std::string> names; diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index f581b419d9..fad0e638fb 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -118,6 +118,8 @@ protected: void onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response); virtual void onChangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id) = 0; + bool isOutfitFolder(LLViewerInventoryCategory* cat) const; + static void onIdle(void* userdata); void onIdleRefreshList(); |