Merged with default tip (Revision 299fd6b5fbc8)
--HG-- branch : Appearance-Miscmaster
commit
b813bc8bb0
|
|
@ -0,0 +1 @@
|
|||
97b8bd6e8c30abd2fa63d6776ce1ece6cb5160ff
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
[Appearance/Misc]
|
||||
- fixed : LLAppearanceMgr::filterWearableItems() doesn't properly filter body parts
|
||||
- fixed : LLWearableList::processGetAssetReply() creates multiple LLWearable instances for the same asset UUID
|
||||
-> fix for http://jira.secondlife.com/browse/VWR-20608
|
||||
- fixed : attachments sometimes detach only to instantly get reattached after logon
|
||||
- fixed : Add to/Replace Outfit removes newly worn attachments on completion
|
||||
-> fix for http://jira.secondlife.com/browse/VWR-18512
|
||||
- fixed : LLWearableBridge::removeAllClothesFromAvatar() doesn't remove all clothing from the avatar
|
||||
- fixed : attachments that attach and then instantly detach don't have their COF link removed
|
||||
- fixed : multiple LLWearableHoldingPattern instances lead to "COF corruption"
|
||||
- fixed : get_is_item_worn() shouldn't make the assumption that items in COFs are always worn
|
||||
- fixed : drag-and-drop wear behaviour of an attachment onto self isn't consistant with the drag-and-drop behaviour of wearables
|
||||
-> normal-drop : replace wear
|
||||
-> Ctrl-drop : add wear
|
||||
- fixed : LLAppearanceMgr::registerAttachment() fails to (re)add a link for worn attachments that aren't linked to in COF at log-on
|
||||
- changed : deprecated removeItemFromAvatar() in favour of having LLAppearanceMgr::removeItemFromAvatar() handle it directly/correctly
|
||||
-> wearables can't be worn/removed in 2.X without the viewer already having an LLWearable instance for it anyway
|
||||
- changed : enable "Replace Current Outfit" on the base outfit if it's marked dirty
|
||||
- changed : "RenderUnloadedAvatar" no longer affects the user's own avatar
|
||||
-> side-effect of the fix above due to the change to LLVOAvatar::isFullyLoaded()
|
||||
- added : InitialWearablesLoadedSignal signal which is emitted *once* when the initial wearables are loaded
|
||||
- added : LegacyMultiAttachmentSupport debug setting to route "secondary attachment points" to the primary attachment point
|
||||
-> maps secondary attachment point range [39,68] onto [1,30]
|
||||
-> only dislays "secondary attachment points" correctly for *other* avatars (by design)
|
||||
|
|
@ -4438,6 +4438,17 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>LegacyMultiAttachmentSupport</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Converts legacy "secondary attachment points" to multi-attachments for other avatars</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>LimitDragDistance</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@
|
|||
LLAgentWearables gAgentWearables;
|
||||
|
||||
BOOL LLAgentWearables::mInitialWearablesUpdateReceived = FALSE;
|
||||
// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.2.0a) | Added: Catznip-2.1.1d
|
||||
bool LLAgentWearables::mInitialWearablesLoaded = false;
|
||||
// [/SL:KB]
|
||||
|
||||
using namespace LLVOAvatarDefines;
|
||||
|
||||
|
|
@ -1448,6 +1451,13 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
|
|||
// Start rendering & update the server
|
||||
mWearablesLoaded = TRUE;
|
||||
checkWearablesLoaded();
|
||||
// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-09-22 (Catznip-2.2.0a) | Modified: Catznip-2.2.0a
|
||||
if (!mInitialWearablesLoaded)
|
||||
{
|
||||
mInitialWearablesLoaded = true;
|
||||
mInitialWearablesLoadedSignal();
|
||||
}
|
||||
// [/SL:KB]
|
||||
notifyLoadingFinished();
|
||||
queryWearableCache();
|
||||
updateServer();
|
||||
|
|
@ -1725,7 +1735,10 @@ void LLAgentWearables::userRemoveAllClothesStep2(BOOL proceed)
|
|||
|
||||
// Combines userRemoveAllAttachments() and userAttachMultipleAttachments() logic to
|
||||
// get attachments into desired state with minimal number of adds/removes.
|
||||
void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array)
|
||||
//void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array)
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array, bool fAttachOnly)
|
||||
// [/SL:KB]
|
||||
{
|
||||
// Possible cases:
|
||||
// already wearing but not in request set -> take off.
|
||||
|
|
@ -1790,7 +1803,13 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
|
|||
// llinfos << "remove " << remove_count << " add " << add_count << llendl;
|
||||
|
||||
// Remove everything in objects_to_remove
|
||||
userRemoveMultipleAttachments(objects_to_remove);
|
||||
// userRemoveMultipleAttachments(objects_to_remove);
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
if (!fAttachOnly)
|
||||
{
|
||||
userRemoveMultipleAttachments(objects_to_remove);
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
// Add everything in items_to_add
|
||||
userAttachMultipleAttachments(items_to_add);
|
||||
|
|
@ -2100,6 +2119,13 @@ boost::signals2::connection LLAgentWearables::addLoadedCallback(loaded_callback_
|
|||
return mLoadedSignal.connect(cb);
|
||||
}
|
||||
|
||||
// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.2.0a) | Added: Catznip-2.1.1d
|
||||
boost::signals2::connection LLAgentWearables::addInitialWearablesLoadedCallback(loaded_callback_t cb)
|
||||
{
|
||||
return mInitialWearablesLoadedSignal.connect(cb);
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
void LLAgentWearables::notifyLoadingStarted()
|
||||
{
|
||||
mCOFChangeInProgress = true;
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@ public:
|
|||
|
||||
BOOL isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const;
|
||||
BOOL areWearablesLoaded() const;
|
||||
// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.2.0a) | Added: Catznip-2.1.1d
|
||||
bool areInitalWearablesLoaded() const { return mInitialWearablesLoaded; }
|
||||
// [/SL:KB]
|
||||
bool isCOFChangeInProgress() const { return mCOFChangeInProgress; }
|
||||
void updateWearablesLoaded();
|
||||
void checkWearablesLoaded() const;
|
||||
|
|
@ -215,7 +218,11 @@ public:
|
|||
|
||||
typedef std::vector<LLViewerObject*> llvo_vec_t;
|
||||
|
||||
static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array);
|
||||
// static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array);
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
// Not the best way to go about this but other attempts changed far too much LL code to be a viable solution
|
||||
static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array, bool fAttachOnly = false);
|
||||
// [/SL:KB]
|
||||
static void userRemoveMultipleAttachments(llvo_vec_t& llvo_array);
|
||||
static void userRemoveAllAttachments();
|
||||
static void userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array);
|
||||
|
|
@ -234,6 +241,9 @@ public:
|
|||
typedef boost::function<void()> loaded_callback_t;
|
||||
typedef boost::signals2::signal<void()> loaded_signal_t;
|
||||
boost::signals2::connection addLoadedCallback(loaded_callback_t cb);
|
||||
// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.2.0a) | Added: Catznip-2.1.1d
|
||||
boost::signals2::connection addInitialWearablesLoadedCallback(loaded_callback_t cb);
|
||||
// [/SL:KB]
|
||||
|
||||
void notifyLoadingStarted();
|
||||
void notifyLoadingFinished();
|
||||
|
|
@ -241,6 +251,9 @@ public:
|
|||
private:
|
||||
loading_started_signal_t mLoadingStartedSignal; // should be called before wearables are changed
|
||||
loaded_signal_t mLoadedSignal; // emitted when all agent wearables get loaded
|
||||
// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.2.0a) | Added: Catznip-2.1.1d
|
||||
loaded_signal_t mInitialWearablesLoadedSignal; // emitted once when the initial wearables are loaded
|
||||
// [/SL:KB]
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Member variables
|
||||
|
|
@ -251,6 +264,9 @@ private:
|
|||
wearableentry_map_t mWearableDatas;
|
||||
|
||||
static BOOL mInitialWearablesUpdateReceived;
|
||||
// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
static bool mInitialWearablesLoaded;
|
||||
// [/SL:KB]
|
||||
BOOL mWearablesLoaded;
|
||||
std::set<LLUUID> mItemsAwaitingWearableUpdate;
|
||||
|
||||
|
|
|
|||
|
|
@ -280,11 +280,15 @@ public:
|
|||
void onWearableAssetFetch(LLWearable *wearable);
|
||||
void onAllComplete();
|
||||
|
||||
// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.2.0a) | Added: Catznip-2.0.0a
|
||||
bool pollStopped();
|
||||
// [/SL:KB]
|
||||
|
||||
typedef std::list<LLFoundData> found_list_t;
|
||||
found_list_t& getFoundList();
|
||||
void eraseTypeToLink(LLWearableType::EType type);
|
||||
void eraseTypeToRecover(LLWearableType::EType type);
|
||||
void setObjItems(const LLInventoryModel::item_array_t& items);
|
||||
// void setObjItems(const LLInventoryModel::item_array_t& items);
|
||||
void setGestItems(const LLInventoryModel::item_array_t& items);
|
||||
bool isMostRecent();
|
||||
void handleLateArrivals();
|
||||
|
|
@ -292,7 +296,7 @@ public:
|
|||
|
||||
private:
|
||||
found_list_t mFoundList;
|
||||
LLInventoryModel::item_array_t mObjItems;
|
||||
// LLInventoryModel::item_array_t mObjItems;
|
||||
LLInventoryModel::item_array_t mGestItems;
|
||||
typedef std::set<S32> type_set_t;
|
||||
type_set_t mTypesToRecover;
|
||||
|
|
@ -358,10 +362,15 @@ void LLWearableHoldingPattern::eraseTypeToRecover(LLWearableType::EType type)
|
|||
mTypesToRecover.erase(type);
|
||||
}
|
||||
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-06-19 (Catznip-2.2.0a) | Added: Catznip-2.1.2a
|
||||
// Fix for http://jira.secondlife.com/browse/VWR-18512
|
||||
/*
|
||||
void LLWearableHoldingPattern::setObjItems(const LLInventoryModel::item_array_t& items)
|
||||
{
|
||||
mObjItems = items;
|
||||
}
|
||||
*/
|
||||
// [/SL:KB]
|
||||
|
||||
void LLWearableHoldingPattern::setGestItems(const LLInventoryModel::item_array_t& items)
|
||||
{
|
||||
|
|
@ -458,12 +467,17 @@ void LLWearableHoldingPattern::onAllComplete()
|
|||
llinfos << "Updating agent wearables with " << mResolved << " wearable items " << llendl;
|
||||
LLAppearanceMgr::instance().updateAgentWearables(this, false);
|
||||
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-2.2.0a) | Added: Catznip-2.1.2a
|
||||
// Fix for http://jira.secondlife.com/browse/VWR-18512
|
||||
/*
|
||||
// Update attachments to match those requested.
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
llinfos << "Updating " << mObjItems.count() << " attachments" << llendl;
|
||||
LLAgentWearables::userUpdateAttachments(mObjItems);
|
||||
}
|
||||
*/
|
||||
// [/SL:KB]
|
||||
|
||||
if (isFetchCompleted() && isMissingCompleted())
|
||||
{
|
||||
|
|
@ -493,6 +507,12 @@ bool LLWearableHoldingPattern::pollFetchCompletion()
|
|||
if (!isMostRecent())
|
||||
{
|
||||
llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
|
||||
|
||||
// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.2.0a) | Added: Catznip-2.0.0a
|
||||
// If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves
|
||||
doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollStopped, this));
|
||||
return true;
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
bool completed = isFetchCompleted();
|
||||
|
|
@ -584,6 +604,11 @@ public:
|
|||
if (!mHolder->isMostRecent())
|
||||
{
|
||||
llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
|
||||
|
||||
// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.2.0a) | Added: Catznip-2.0.0a
|
||||
// If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves
|
||||
return;
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
llinfos << "Recovered item for type " << mType << llendl;
|
||||
|
|
@ -658,11 +683,30 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables()
|
|||
}
|
||||
}
|
||||
|
||||
// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.2.0a) | Added: Catznip-2.0.0a
|
||||
bool LLWearableHoldingPattern::pollStopped()
|
||||
{
|
||||
// We have to keep on polling until we're sure that all callbacks have completed or they'll cause a crash
|
||||
if ( (isFetchCompleted()) && (isMissingCompleted()) )
|
||||
{
|
||||
delete this;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
bool LLWearableHoldingPattern::pollMissingWearables()
|
||||
{
|
||||
if (!isMostRecent())
|
||||
{
|
||||
llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
|
||||
|
||||
// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.2.0a) | Added: Catznip-2.0.0a
|
||||
// If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves
|
||||
doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollStopped, this));
|
||||
return true;
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
bool timed_out = isTimedOut();
|
||||
|
|
@ -1295,7 +1339,10 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id)
|
|||
}
|
||||
|
||||
// Check whether it's the base outfit.
|
||||
if (outfit_cat_id.isNull() || outfit_cat_id == getBaseOutfitUUID())
|
||||
// if (outfit_cat_id.isNull() || outfit_cat_id == getBaseOutfitUUID())
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-21 (Catznip-2.2.0a) | Added: Catznip-2.1.2d
|
||||
if ( (outfit_cat_id.isNull()) || ((outfit_cat_id == getBaseOutfitUUID()) && (!isOutfitDirty())) )
|
||||
// [/SL:KB]
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1360,7 +1407,11 @@ void LLAppearanceMgr::filterWearableItems(
|
|||
S32 size = items_by_type[i].size();
|
||||
if (size <= 0)
|
||||
continue;
|
||||
S32 start_index = llmax(0,size-max_per_type);
|
||||
// S32 start_index = llmax(0,size-max_per_type);
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-05-11 (Catznip-2.2.0a) | Added: Catznip-2.0.0h
|
||||
S32 start_index =
|
||||
llmax(0, size - ((LLAssetType::AT_BODYPART == LLWearableType::getAssetType((LLWearableType::EType)i)) ? 1 : max_per_type));
|
||||
// [/SL:KB[
|
||||
for (S32 j = start_index; j<size; j++)
|
||||
{
|
||||
items.push_back(items_by_type[i][j]);
|
||||
|
|
@ -1692,6 +1743,34 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
|
|||
dumpItemArray(wear_items,"asset_dump: wear_item");
|
||||
dumpItemArray(obj_items,"asset_dump: obj_item");
|
||||
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
// Update attachments to match those requested.
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
// Include attachments which should be in COF but don't have their link created yet
|
||||
uuid_vec_t::iterator itPendingAttachLink = mPendingAttachLinks.begin();
|
||||
while (itPendingAttachLink != mPendingAttachLinks.end())
|
||||
{
|
||||
const LLUUID& idItem = *itPendingAttachLink;
|
||||
if ( (!gAgentAvatarp->isWearingAttachment(idItem)) || (isLinkInCOF(idItem)) )
|
||||
{
|
||||
itPendingAttachLink = mPendingAttachLinks.erase(itPendingAttachLink);
|
||||
continue;
|
||||
}
|
||||
|
||||
LLViewerInventoryItem* pItem = gInventory.getItem(idItem);
|
||||
if (pItem)
|
||||
obj_items.push_back(pItem);
|
||||
|
||||
++itPendingAttachLink;
|
||||
}
|
||||
|
||||
// Don't remove attachments until avatar is fully loaded (should reduce random attaching/detaching/reattaching at log-on)
|
||||
llinfos << "Updating " << obj_items.count() << " attachments" << llendl;
|
||||
LLAgentWearables::userUpdateAttachments(obj_items, !gAgentAvatarp->isFullyLoaded());
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
if(!wear_items.count())
|
||||
{
|
||||
LLNotificationsUtil::add("CouldNotPutOnOutfit");
|
||||
|
|
@ -1704,7 +1783,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
|
|||
|
||||
LLWearableHoldingPattern* holder = new LLWearableHoldingPattern;
|
||||
|
||||
holder->setObjItems(obj_items);
|
||||
// holder->setObjItems(obj_items);
|
||||
holder->setGestItems(gest_items);
|
||||
|
||||
// Note: can't do normal iteration, because if all the
|
||||
|
|
@ -2508,11 +2587,27 @@ void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove)
|
|||
switch (item_to_remove->getType())
|
||||
{
|
||||
case LLAssetType::AT_CLOTHING:
|
||||
if (get_is_item_worn(id_to_remove))
|
||||
// if (get_is_item_worn(id_to_remove))
|
||||
// {
|
||||
// //*TODO move here the exact removing code from LLWearableBridge::removeItemFromAvatar in the future
|
||||
// LLWearableBridge::removeItemFromAvatar(item_to_remove);
|
||||
// }
|
||||
// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.2.0a) | Added: Catznip-2.1.1d
|
||||
{
|
||||
//*TODO move here the exact removing code from LLWearableBridge::removeItemFromAvatar in the future
|
||||
LLWearableBridge::removeItemFromAvatar(item_to_remove);
|
||||
/*const*/ LLWearable* pWearable = gAgentWearables.getWearableFromItemID(item_to_remove->getLinkedUUID());
|
||||
if ( (pWearable) && (LLAssetType::AT_BODYPART != pWearable->getAssetType()) )
|
||||
{
|
||||
U32 idxWearable = gAgentWearables.getWearableIndex(pWearable);
|
||||
if (idxWearable < LLAgentWearables::MAX_CLOTHING_PER_TYPE)
|
||||
{
|
||||
gAgentWearables.removeWearable(pWearable->getType(), false, idxWearable);
|
||||
|
||||
LLAppearanceMgr::instance().removeCOFItemLinks(item_to_remove->getLinkedUUID(), false);
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
}
|
||||
}
|
||||
// [/SL:KB]
|
||||
break;
|
||||
case LLAssetType::AT_OBJECT:
|
||||
LLVOAvatarSelf::detachAttachmentIntoInventory(item_to_remove->getLinkedUUID());
|
||||
|
|
@ -2657,6 +2752,12 @@ void LLAppearanceMgr::setAttachmentInvLinkEnable(bool val)
|
|||
{
|
||||
llinfos << "setAttachmentInvLinkEnable => " << (int) val << llendl;
|
||||
mAttachmentInvLinkEnabled = val;
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
if (mAttachmentInvLinkEnabled)
|
||||
{
|
||||
linkPendingAttachments();
|
||||
}
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg)
|
||||
|
|
@ -2679,13 +2780,24 @@ void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg)
|
|||
void LLAppearanceMgr::registerAttachment(const LLUUID& item_id)
|
||||
{
|
||||
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
if (isLinkInCOF(item_id))
|
||||
{
|
||||
return;
|
||||
}
|
||||
mPendingAttachLinks.push_back(item_id);
|
||||
// [/SL:KB]
|
||||
|
||||
if (mAttachmentInvLinkEnabled)
|
||||
{
|
||||
// we have to pass do_update = true to call LLAppearanceMgr::updateAppearanceFromCOF.
|
||||
// it will trigger gAgentWariables.notifyLoadingFinished()
|
||||
// But it is not acceptable solution. See EXT-7777
|
||||
LLAppearanceMgr::addCOFItemLink(item_id, false); // Add COF link for item.
|
||||
// LLAppearanceMgr::addCOFItemLink(item_id, false); // Add COF link for item.
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.2.0a) | Modified: Catznip-2.2.0a
|
||||
LLPointer<LLInventoryCallback> cb = new LLRegisterAttachmentCallback();
|
||||
LLAppearanceMgr::addCOFItemLink(item_id, false, cb); // Add COF link for item.
|
||||
// [/SL:KB]
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2696,6 +2808,13 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id)
|
|||
void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id)
|
||||
{
|
||||
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
uuid_vec_t::iterator itPendingAttachLink = std::find(mPendingAttachLinks.begin(), mPendingAttachLinks.end(), item_id);
|
||||
if (itPendingAttachLink != mPendingAttachLinks.end())
|
||||
{
|
||||
mPendingAttachLinks.erase(itPendingAttachLink);
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
if (mAttachmentInvLinkEnabled)
|
||||
{
|
||||
|
|
@ -2707,6 +2826,38 @@ void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id)
|
|||
}
|
||||
}
|
||||
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.2.0a) | Modified: Catznip-2.2.0a
|
||||
void LLAppearanceMgr::linkPendingAttachments()
|
||||
{
|
||||
LLPointer<LLInventoryCallback> cb = NULL;
|
||||
for (uuid_vec_t::const_iterator itPendingAttachLink = mPendingAttachLinks.begin();
|
||||
itPendingAttachLink != mPendingAttachLinks.end(); ++itPendingAttachLink)
|
||||
{
|
||||
const LLUUID& idAttachItem = *itPendingAttachLink;
|
||||
if ( (gAgentAvatarp->isWearingAttachment(idAttachItem)) && (!isLinkInCOF(idAttachItem)) )
|
||||
{
|
||||
if (!cb)
|
||||
cb = new LLRegisterAttachmentCallback();
|
||||
LLAppearanceMgr::addCOFItemLink(idAttachItem, false, cb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLAppearanceMgr::onRegisterAttachmentComplete(const LLUUID& idItem)
|
||||
{
|
||||
const LLUUID& idItemBase = gInventory.getLinkedItemID(idItem);
|
||||
|
||||
// Remove the attachment from the pending list
|
||||
uuid_vec_t::iterator itPendingAttachLink = std::find(mPendingAttachLinks.begin(), mPendingAttachLinks.end(), idItemBase);
|
||||
if (itPendingAttachLink != mPendingAttachLinks.end())
|
||||
mPendingAttachLinks.erase(itPendingAttachLink);
|
||||
|
||||
// It may have been detached already in which case we should remove the COF link
|
||||
if ( (isAgentAvatarValid()) && (!gAgentAvatarp->isWearingAttachment(idItemBase)) )
|
||||
removeCOFItemLinks(idItemBase, false);
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
BOOL LLAppearanceMgr::getIsInCOF(const LLUUID& obj_id) const
|
||||
{
|
||||
return gInventory.isObjectDescendentOf(obj_id, getCOF());
|
||||
|
|
|
|||
|
|
@ -217,6 +217,14 @@ private:
|
|||
|
||||
std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
|
||||
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.2.0a) | Modified: Catznip-2.1.2e
|
||||
public:
|
||||
void linkPendingAttachments();
|
||||
void onRegisterAttachmentComplete(const LLUUID& idItem);
|
||||
private:
|
||||
uuid_vec_t mPendingAttachLinks;
|
||||
// [/SL:KB]
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// Item-specific convenience functions
|
||||
public:
|
||||
|
|
@ -243,6 +251,19 @@ private:
|
|||
bool mUpdateBaseOrder;
|
||||
};
|
||||
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-2.2.0a) | Added: Catznip-2.1.2a
|
||||
class LLRegisterAttachmentCallback : public LLInventoryCallback
|
||||
{
|
||||
public:
|
||||
LLRegisterAttachmentCallback() {}
|
||||
/*virtual*/ ~LLRegisterAttachmentCallback() {}
|
||||
|
||||
/*virtual*/ void fire(const LLUUID& idItem)
|
||||
{
|
||||
LLAppearanceMgr::instance().onRegisterAttachmentComplete(idItem);
|
||||
}
|
||||
};
|
||||
// [/SL:KB]
|
||||
|
||||
#define SUPPORT_ENSEMBLES 0
|
||||
|
||||
|
|
|
|||
|
|
@ -4379,11 +4379,16 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_
|
|||
continue;
|
||||
if (get_is_item_worn(item->getUUID()))
|
||||
{
|
||||
/*
|
||||
LLWearableList::instance().getAsset(item->getAssetUUID(),
|
||||
item->getName(),
|
||||
item->getType(),
|
||||
LLWearableBridge::onRemoveFromAvatarArrived,
|
||||
new OnRemoveStruct(item->getLinkedUUID()));
|
||||
*/
|
||||
// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.2.0a) | Added: Catznip-2.1.1d
|
||||
LLAppearanceMgr::instance().removeItemFromAvatar(item->getUUID());
|
||||
// [/SL:KB]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4614,6 +4619,7 @@ void LLWearableBridge::wearAddOnAvatar()
|
|||
}
|
||||
|
||||
// static
|
||||
/*
|
||||
void LLWearableBridge::onWearOnAvatarArrived( LLWearable* wearable, void* userdata )
|
||||
{
|
||||
LLUUID* item_id = (LLUUID*) userdata;
|
||||
|
|
@ -4637,9 +4643,11 @@ void LLWearableBridge::onWearOnAvatarArrived( LLWearable* wearable, void* userda
|
|||
}
|
||||
delete item_id;
|
||||
}
|
||||
*/
|
||||
|
||||
// static
|
||||
// BAP remove the "add" code path once everything is fully COF-ified.
|
||||
/*
|
||||
void LLWearableBridge::onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata )
|
||||
{
|
||||
LLUUID* item_id = (LLUUID*) userdata;
|
||||
|
|
@ -4664,6 +4672,7 @@ void LLWearableBridge::onWearAddOnAvatarArrived( LLWearable* wearable, void* use
|
|||
}
|
||||
delete item_id;
|
||||
}
|
||||
*/
|
||||
|
||||
// static
|
||||
BOOL LLWearableBridge::canEditOnAvatar(void* user_data)
|
||||
|
|
@ -4701,6 +4710,7 @@ BOOL LLWearableBridge::canRemoveFromAvatar(void* user_data)
|
|||
}
|
||||
|
||||
// static
|
||||
/*
|
||||
void LLWearableBridge::onRemoveFromAvatar(void* user_data)
|
||||
{
|
||||
LLWearableBridge* self = (LLWearableBridge*)user_data;
|
||||
|
|
@ -4719,8 +4729,10 @@ void LLWearableBridge::onRemoveFromAvatar(void* user_data)
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// static
|
||||
/*
|
||||
void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable,
|
||||
void* userdata)
|
||||
{
|
||||
|
|
@ -4748,6 +4760,7 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable,
|
|||
|
||||
delete on_remove_struct;
|
||||
}
|
||||
*/
|
||||
|
||||
// static
|
||||
void LLWearableBridge::removeAllClothesFromAvatar()
|
||||
|
|
@ -4758,7 +4771,10 @@ void LLWearableBridge::removeAllClothesFromAvatar()
|
|||
if (itype == LLWearableType::WT_SHAPE || itype == LLWearableType::WT_SKIN || itype == LLWearableType::WT_HAIR || itype == LLWearableType::WT_EYES)
|
||||
continue;
|
||||
|
||||
for (S32 index = gAgentWearables.getWearableCount(itype)-1; index >= 0 ; --index)
|
||||
// for (S32 index = gAgentWearables.getWearableCount(itype)-1; index >= 0 ; --index)
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a
|
||||
for (S32 index = gAgentWearables.getWearableCount((LLWearableType::EType)itype)-1; index >= 0 ; --index)
|
||||
// [/SL:KB]
|
||||
{
|
||||
LLViewerInventoryItem *item = dynamic_cast<LLViewerInventoryItem*>(
|
||||
gAgentWearables.getWearableInventoryItem((LLWearableType::EType)itype, index));
|
||||
|
|
@ -4784,11 +4800,16 @@ void LLWearableBridge::removeItemFromAvatar(LLViewerInventoryItem *item)
|
|||
{
|
||||
if (item)
|
||||
{
|
||||
/*
|
||||
LLWearableList::instance().getAsset(item->getAssetUUID(),
|
||||
item->getName(),
|
||||
item->getType(),
|
||||
LLWearableBridge::onRemoveFromAvatarArrived,
|
||||
new OnRemoveStruct(item->getUUID()));
|
||||
*/
|
||||
// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.2.0a) | Added: Catznip-2.1.1d
|
||||
LLAppearanceMgr::instance().removeItemFromAvatar(item->getUUID());
|
||||
// [/SL:KB]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -472,10 +472,10 @@ public:
|
|||
|
||||
static void onWearOnAvatar( void* userdata ); // Access to wearOnAvatar() from menu
|
||||
static BOOL canWearOnAvatar( void* userdata );
|
||||
static void onWearOnAvatarArrived( LLWearable* wearable, void* userdata );
|
||||
// static void onWearOnAvatarArrived( LLWearable* wearable, void* userdata );
|
||||
void wearOnAvatar();
|
||||
|
||||
static void onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata );
|
||||
// static void onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata );
|
||||
void wearAddOnAvatar();
|
||||
|
||||
static BOOL canEditOnAvatar( void* userdata ); // Access to editOnAvatar() from menu
|
||||
|
|
@ -483,8 +483,8 @@ public:
|
|||
void editOnAvatar();
|
||||
|
||||
static BOOL canRemoveFromAvatar( void* userdata );
|
||||
static void onRemoveFromAvatar( void* userdata );
|
||||
static void onRemoveFromAvatarArrived( LLWearable* wearable, void* userdata );
|
||||
// static void onRemoveFromAvatar( void* userdata );
|
||||
// static void onRemoveFromAvatarArrived( LLWearable* wearable, void* userdata );
|
||||
static void removeItemFromAvatar(LLViewerInventoryItem *item);
|
||||
static void removeAllClothesFromAvatar();
|
||||
void removeFromAvatar();
|
||||
|
|
|
|||
|
|
@ -217,10 +217,11 @@ BOOL get_is_item_worn(const LLUUID& id)
|
|||
return FALSE;
|
||||
|
||||
// Consider the item as worn if it has links in COF.
|
||||
if (LLAppearanceMgr::instance().isLinkInCOF(id))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// [SL:KB] - The code below causes problems across the board so it really just needs to go
|
||||
// if (LLAppearanceMgr::instance().isLinkInCOF(id))
|
||||
// {
|
||||
// return TRUE;
|
||||
// }
|
||||
|
||||
switch(item->getType())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1623,7 +1623,11 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(
|
|||
{
|
||||
if (mSource == SOURCE_LIBRARY)
|
||||
{
|
||||
LLPointer<LLInventoryCallback> cb = new RezAttachmentCallback(0);
|
||||
// LLPointer<LLInventoryCallback> cb = new RezAttachmentCallback(0);
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
// Make this behave consistent with dad3dWearItem
|
||||
LLPointer<LLInventoryCallback> cb = new RezAttachmentCallback(0, !(mask & MASK_CONTROL));
|
||||
// [/SL:KB]
|
||||
copy_inventory_item(
|
||||
gAgent.getID(),
|
||||
item->getPermissions().getOwner(),
|
||||
|
|
@ -1634,7 +1638,11 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(
|
|||
}
|
||||
else
|
||||
{
|
||||
rez_attachment(item, 0);
|
||||
// rez_attachment(item, 0);
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
// Make this behave consistent with dad3dWearItem
|
||||
rez_attachment(item, 0, !(mask & MASK_CONTROL));
|
||||
// [/SL:KB]
|
||||
}
|
||||
}
|
||||
return ACCEPT_YES_SINGLE;
|
||||
|
|
|
|||
|
|
@ -941,9 +941,13 @@ void ModifiedCOFCallback::fire(const LLUUID& inv_item)
|
|||
}
|
||||
}
|
||||
|
||||
RezAttachmentCallback::RezAttachmentCallback(LLViewerJointAttachment *attachmentp)
|
||||
//RezAttachmentCallback::RezAttachmentCallback(LLViewerJointAttachment *attachmentp)
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
RezAttachmentCallback::RezAttachmentCallback(LLViewerJointAttachment *attachmentp, bool replace)
|
||||
: mAttach(attachmentp), mReplace(replace)
|
||||
// [/SL:KB]
|
||||
{
|
||||
mAttach = attachmentp;
|
||||
// mAttach = attachmentp;
|
||||
}
|
||||
RezAttachmentCallback::~RezAttachmentCallback()
|
||||
{
|
||||
|
|
@ -957,7 +961,10 @@ void RezAttachmentCallback::fire(const LLUUID& inv_item)
|
|||
LLViewerInventoryItem *item = gInventory.getItem(inv_item);
|
||||
if (item)
|
||||
{
|
||||
rez_attachment(item, mAttach);
|
||||
// rez_attachment(item, mAttach);
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
rez_attachment(item, mAttach, mReplace);
|
||||
// [/SL:KB]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -262,7 +262,10 @@ class LLViewerJointAttachment;
|
|||
class RezAttachmentCallback : public LLInventoryCallback
|
||||
{
|
||||
public:
|
||||
RezAttachmentCallback(LLViewerJointAttachment *attachmentp);
|
||||
// RezAttachmentCallback(LLViewerJointAttachment *attachmentp);
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
RezAttachmentCallback(LLViewerJointAttachment *attachmentp, bool replace = false);
|
||||
// [/SL:KB]
|
||||
void fire(const LLUUID& inv_item);
|
||||
|
||||
protected:
|
||||
|
|
@ -270,6 +273,9 @@ protected:
|
|||
|
||||
private:
|
||||
LLViewerJointAttachment* mAttach;
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
bool mReplace;
|
||||
// [/SL:KB]
|
||||
};
|
||||
|
||||
class ActivateGestureCallback : public LLInventoryCallback
|
||||
|
|
|
|||
|
|
@ -5576,7 +5576,13 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
|
|||
if (!attachment)
|
||||
{
|
||||
llwarns << "Object attachment point invalid: " << attachmentID << llendl;
|
||||
attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
|
||||
// attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
|
||||
// [SL:KB] - Patch: Appearance-LegacyMultiAttachment | Checked: 2010-08-28 (Catznip-2.2.0a) | Added: Catznip2.1.2a
|
||||
S32 idxAttachPt = 1;
|
||||
if ( (!isSelf()) && (gSavedSettings.getBOOL("LegacyMultiAttachmentSupport")) && (attachmentID > 38) && (attachmentID <= 68) )
|
||||
idxAttachPt = attachmentID - 38;
|
||||
attachment = get_if_there(mAttachmentPoints, idxAttachPt, (LLViewerJointAttachment*)NULL);
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
return attachment;
|
||||
|
|
@ -6029,10 +6035,17 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
|
|||
|
||||
BOOL LLVOAvatar::isFullyLoaded() const
|
||||
{
|
||||
if (gSavedSettings.getBOOL("RenderUnloadedAvatar"))
|
||||
// if (gSavedSettings.getBOOL("RenderUnloadedAvatar"))
|
||||
// return TRUE;
|
||||
// else
|
||||
// return mFullyLoaded;
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
|
||||
// Changes to LLAppearanceMgr::updateAppearanceFromCOF() expect this function to actually return mFullyLoaded for gAgentAvatarp
|
||||
if ( (!isSelf()) && (gSavedSettings.getBOOL("RenderUnloadedAvatar")) )
|
||||
return TRUE;
|
||||
else
|
||||
return mFullyLoaded;
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -95,8 +95,18 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID
|
|||
{
|
||||
BOOL isNewWearable = FALSE;
|
||||
LLWearableArrivedData* data = (LLWearableArrivedData*) userdata;
|
||||
LLWearable* wearable = NULL; // NULL indicates failure
|
||||
|
||||
// LLWearable* wearable = NULL; // NULL indicates failure
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-08-13 (Catznip-2.2.0a) | Added: Catznip-2.1.1d
|
||||
LLWearable* wearable = get_if_there(LLWearableList::instance().mList, uuid, (LLWearable*)NULL);
|
||||
if (wearable)
|
||||
{
|
||||
if(data->mCallback)
|
||||
data->mCallback(wearable, data->mUserdata);
|
||||
delete data;
|
||||
return;
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
if( !filename )
|
||||
{
|
||||
LL_WARNS("Wearable") << "Bad Wearable Asset: missing file." << LL_ENDL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue