From 29078e7696c0cdee21e336ddb701f6c7966a33e0 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 8 Jun 2016 16:08:36 +0300 Subject: MAINT-6473 Request for Drag & Drop functionality for adding images to Outfit Folders --- indra/newview/llappearancemgr.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index cc676550ab..e7e85467cd 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include +#include #include "llaccordionctrltab.h" #include "llagent.h" #include "llagentcamera.h" @@ -1515,6 +1516,26 @@ void LLAppearanceMgr::replaceCurrentOutfit(const LLUUID& new_outfit) wearInventoryCategory(cat, false, false); } +// Remove existing photo link from outfit folder. +void LLAppearanceMgr::removeOutfitPhoto(const LLUUID& outfit_id) +{ + LLInventoryModel::cat_array_t sub_cat_array; + LLInventoryModel::item_array_t outfit_item_array; + gInventory.collectDescendents( + outfit_id, + sub_cat_array, + outfit_item_array, + LLInventoryModel::EXCLUDE_TRASH); + BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) + { + LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); + if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + { + gInventory.removeItem(outfit_item->getUUID()); + } + } +} + // Open outfit renaming dialog. void LLAppearanceMgr::renameOutfit(const LLUUID& outfit_id) { -- cgit v1.2.3 From fc17f62335d728e79bf9f18f76482fa3bf45b34e Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 5 Sep 2016 17:32:50 +0300 Subject: MAINT-6685 [VOB] Outfit Image from an Outfit Gallery disappears after editing outfit --- indra/newview/llappearancemgr.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 0ea206186c..1f8adbcb95 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3113,6 +3113,14 @@ void appearance_mgr_update_dirty_state() { if (LLAppearanceMgr::instanceExists()) { + LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance(); + LLUUID image_id = app_mgr.getOutfitImage(); + if(image_id.notNull()) + { + LLPointer cb = NULL; + link_inventory_object(app_mgr.getBaseOutfitUUID(), image_id, cb); + } + LLAppearanceMgr::getInstance()->updateIsDirty(); LLAppearanceMgr::getInstance()->setOutfitLocked(false); gAgentWearables.notifyLoadingFinished(); @@ -3122,7 +3130,21 @@ void appearance_mgr_update_dirty_state() void update_base_outfit_after_ordering() { LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance(); - + LLInventoryModel::cat_array_t sub_cat_array; + LLInventoryModel::item_array_t outfit_item_array; + gInventory.collectDescendents(app_mgr.getBaseOutfitUUID(), + sub_cat_array, + outfit_item_array, + LLInventoryModel::EXCLUDE_TRASH); + BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) + { + LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); + if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + { + app_mgr.setOutfitImage(linked_item->getLinkedUUID()); + } + } + LLPointer dirty_state_updater = new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state); -- cgit v1.2.3 From ec9b92d274b6fb0d8d14ed88010835a5feab2a07 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 6 Sep 2016 14:07:20 +0300 Subject: MAINT-6698 [VOB] "Save" button is always enabled for outfit with non-default image even if there were no changes --- indra/newview/llappearancemgr.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llappearancemgr.cpp') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 1f8adbcb95..ff5439d610 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2966,6 +2966,16 @@ void LLAppearanceMgr::updateIsDirty() gInventory.collectDescendentsIf(base_outfit, outfit_cats, outfit_items, LLInventoryModel::EXCLUDE_TRASH, collector); + for (U32 i = 0; i < outfit_items.size(); ++i) + { + LLViewerInventoryItem* linked_item = outfit_items.at(i)->getLinkedItem(); + if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + { + outfit_items.erase(outfit_items.begin() + i); + break; + } + } + if(outfit_items.size() != cof_items.size()) { LL_DEBUGS("Avatar") << "item count different - base " << outfit_items.size() << " cof " << cof_items.size() << LL_ENDL; -- cgit v1.2.3