summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2009-11-03 13:00:08 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2009-11-03 13:00:08 -0500
commitcc24d843274edf9039a3c9c65018a89a1f9588ec (patch)
tree5435dc48e1c85fcc3c0f054efa154f9c23947d64 /indra/newview/llappearancemgr.cpp
parente299bea7e92dadbda09fb33339a04000e679aa2e (diff)
parent8f6b28d89f1b680db0c17cea680f1a184f298583 (diff)
Automated merge with ssh://hg.lindenlab.com/tulla/avatar-pipeline-2-0
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index c297f8db29..8d0f11e021 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -1181,6 +1181,14 @@ void LLAppearanceManager::dumpItemArray(const LLInventoryModel::item_array_t& it
std::set<LLUUID> LLAppearanceManager::sRegisteredAttachments;
+bool LLAppearanceManager::sAttachmentInvLinkEnabled(false);
+
+/* static */
+void LLAppearanceManager::setAttachmentInvLinkEnable(bool val)
+{
+ llinfos << "setAttachmentInvLinkEnable => " << (int) val << llendl;
+ sAttachmentInvLinkEnabled = val;
+}
void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg)
{
@@ -1204,6 +1212,22 @@ void LLAppearanceManager::registerAttachment(const LLUUID& item_id)
{
sRegisteredAttachments.insert(item_id);
dumpAttachmentSet(sRegisteredAttachments,"after register:");
+
+ if (sAttachmentInvLinkEnabled)
+ {
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ if (item)
+ {
+ LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Adding attachment link:");
+ LLAppearanceManager::wearItem(item,false); // Add COF link for item.
+ gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
+ gInventory.notifyObservers();
+ }
+ }
+ else
+ {
+ llinfos << "no link changes, inv link not enabled" << llendl;
+ }
}
/* static */
@@ -1211,4 +1235,17 @@ void LLAppearanceManager::unregisterAttachment(const LLUUID& item_id)
{
sRegisteredAttachments.erase(item_id);
dumpAttachmentSet(sRegisteredAttachments,"after unregister:");
+
+ if (sAttachmentInvLinkEnabled)
+ {
+ LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Removing attachment link:");
+ LLAppearanceManager::removeItemLinks(item_id, false);
+ // BAP - needs to change for label to track link.
+ gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
+ gInventory.notifyObservers();
+ }
+ else
+ {
+ llinfos << "no link changes, inv link not enabled" << llendl;
+ }
}