diff options
| author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-07-05 16:55:05 +0300 |
|---|---|---|
| committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-07-05 16:55:05 +0300 |
| commit | 04a9a19c8361eda9bf6d7d6aa014db4d15dcf715 (patch) | |
| tree | de0cf19126d32f23e05e0c2909a90ce49f34eaf2 /indra/newview/lloutfitslist.cpp | |
| parent | 7c413593f46dedaca23cac17bf761d8246c842f9 (diff) | |
| parent | ef735d839317c5d8837c3ce9afd66cb576a2ba94 (diff) | |
Merge from default branch
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/lloutfitslist.cpp')
| -rw-r--r-- | indra/newview/lloutfitslist.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 23c7e64cce..dddfd9106f 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -657,10 +657,10 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata) } if (command_name == "take_off") { - // Enable "Take Off" only if a worn item or base outfit is selected. - return ( !hasItemSelected() - && LLAppearanceMgr::getInstance()->getBaseOutfitUUID() == mSelectedOutfitUUID ) - || hasWornItemSelected(); + // Enable "Take Off" if any of selected items can be taken off + // or the selected outfit contains items that can be taken off. + return ( hasItemSelected() && canTakeOffSelected() ) + || ( !hasItemSelected() && LLAppearanceMgr::getCanRemoveFromCOF(mSelectedOutfitUUID) ); } if (command_name == "wear_add") @@ -955,14 +955,19 @@ void LLOutfitsList::applyFilterToTab( } } -bool LLOutfitsList::hasWornItemSelected() +bool LLOutfitsList::canTakeOffSelected() { uuid_vec_t selected_uuids; getSelectedItemsUUIDs(selected_uuids); + LLFindWearablesEx is_worn(/*is_worn=*/ true, /*include_body_parts=*/ false); + for (uuid_vec_t::const_iterator it=selected_uuids.begin(); it != selected_uuids.end(); ++it) { - if (get_is_item_worn(*it)) return true; + LLViewerInventoryItem* item = gInventory.getItem(*it); + if (!item) continue; + + if (is_worn(NULL, item)) return true; } return false; } |
