diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-07-19 21:15:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-19 21:15:52 +0300 |
commit | 3058e6e6fd66ad4abb91fa5354ee11f6b7843a02 (patch) | |
tree | b18fa67f59c74d9dde9008b8d42105de38509ae7 /indra/newview/llappearancemgr.cpp | |
parent | acf82867b61535b7b39b89f71a282e3ce3d0673e (diff) |
SL-20015 wait for the outfit items to load before wearing it
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 454ac5d88c..d4fc6a9f9d 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -4612,6 +4612,35 @@ void callAfterCategoryFetch(const LLUUID& cat_id, nullary_func_t cb) } } +void callAfterCategoryLinksFetch(const LLUUID &cat_id, nullary_func_t cb) +{ + LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); + if (AISAPI::isAvailable()) + { + // Mark folder (update timer) so that background fetch won't request it + cat->setFetching(LLViewerInventoryCategory::FETCH_RECURSIVE); + // Assume that we have no relevant cache. Fetch folder, and items folder's links point to. + AISAPI::FetchCategoryLinks(cat_id, + [cb, cat_id](const LLUUID &id) + { + cb(); + LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); + if (cat) + { + cat->setFetching(LLViewerInventoryCategory::FETCH_NONE); + } + }); + } + else + { + LL_WARNS() << "AIS API v3 not available, can't use AISAPI::FetchCOF" << LL_ENDL; + // startup should have marked folder as fetching, remove that + cat->setFetching(LLViewerInventoryCategory::FETCH_NONE); + callAfterCategoryFetch(cat_id, cb); + } + +} + void add_wearable_type_counts(const uuid_vec_t& ids, S32& clothing_count, S32& bodypart_count, |