Skip to content

Commit

Permalink
Experimental disabling of adding/removing wearables when link-creatio…
Browse files Browse the repository at this point in the history
…n/old-link-deletion is still pending a response from the server.
  • Loading branch information
Shyotl committed Jul 23, 2015
1 parent 22b1222 commit f5fcf38
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions indra/newview/llappearancemgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool enforce_item_restr
mEnforceOrdering(enforce_ordering),
mPostUpdateFunc(post_update_func)
{
sActiveCallbacks++;
selfStartPhase("update_appearance_on_destroy");
}

Expand All @@ -509,6 +510,7 @@ void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item)

LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy()
{
--sActiveCallbacks;
if (!LLApp::isExiting())
{
// speculative fix for MAINT-1150
Expand All @@ -522,6 +524,7 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy()
}
}

U32 LLUpdateAppearanceOnDestroy::sActiveCallbacks = 0;

void edit_wearable_and_customize_avatar(LLUUID item_id)
{
Expand Down
1 change: 1 addition & 0 deletions indra/newview/llappearancemgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ class LLUpdateAppearanceOnDestroy: public LLInventoryCallback
virtual ~LLUpdateAppearanceOnDestroy();
/* virtual */ void fire(const LLUUID& inv_item);

static U32 sActiveCallbacks;
private:
U32 mFireCount;
bool mEnforceItemRestrictions;
Expand Down
15 changes: 8 additions & 7 deletions indra/newview/llinventorybridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5926,6 +5926,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
// Disable wear and take off based on whether the item is worn.
if(item)
{
bool cof_pending = LLUpdateAppearanceOnDestroy::sActiveCallbacks;
switch (item->getType())
{
case LLAssetType::AT_CLOTHING:
Expand All @@ -5934,24 +5935,24 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
case LLAssetType::AT_BODYPART:
items.push_back(std::string("Wearable And Object Wear"));

if (get_is_item_worn(item->getUUID()))
if (!cof_pending && get_is_item_worn(item->getUUID()))
{
disabled_items.push_back(std::string("Wearable And Object Wear"));
disabled_items.push_back(std::string("Wearable Add"));
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0c) | Added: RLVa-1.2.0c
if ( (rlv_handler_t::isEnabled()) && (!gRlvWearableLocks.canRemove(item)) )
if (cof_pending || (rlv_handler_t::isEnabled()) && (!gRlvWearableLocks.canRemove(item)))
disabled_items.push_back(std::string("Take Off"));
// [/RLVa:KB]
}
else
{
disabled_items.push_back(std::string("Take Off"));
disabled_items.push_back(std::string("Wearable Edit"));
if (gAgentWearables.getWearableFromAssetID(item->getAssetUUID()))
if (cof_pending || gAgentWearables.getWearableFromAssetID(item->getAssetUUID()))
{
disabled_items.push_back(std::string("Wearable Add"));
LLViewerWearable* wearable = gAgentWearables.getWearableFromAssetID(item->getAssetUUID());
if ((wearable && wearable != gAgentWearables.getTopWearable(mWearableType)))
if (cof_pending || (wearable && wearable != gAgentWearables.getTopWearable(mWearableType)))
disabled_items.push_back(std::string("Wearable And Object Wear"));
}
// [RLVa:KB] - Checked: 2010-06-09 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g
Expand All @@ -5973,12 +5974,12 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Wearable Move Back"));

bool is_worn = get_is_item_worn(item->getUUID());
if(!is_worn || !gAgentWearables.canMoveWearable(item->getUUID(),false))
if (cof_pending || !is_worn || !gAgentWearables.canMoveWearable(item->getUUID(), false))
disabled_items.push_back(std::string("Wearable Move Forward"));
if(!is_worn || !gAgentWearables.canMoveWearable(item->getUUID(),true))
if (cof_pending || !is_worn || !gAgentWearables.canMoveWearable(item->getUUID(), true))
disabled_items.push_back(std::string("Wearable Move Back"));

if (!gAgentWearables.canAddWearable(mWearableType))
if (cof_pending || !gAgentWearables.canAddWearable(mWearableType))
{
disabled_items.push_back(std::string("Wearable Add"));
}
Expand Down

0 comments on commit f5fcf38

Please sign in to comment.