diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-07-27 10:24:53 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-07-27 10:24:53 -0400 |
commit | a3328658725dd12efbb1a9107e4c6f0612772c12 (patch) | |
tree | cc9707083f3cef32a92a481ffbae5b0a7ef92630 /indra/newview/lloutfitslist.cpp | |
parent | 34ab18d0c2f7de57e42ded0c3d94ee0fec17da28 (diff) | |
parent | d55264bf13520fc7adab347565ee13cc30fc8656 (diff) |
automated merge
Diffstat (limited to 'indra/newview/lloutfitslist.cpp')
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 63ffb80ff2..c3eee1d1ad 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -665,7 +665,18 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata) } if (command_name == "wear") { - return !gAgentWearables.isCOFChangeInProgress(); + if (gAgentWearables.isCOFChangeInProgress()) + { + return false; + } + + if (hasItemSelected()) + { + return canWearSelected(); + } + + // outfit selected + return LLAppearanceMgr::getCanAddToCOF(mSelectedOutfitUUID); } if (command_name == "take_off") { @@ -677,6 +688,7 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata) if (command_name == "wear_add") { + // *TODO: do we ever get here? if (gAgentWearables.isCOFChangeInProgress()) { return false; @@ -984,6 +996,31 @@ bool LLOutfitsList::canTakeOffSelected() return false; } +bool LLOutfitsList::canWearSelected() +{ + uuid_vec_t selected_items; + getSelectedItemsUUIDs(selected_items); + + for (uuid_vec_t::const_iterator it = selected_items.begin(); it != selected_items.end(); ++it) + { + const LLUUID& id = *it; + + if (LLAppearanceMgr::isLinkInCOF(id)) + { + return false; + } + + // Check whether the item is worn. + if (!get_can_item_be_worn(id)) + { + return false; + } + } + + // All selected items can be worn. + return true; +} + void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id) { LLAccordionCtrlTab* tab = dynamic_cast<LLAccordionCtrlTab*>(ctrl); |