summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-09-29 21:27:37 +0300
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-10-03 21:14:34 +0300
commitaee8f570e14684e6143a18541ba0bc9a5060fa98 (patch)
tree3bce2ecb6a1b4552c6516da259f11444cbcf9ffe /indra/newview/llappearancemgr.cpp
parentd4123ec30d9a5daa96b28f2b8a3cc36ccd7e9cb1 (diff)
SL-20368 Request outfits using 'links'
instead of getting items one by one
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 8010b84c20..667ae999bb 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2776,9 +2776,33 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool
else
{
selfStartPhase("wear_inventory_category_fetch");
- callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal,
- &LLAppearanceMgr::instance(),
- category->getUUID(), copy, append));
+ if (AISAPI::isAvailable() && category->getPreferredType() == LLFolderType::FT_OUTFIT)
+ {
+ // for reliability just fetch it whole, linked items included
+ LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)category;
+ LLUUID cat_id = category->getUUID();
+ cat->setFetching(LLViewerInventoryCategory::FETCH_RECURSIVE);
+ AISAPI::FetchCategoryLinks(cat_id,
+ [cat_id, copy, append](const LLUUID& id)
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
+ if (cat)
+ {
+ cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
+ }
+ if (id.isNull())
+ {
+ LL_WARNS() << "failed to fetch category, attempting to wear as is " << cat_id << LL_ENDL;
+ }
+ LLAppearanceMgr::instance().wearCategoryFinal(cat_id, copy, append);
+ });
+ }
+ else
+ {
+ callAfterCategoryFetch(category->getUUID(), boost::bind(&LLAppearanceMgr::wearCategoryFinal,
+ &LLAppearanceMgr::instance(),
+ category->getUUID(), copy, append));
+ }
}
}
@@ -2787,7 +2811,7 @@ S32 LLAppearanceMgr::getActiveCopyOperations() const
return LLCallAfterInventoryCopyMgr::getInstanceCount();
}
-void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append)
+void LLAppearanceMgr::wearCategoryFinal(const LLUUID& cat_id, bool copy_items, bool append)
{
LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL;