diff options
author | Jonathan Yap <none@none> | 2013-12-11 12:09:39 -0500 |
---|---|---|
committer | Jonathan Yap <none@none> | 2013-12-11 12:09:39 -0500 |
commit | 35daa8031979fc708640e2f2f9ab849e6cb156dd (patch) | |
tree | 1ae8fabb3e89822c54910709098eb5654c9e2391 /indra/newview | |
parent | b562de469a04c5b267e46c0a0bbf4d898e36d3f7 (diff) |
STORM-68 Re-add wearables callback that did not carry through in the merge.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llagentwearables.cpp | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index c741f6403d..f71b49010d 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -86,27 +86,26 @@ void wear_and_edit_cb(const LLUUID& inv_item) LLAppearanceMgr::instance().wearItemOnAvatar(inv_item); } -class LLCreateWearableCallback : public LLInventoryCallback +void wear_cb(const LLUUID& inv_item) { - void fire(const LLUUID& inv_item) + if (inv_item.isNull()) { - if (inv_item.isNull()) - return; + return; + } - LLViewerInventoryItem* item = gInventory.getItem(inv_item); - if (!item) return; + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + if (!item) return; - LLPermissions perm = item->getPermissions(); - perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables")); - perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables")); - perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables")); - item->setPermissions(perm); + LLPermissions perm = item->getPermissions(); + perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables")); + perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables")); + perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables")); + item->setPermissions(perm); - item->updateServer(FALSE); - gInventory.updateItem(item); - gInventory.notifyObservers(); - } -}; + item->updateServer(FALSE); + gInventory.updateItem(item); + gInventory.notifyObservers(); +} /////////////////////////////////////////////////////////////////////////////// @@ -1841,7 +1840,16 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp); LLAssetType::EType asset_type = wearable->getAssetType(); LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; - LLPointer<LLInventoryCallback> cb = wear ? new LLBoostFuncInventoryCallback(wear_and_edit_cb) : NULL; + LLPointer<LLInventoryCallback> cb; + if(wear) + { + cb = new LLBoostFuncInventoryCallback(wear_and_edit_cb); + } + else + { + cb = new LLBoostFuncInventoryCallback(wear_cb); + } + LLUUID folder_id; if (parent_id.notNull()) |