diff options
author | Thomas Nelson <rider@lindenlab.com> | 2017-10-17 13:38:39 -0700 |
---|---|---|
committer | Thomas Nelson <rider@lindenlab.com> | 2017-10-17 13:38:39 -0700 |
commit | 5754493cdcfeac76d0576abc19bdf5a03717780d (patch) | |
tree | e6db53ae1cd654f9b2a1a6b9ab47e01ea738ecef /indra/newview/llappearancemgr.cpp | |
parent | cc22ffc6d799544e8f2a9dfed6813081d908c88d (diff) | |
parent | 9c5becd67d7e6fe5f696dcae8690dd562b7b0449 (diff) |
Merged lindenlab/viewer64 into default
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c928cf0601..0fb811a386 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1321,6 +1321,8 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items) //========================================================================= +const std::string LLAppearanceMgr::sExpectedTextureName = "OutfitPreview"; + const LLUUID LLAppearanceMgr::getCOF() const { return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); @@ -1571,7 +1573,14 @@ void LLAppearanceMgr::removeOutfitPhoto(const LLUUID& outfit_id) BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); - if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + if (linked_item != NULL) + { + if (linked_item->getActualType() == LLAssetType::AT_TEXTURE) + { + gInventory.removeItem(outfit_item->getUUID()); + } + } + else if (outfit_item->getActualType() == LLAssetType::AT_TEXTURE) { gInventory.removeItem(outfit_item->getUUID()); } @@ -3209,6 +3218,7 @@ void appearance_mgr_update_dirty_state() void update_base_outfit_after_ordering() { LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance(); + app_mgr.setOutfitImage(LLUUID()); LLInventoryModel::cat_array_t sub_cat_array; LLInventoryModel::item_array_t outfit_item_array; gInventory.collectDescendents(app_mgr.getBaseOutfitUUID(), @@ -3218,9 +3228,26 @@ void update_base_outfit_after_ordering() BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); - if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + if (linked_item != NULL) + { + if (linked_item->getActualType() == LLAssetType::AT_TEXTURE) + { + app_mgr.setOutfitImage(linked_item->getLinkedUUID()); + if (linked_item->getName() == LLAppearanceMgr::sExpectedTextureName) + { + // Images with "appropriate" name take priority + break; + } + } + } + else if (outfit_item->getActualType() == LLAssetType::AT_TEXTURE) { - app_mgr.setOutfitImage(linked_item->getLinkedUUID()); + app_mgr.setOutfitImage(outfit_item->getUUID()); + if (outfit_item->getName() == LLAppearanceMgr::sExpectedTextureName) + { + // Images with "appropriate" name take priority + break; + } } } |