From 5a39e173b06698fd9e07d524e7044a41e86bdfbb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 28 Jun 2010 17:26:19 -0400 Subject: EXT-8063 WIP - last-ditch filtering of item counts in updateAppearanceFromCOF --- indra/newview/llappearancemgr.cpp | 71 ++++++++++++++++++++++++++++++++++++--- indra/newview/llappearancemgr.h | 1 + 2 files changed, 68 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index ce022ac840..8a3b4cb028 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1537,16 +1537,79 @@ bool sort_by_description(const LLInventoryItem* item1, const LLInventoryItem* it return item1->LLInventoryItem::getDescription() < item2->LLInventoryItem::getDescription(); } -void LLAppearanceMgr::updateAppearanceFromCOF() +void item_array_diff(LLInventoryModel::item_array_t& full_list, + LLInventoryModel::item_array_t& keep_list, + LLInventoryModel::item_array_t& kill_list) + { - //checking integrity of the COF in terms of ordering of wearables, - //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) - updateClothingOrderingInfo(); + for (LLInventoryModel::item_array_t::iterator it = full_list.begin(); + it != full_list.end(); + ++it) + { + LLViewerInventoryItem *item = *it; + if (keep_list.find(item) < 0) // Why on earth does LLDynamicArray need to redefine find()? + { + kill_list.push_back(item); + } + } +} +void LLAppearanceMgr::enforceItemCountLimits() +{ + S32 purge_count = 0; + + LLInventoryModel::item_array_t body_items; + getDescendentsOfAssetType(getCOF(), body_items, LLAssetType::AT_BODYPART, false); + LLInventoryModel::item_array_t curr_body_items = body_items; + removeDuplicateItems(body_items); + filterWearableItems(body_items, 1); + LLInventoryModel::item_array_t kill_body_items; + item_array_diff(curr_body_items,body_items,kill_body_items); + for (LLInventoryModel::item_array_t::iterator it = kill_body_items.begin(); + it != kill_body_items.end(); + ++it) + { + LLViewerInventoryItem *item = *it; + llinfos << "purging dup body part " << item->getName() << llendl; + gInventory.purgeObject(item->getUUID()); + purge_count++; + } + + LLInventoryModel::item_array_t wear_items; + getDescendentsOfAssetType(getCOF(), wear_items, LLAssetType::AT_CLOTHING, false); + LLInventoryModel::item_array_t curr_wear_items = wear_items; + removeDuplicateItems(wear_items); + filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE); + LLInventoryModel::item_array_t kill_wear_items; + item_array_diff(curr_wear_items,wear_items,kill_wear_items); + for (LLInventoryModel::item_array_t::iterator it = kill_wear_items.begin(); + it != kill_wear_items.end(); + ++it) + { + LLViewerInventoryItem *item = *it; + llinfos << "purging excess clothing item " << item->getName() << llendl; + gInventory.purgeObject(item->getUUID()); + purge_count++; + } + + if (purge_count>0) + { + gInventory.notifyObservers(); + } +} + +void LLAppearanceMgr::updateAppearanceFromCOF() +{ // update dirty flag to see if the state of the COF matches // the saved outfit stored as a folder link llinfos << "starting" << llendl; + //checking integrity of the COF in terms of ordering of wearables, + //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) + updateClothingOrderingInfo(); + + enforceItemCountLimits(); + updateIsDirty(); dumpCat(getCOF(),"COF, start"); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 61779d5c0e..15383381f8 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -66,6 +66,7 @@ public: void renameOutfit(const LLUUID& outfit_id); void takeOffOutfit(const LLUUID& cat_id); void addCategoryToCurrentOutfit(const LLUUID& cat_id); + void enforceItemCountLimits(); // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, -- cgit v1.2.3 From 2b80cc679d898d38e59a639c92cb427aee240a3e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 29 Jun 2010 08:32:49 -0400 Subject: Message wording --- indra/newview/skins/default/xui/en/panel_outfits_list.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_outfits_list.xml b/indra/newview/skins/default/xui/en/panel_outfits_list.xml index d0c44c4328..d33b16e0a3 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_list.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_list.xml @@ -15,7 +15,7 @@ bg_alpha_color="DkGray2" bg_opaque_color="DkGray2" no_matched_tabs_text.value="Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]." - no_visible_tabs_text.value="There are no any outfits. Try [secondlife:///app/search/all/ Search]." + no_visible_tabs_text.value="You don't have any outfits yet. Try [secondlife:///app/search/all/ Search]." follows="all" height="400" layout="topleft" -- cgit v1.2.3 From b81adf898cbe770e1579da5b1618330aac27c671 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 29 Jun 2010 11:59:40 -0400 Subject: EXT-8063 FIX, EXT-7986 FIX - enforce wearable counts in updateApperanceFromCOF() if UI lets any improper state through --- indra/newview/llappearancemgr.cpp | 33 ++++++++++++++++++++++++++++++--- indra/newview/llappearancemgr.h | 1 + 2 files changed, 31 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 8a3b4cb028..ddbec25c04 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1598,18 +1598,44 @@ void LLAppearanceMgr::enforceItemCountLimits() } } +class BoolSetter +{ +public: + BoolSetter(bool& var): + mVar(var) + { + mVar = true; + } + ~BoolSetter() + { + mVar = false; + } +private: + bool& mVar; +}; + void LLAppearanceMgr::updateAppearanceFromCOF() { - // update dirty flag to see if the state of the COF matches - // the saved outfit stored as a folder link + if (mIsInUpdateAppearanceFromCOF) + { + llwarns << "Called updateAppearanceFromCOF inside updateAppearanceFromCOF, skipping" << llendl; + return; + } + + BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); + llinfos << "starting" << llendl; //checking integrity of the COF in terms of ordering of wearables, //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) updateClothingOrderingInfo(); + // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but + // this should catch anything that gets through. enforceItemCountLimits(); + // update dirty flag to see if the state of the COF matches + // the saved outfit stored as a folder link updateIsDirty(); dumpCat(getCOF(),"COF, start"); @@ -2556,7 +2582,8 @@ void LLAppearanceMgr::dumpItemArray(const LLInventoryModel::item_array_t& items, LLAppearanceMgr::LLAppearanceMgr(): mAttachmentInvLinkEnabled(false), - mOutfitIsDirty(false) + mOutfitIsDirty(false), + mIsInUpdateAppearanceFromCOF(false) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 15383381f8..afd1bf3ade 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -204,6 +204,7 @@ private: std::set mRegisteredAttachments; bool mAttachmentInvLinkEnabled; bool mOutfitIsDirty; + bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls. /** * Lock for blocking operations on outfit until server reply or timeout exceed -- cgit v1.2.3 From 17d2a3b9fb24ea56eb5e70007a2502bbef436a65 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 29 Jun 2010 15:56:00 -0400 Subject: EXT-8048 FIX - message wording --- indra/newview/skins/default/xui/en/panel_outfits_list.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_outfits_list.xml b/indra/newview/skins/default/xui/en/panel_outfits_list.xml index d33b16e0a3..82a5c68240 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_list.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_list.xml @@ -15,7 +15,7 @@ bg_alpha_color="DkGray2" bg_opaque_color="DkGray2" no_matched_tabs_text.value="Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]." - no_visible_tabs_text.value="You don't have any outfits yet. Try [secondlife:///app/search/all/ Search]." + no_visible_tabs_text.value="..." follows="all" height="400" layout="topleft" -- cgit v1.2.3 From fc732b34b28fc556f0a3a37c7f0d353dd6e1b424 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Wed, 30 Jun 2010 14:46:58 +0300 Subject: EXT-7737 FIXED Resolved minor problems in appearance UI. Fixed issues from bug except accordion header color changing and changing T-Shirt icon to newer one which are to follow later. Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/660/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_outfits_inventory.xml | 2 +- indra/newview/skins/default/xui/en/sidepanel_appearance.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml index 58d3dbcc37..23592d2fc1 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml @@ -18,7 +18,7 @@ layout="topleft" left="5" name="appearance_tabs" - tab_min_width="140" + tab_min_width="150" tab_height="30" tab_position="top" halign="center" diff --git a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml index 9a07d3a48a..10d8c7dbb8 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml @@ -61,7 +61,7 @@ width="333"> top="0" width="32" />