summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp33
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;
+ }
}
}