summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2009-11-03 12:53:40 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2009-11-03 12:53:40 -0500
commit8f6b28d89f1b680db0c17cea680f1a184f298583 (patch)
tree73d05fac4f1ae001261a4ecd9093a2e7de0592f8 /indra/newview
parentda3f4c402dd95e52186309af925b41ee946ef3dc (diff)
parent9109809fb18968edfcd8e8f01428309fcc2e7578 (diff)
Automated merge with ssh://hg.lindenlab.com/tulla/avatar-pipeline-2-0
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llagentwearables.cpp3
-rw-r--r--indra/newview/llappearancemgr.cpp37
-rw-r--r--indra/newview/llappearancemgr.h3
-rw-r--r--indra/newview/llvoavatarself.cpp13
4 files changed, 41 insertions, 15 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 81c899312d..4b3d27767c 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -2015,7 +2015,8 @@ void LLInitialWearablesFetch::done()
LLFindWearables is_wearable;
gInventory.collectDescendentsIf(mCompleteFolders.front(), cat_array, wearable_array,
LLInventoryModel::EXCLUDE_TRASH, is_wearable);
-
+
+ LLAppearanceManager::setAttachmentInvLinkEnable(true);
if (wearable_array.count() > 0)
{
LLAppearanceManager::instance().updateAppearanceFromCOF();
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;
+ }
}
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 45c6e23bae..56f54dfc23 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -70,7 +70,7 @@ public:
static void dumpItemArray(const LLInventoryModel::item_array_t& items, const std::string& msg);
static void unregisterAttachment(const LLUUID& item_id);
static void registerAttachment(const LLUUID& item_id);
-
+ static void setAttachmentInvLinkEnable(bool val);
private:
static void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type);
@@ -99,6 +99,7 @@ private:
static void purgeCategory(const LLUUID& category, bool keep_outfit_links);
static std::set<LLUUID> sRegisteredAttachments;
+ static bool sAttachmentInvLinkEnabled;
};
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 44fd81f0d1..a964f43171 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -1081,15 +1081,7 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view
{
const LLUUID& attachment_id = viewer_object->getItemID();
LLAppearanceManager::registerAttachment(attachment_id);
- LLViewerInventoryItem *item = gInventory.getItem(attachment_id);
- if (item)
- {
- LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Adding attachment link:");
- LLAppearanceManager::wearItem(item,false); // Add COF link for item.
- gInventory.addChangedMask(LLInventoryObserver::LABEL, attachment_id);
- }
}
- gInventory.notifyObservers();
return attachment;
}
@@ -1127,14 +1119,9 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
}
else
{
- LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Removing attachment link:");
- LLAppearanceManager::removeItemLinks(attachment_id, false);
LLAppearanceManager::unregisterAttachment(attachment_id);
}
- // BAP - needs to change for label to track link.
- gInventory.addChangedMask(LLInventoryObserver::LABEL, attachment_id);
- gInventory.notifyObservers();
return TRUE;
}
return FALSE;