From 4b00b988445ae562b2bc203479d7fd42ce5891d8 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 3 Aug 2010 23:28:51 +0300 Subject: EXT-8534 FIXED Fixed the 'Wear' in My Outfits being disabled for outfits consisting of body parts only. Changed the condition to enable the "Wear" button in My Outfits and the corresponding item in the outfit context menu. They now get enabled for any outfit that isn't the base outfit and contains non-worn wearables. By the way, did a minor cleanup: moved an LLAgentWearables.isCOFChangeInProgress() call to LLAppearanceMgr::getCanAddToCOF() to avoid code duplication. Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/832/ --HG-- branch : product-engine --- indra/newview/llappearancemgr.cpp | 31 +++++++++++++++++++++++++++++++ indra/newview/llappearancemgr.h | 3 +++ indra/newview/lloutfitslist.cpp | 10 ++-------- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 78edcb3e25..2729053390 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1275,6 +1275,11 @@ bool LLAppearanceMgr::getCanRemoveFromCOF(const LLUUID& outfit_cat_id) // static bool LLAppearanceMgr::getCanAddToCOF(const LLUUID& outfit_cat_id) { + if (gAgentWearables.isCOFChangeInProgress()) + { + return false; + } + LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false); @@ -1286,6 +1291,32 @@ bool LLAppearanceMgr::getCanAddToCOF(const LLUUID& outfit_cat_id) return items.size() > 0; } +bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) +{ + // Don't allow wearing anything while we're changing appearance. + if (gAgentWearables.isCOFChangeInProgress()) + { + return false; + } + + // Check whether it's the base outfit. + if (outfit_cat_id.isNull() || outfit_cat_id == getBaseOutfitUUID()) + { + return false; + } + + // Check whether the outfit contains any non-worn wearables. + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ true); + gInventory.collectDescendentsIf(outfit_cat_id, + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + not_worn); + return items.size() > 0; +} + void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category) { LLInventoryModel::cat_array_t cats; diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 9f554dbdef..eb495bd274 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -84,6 +84,9 @@ public: // Determine whether we can add anything (but body parts) from the outfit contents to COF. static bool getCanAddToCOF(const LLUUID& outfit_cat_id); + // Determine whether we can replace current outfit with the given one. + bool getCanReplaceCOF(const LLUUID& outfit_cat_id); + // Copy all items in a category. void shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id, LLPointer cb); diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 8147a97317..f921bca623 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -275,11 +275,10 @@ protected: } else if ("wear_replace" == param) { - return !gAgentWearables.isCOFChangeInProgress(); + return LLAppearanceMgr::instance().getCanReplaceCOF(outfit_cat_id); } else if ("wear_add" == param) { - if (gAgentWearables.isCOFChangeInProgress()) return false; return LLAppearanceMgr::getCanAddToCOF(outfit_cat_id); } else if ("take_off" == param) @@ -676,7 +675,7 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata) } // outfit selected - return LLAppearanceMgr::getCanAddToCOF(mSelectedOutfitUUID); + return LLAppearanceMgr::instance().getCanReplaceCOF(mSelectedOutfitUUID); } if (command_name == "take_off") { @@ -689,11 +688,6 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata) if (command_name == "wear_add") { // *TODO: do we ever get here? - if (gAgentWearables.isCOFChangeInProgress()) - { - return false; - } - return LLAppearanceMgr::getCanAddToCOF(mSelectedOutfitUUID); } -- cgit v1.2.3 From 4b2f46af401ff82bd397db3721826b12fab9162d Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Tue, 3 Aug 2010 14:59:14 -0700 Subject: CT-575 WIP DE JA ES translation for set16 for Viewer 2.1.1 --- .../default/xui/de/floater_preview_gesture.xml | 7 +- .../skins/default/xui/de/floater_world_map.xml | 11 ++- indra/newview/skins/default/xui/de/menu_viewer.xml | 2 +- .../newview/skins/default/xui/de/notifications.xml | 7 +- .../skins/default/xui/de/panel_group_notices.xml | 2 +- .../skins/default/xui/de/panel_group_roles.xml | 3 + .../default/xui/de/panel_preferences_sound.xml | 10 ++- .../default/xui/de/panel_teleport_history.xml | 2 + .../skins/default/xui/de/sidepanel_item_info.xml | 9 +-- indra/newview/skins/default/xui/de/strings.xml | 89 +++++++++++++++++++++- .../default/xui/es/floater_preview_gesture.xml | 7 +- .../skins/default/xui/es/floater_world_map.xml | 11 ++- indra/newview/skins/default/xui/es/menu_viewer.xml | 2 +- .../newview/skins/default/xui/es/notifications.xml | 7 +- .../skins/default/xui/es/panel_group_notices.xml | 2 +- .../skins/default/xui/es/panel_group_roles.xml | 18 ++--- .../skins/default/xui/es/panel_nearby_media.xml | 6 +- .../default/xui/es/panel_preferences_sound.xml | 12 ++- .../default/xui/es/panel_teleport_history.xml | 3 +- .../skins/default/xui/es/sidepanel_item_info.xml | 17 ++--- indra/newview/skins/default/xui/es/strings.xml | 89 +++++++++++++++++++++- .../default/xui/ja/floater_preview_gesture.xml | 7 +- .../skins/default/xui/ja/floater_world_map.xml | 9 ++- indra/newview/skins/default/xui/ja/menu_viewer.xml | 2 +- .../newview/skins/default/xui/ja/notifications.xml | 7 +- .../skins/default/xui/ja/panel_group_notices.xml | 2 +- .../skins/default/xui/ja/panel_group_roles.xml | 3 + .../default/xui/ja/panel_preferences_sound.xml | 6 ++ .../default/xui/ja/panel_teleport_history.xml | 2 + .../skins/default/xui/ja/sidepanel_item_info.xml | 11 ++- indra/newview/skins/default/xui/ja/strings.xml | 89 +++++++++++++++++++++- 31 files changed, 378 insertions(+), 76 deletions(-) diff --git a/indra/newview/skins/default/xui/de/floater_preview_gesture.xml b/indra/newview/skins/default/xui/de/floater_preview_gesture.xml index 3a036fc441..c3c017ae97 100644 --- a/indra/newview/skins/default/xui/de/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/de/floater_preview_gesture.xml @@ -42,7 +42,12 @@ Bibliothek: - + + + + + +