summaryrefslogtreecommitdiff
path: root/indra/newview/llagentwearables.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2010-02-26 19:18:15 -0800
committerRoxie Linden <roxie@lindenlab.com>2010-02-26 19:18:15 -0800
commita2efe4bb4154b7ecb9c7cb279f7a28d7d401a93a (patch)
tree4cafd0e64a9c45b444664d12f022cd3e675bfebd /indra/newview/llagentwearables.cpp
parent5352954eb65076d877cc74d4328620e910b93d1c (diff)
parent1ae70e112a466a6ed5baf4e05c1771218c78b2f5 (diff)
automated merge
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r--indra/newview/llagentwearables.cpp126
1 files changed, 69 insertions, 57 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 41f2ff29e6..f4bc35002b 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -299,6 +299,10 @@ void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& i
{
gAgentWearables.makeNewOutfitDone(mType, mIndex);
}
+ if (mTodo & CALL_WEARITEM)
+ {
+ LLAppearanceManager::instance().addCOFItemLink(inv_item, true);
+ }
}
void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type,
@@ -310,21 +314,24 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type,
return;
LLUUID old_item_id = getWearableItemID((EWearableType)type,index);
+
if (wearable)
{
wearable->setItemID(item_id);
- }
- if (old_item_id.notNull())
- {
- gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id);
- setWearable((EWearableType)type,index,wearable);
- }
- else
- {
- pushWearable((EWearableType)type,wearable);
+ if (old_item_id.notNull())
+ {
+ gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id);
+ setWearable((EWearableType)type,index,wearable);
+ }
+ else
+ {
+ pushWearable((EWearableType)type,wearable);
+ }
}
+
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
+
LLViewerInventoryItem* item = gInventory.getItem(item_id);
if (item && wearable)
{
@@ -507,7 +514,7 @@ void LLAgentWearables::saveWearableAs(const EWearableType type,
type,
index,
new_wearable,
- addWearableToAgentInventoryCallback::CALL_UPDATE);
+ addWearableToAgentInventoryCallback::CALL_WEARITEM);
LLUUID category_id;
if (save_in_lost_and_found)
{
@@ -761,6 +768,8 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable)
wearable->refreshName();
wearable->setLabelUpdated();
+ wearable->pullCrossWearableValues();
+
// Hack pt 2. If the wearable we just loaded has definition version 24,
// then force a re-save of this wearable after slamming the version number to 22.
// This number was incorrectly incremented for internal builds before release, and
@@ -927,13 +936,6 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs
if (mInitialWearablesUpdateReceived)
return;
mInitialWearablesUpdateReceived = true;
-
- // If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account)
- // then auto-populate outfits from the library into the My Outfits folder.
- if (LLInventoryModel::getIsFirstTimeInViewer2() || gSavedSettings.getBOOL("MyOutfitsAutofill"))
- {
- gAgentWearables.populateMyOutfitsFolder();
- }
LLUUID agent_id;
gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
@@ -1292,25 +1294,29 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name,
j,
new_wearable,
todo);
- if (isWearableCopyable((EWearableType)type, j))
- {
- copy_inventory_item(
- gAgent.getID(),
- item->getPermissions().getOwner(),
- item->getUUID(),
- folder_id,
- new_name,
- cb);
- }
- else
+ llassert(item);
+ if (item)
{
- move_inventory_item(
- gAgent.getID(),
- gAgent.getSessionID(),
- item->getUUID(),
- folder_id,
- new_name,
- cb);
+ if (isWearableCopyable((EWearableType)type, j))
+ {
+ copy_inventory_item(
+ gAgent.getID(),
+ item->getPermissions().getOwner(),
+ item->getUUID(),
+ folder_id,
+ new_name,
+ cb);
+ }
+ else
+ {
+ move_inventory_item(
+ gAgent.getID(),
+ gAgent.getSessionID(),
+ item->getUUID(),
+ folder_id,
+ new_name,
+ cb);
+ }
}
}
}
@@ -1417,7 +1423,7 @@ LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name)
new_folder_name);
LLPointer<LLInventoryCallback> cb = new LLShowCreatedOutfit(folder_id);
- LLAppearanceManager::instance().shallowCopyCategory(LLAppearanceManager::instance().getCOF(),folder_id, cb);
+ LLAppearanceManager::instance().shallowCopyCategoryContents(LLAppearanceManager::instance().getCOF(),folder_id, cb);
LLAppearanceManager::instance().createBaseOutfitLink(folder_id, cb);
return folder_id;
@@ -1599,32 +1605,35 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
LLWearable* new_wearable = wearables[i];
LLPointer<LLInventoryItem> new_item = items[i];
- const EWearableType type = new_wearable->getType();
- wearables_to_remove[type] = FALSE;
-
- // MULTI_WEARABLE: using 0th
- LLWearable* old_wearable = getWearable(type, 0);
- if (old_wearable)
+ llassert(new_wearable);
+ if (new_wearable)
{
- const LLUUID& old_item_id = getWearableItemID(type, 0);
- if ((old_wearable->getAssetID() == new_wearable->getAssetID()) &&
- (old_item_id == new_item->getUUID()))
- {
- lldebugs << "No change to wearable asset and item: " << LLWearableDictionary::getInstance()->getWearableEntry(type) << llendl;
- continue;
- }
+ const EWearableType type = new_wearable->getType();
+ wearables_to_remove[type] = FALSE;
- // Assumes existing wearables are not dirty.
- if (old_wearable->isDirty())
+ // MULTI_WEARABLE: using 0th
+ LLWearable* old_wearable = getWearable(type, 0);
+ if (old_wearable)
{
- llassert(0);
- continue;
+ const LLUUID& old_item_id = getWearableItemID(type, 0);
+ if ((old_wearable->getAssetID() == new_wearable->getAssetID()) &&
+ (old_item_id == new_item->getUUID()))
+ {
+ lldebugs << "No change to wearable asset and item: " << LLWearableDictionary::getInstance()->getWearableEntry(type) << llendl;
+ continue;
+ }
+
+ // Assumes existing wearables are not dirty.
+ if (old_wearable->isDirty())
+ {
+ llassert(0);
+ continue;
+ }
}
- }
- if (new_wearable)
new_wearable->setItemID(new_item->getUUID());
- setWearable(type,0,new_wearable);
+ setWearable(type,0,new_wearable);
+ }
}
std::vector<LLWearable*> wearables_being_removed;
@@ -1664,6 +1673,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
if (mAvatarObject)
{
mAvatarObject->updateVisualParams();
+ mAvatarObject->invalidateAll();
}
// Start rendering & update the server
@@ -2143,6 +2153,8 @@ void LLAgentWearables::updateServer()
void LLAgentWearables::populateMyOutfitsFolder(void)
{
+ llinfos << "starting outfit populate" << llendl;
+
LLLibraryOutfitsFetch* outfits = new LLLibraryOutfitsFetch();
// Get the complete information on the items in the inventory and
@@ -2334,7 +2346,7 @@ void LLLibraryOutfitsFetch::libraryDone(void)
LLUUID folder_id = gInventory.createNewCategory(mImportedClothingID,
LLFolderType::FT_NONE,
iter->second);
- LLAppearanceManager::getInstance()->shallowCopyCategory(iter->first, folder_id, copy_waiter);
+ LLAppearanceManager::getInstance()->shallowCopyCategoryContents(iter->first, folder_id, copy_waiter);
}
}
else