diff options
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 57 | ||||
-rw-r--r-- | indra/newview/llappearancemgr.h | 7 |
2 files changed, 31 insertions, 33 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5f2d22d78c..9301a47e6e 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -361,6 +361,31 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLIn dst = new_dst; } +static void onWearableAssetFetch(LLWearable* wearable, void* data) +{ + LLWearableHoldingPattern* holder = (LLWearableHoldingPattern*)data; + bool append = holder->append; + + if(wearable) + { + for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin(); + iter != holder->mFoundList.end(); ++iter) + { + LLFoundData* data = *iter; + if(wearable->getAssetID() == data->mAssetID) + { + data->mWearable = wearable; + break; + } + } + } + holder->mResolved += 1; + if(holder->mResolved >= (S32)holder->mFoundList.size()) + { + LLAppearanceManager::instance().updateAgentWearables(holder, append); + } +} + LLUUID LLAppearanceManager::getCOF() { return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); @@ -760,32 +785,6 @@ void LLAppearanceManager::rebuildCOFFromOutfit(const LLUUID& category) } } -/* static */ -void LLAppearanceManager::onWearableAssetFetch(LLWearable* wearable, void* data) -{ - LLWearableHoldingPattern* holder = (LLWearableHoldingPattern*)data; - bool append = holder->append; - - if(wearable) - { - for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin(); - iter != holder->mFoundList.end(); ++iter) - { - LLFoundData* data = *iter; - if(wearable->getAssetID() == data->mAssetID) - { - data->mWearable = wearable; - break; - } - } - } - holder->mResolved += 1; - if(holder->mResolved >= (S32)holder->mFoundList.size()) - { - LLAppearanceManager::instance().updateAgentWearables(holder, append); - } -} - void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder, bool append) { lldebugs << "updateAgentWearables()" << llendl; @@ -893,7 +892,7 @@ void LLAppearanceManager::updateAppearanceFromCOF() LLWearableList::instance().getAsset(found->mAssetID, found->mName, found->mAssetType, - LLAppearanceManager::onWearableAssetFetch, + onWearableAssetFetch, (void*)holder); } } @@ -1009,7 +1008,9 @@ void LLAppearanceManager::wearInventoryCategoryOnAvatar( LLInventoryCategory* ca if( gFloaterCustomize ) { - gFloaterCustomize->askToSaveIfDirty(boost::bind(LLAppearanceManager::changeOutfit, _1, category->getUUID(), append)); + gFloaterCustomize->askToSaveIfDirty(boost::bind(&LLAppearanceManager::changeOutfit, + &LLAppearanceManager::instance(), + _1, category->getUUID(), append)); } else { diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index b0ecb2e23e..4401596e2c 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -55,6 +55,7 @@ public: void wearOutfitByName(const std::string& name); void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, LLPointer<LLInventoryCallback> cb); + void changeOutfit(bool proceed, const LLUUID& category, bool append); // Add COF link to individual item. void wearItem(LLInventoryItem* item, bool do_update = true); @@ -73,6 +74,7 @@ public: void registerAttachment(const LLUUID& item_id); void setAttachmentInvLinkEnable(bool val); void linkRegisteredAttachments(); + void updateAgentWearables(LLWearableHoldingPattern* holder, bool append); protected: LLAppearanceManager(); @@ -98,7 +100,6 @@ private: LLInventoryModel::item_array_t& obj_items, LLInventoryModel::item_array_t& gest_items, bool follow_folder_links); - void updateAgentWearables(LLWearableHoldingPattern* holder, bool append); bool isMandatoryWearableType(EWearableType type); void checkMandatoryWearableTypes(const LLUUID& category, std::set<EWearableType>& types_found); void purgeCOFBeforeRebuild(const LLUUID& category); @@ -106,10 +107,6 @@ private: std::set<LLUUID> mRegisteredAttachments; bool mAttachmentInvLinkEnabled; - - // Static callbacks - static void onWearableAssetFetch(LLWearable* wearable, void* data); - static void changeOutfit(bool proceed, const LLUUID& category, bool append); }; #define SUPPORT_ENSEMBLES 0 |