diff options
author | Christian Goetze (CG) <cg@lindenlab.com> | 2010-09-16 12:03:36 -0700 |
---|---|---|
committer | Christian Goetze (CG) <cg@lindenlab.com> | 2010-09-16 12:03:36 -0700 |
commit | f78547cb4265f324adbe224fd4b17097089c0855 (patch) | |
tree | bf2f188a5ac0bd308f45a9fbd46c80c8cd3f9115 /indra/newview/lloutfitslist.cpp | |
parent | 79ea7b43743b8b9ec768ebb3f3212a147bb9f846 (diff) | |
parent | 395a5cbafff00aa90e0cd71891f9741c501e9824 (diff) |
Merging work to make lenny build
Diffstat (limited to 'indra/newview/lloutfitslist.cpp')
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index cf0b3d94bd..c0f7fa4abf 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -85,7 +85,7 @@ public: registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenu::onAdd, this)); - enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitsList::isActionEnabled, mOutfitList, _2)); + enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenu::onEnable, this, _2)); enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenu::onVisible, this, _2)); mMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>( @@ -155,27 +155,11 @@ private: void onTakeOff() { - // Take off selected items if there are any - if (mOutfitList->hasItemSelected()) - { - uuid_vec_t selected_uuids; - mOutfitList->getSelectedItemsUUIDs(selected_uuids); - - for (uuid_vec_t::const_iterator it=selected_uuids.begin(); it != selected_uuids.end(); ++it) - { - if (get_is_item_worn(*it)) - { - LLAppearanceMgr::instance().removeItemFromAvatar(*it); - } - } - } - else // or take off the whole selected outfit if no items specified. + // Take off selected outfit. + const LLUUID& selected_outfit_id = getSelectedOutfitID(); + if (selected_outfit_id.notNull()) { - const LLUUID& selected_outfit_id = getSelectedOutfitID(); - if (selected_outfit_id.notNull()) - { - LLAppearanceMgr::instance().takeOffOutfit(selected_outfit_id); - } + LLAppearanceMgr::instance().takeOffOutfit(selected_outfit_id); } } @@ -209,6 +193,20 @@ private: LLAgentWearables::createWearable(type, true); } + bool onEnable(LLSD::String param) + { + // Handle the "Wear - Replace Current Outfit" menu option specially + // because LLOutfitList::isActionEnabled() checks whether it's allowed + // to wear selected outfit OR selected items, while we're only + // interested in the outfit (STORM-183). + if ("wear" == param) + { + return LLAppearanceMgr::instance().getCanReplaceCOF(mOutfitList->getSelectedOutfitUUID()); + } + + return mOutfitList->isActionEnabled(param); + } + bool onVisible(LLSD::String param) { const LLUUID& selected_outfit_id = getSelectedOutfitID(); |