diff options
author | Paul Guslisty <pguslisty@productengine.com> | 2010-05-28 20:10:10 +0300 |
---|---|---|
committer | Paul Guslisty <pguslisty@productengine.com> | 2010-05-28 20:10:10 +0300 |
commit | d42fd6cf7fa3ac4d7e2ef35cef50eb7740b4ec6d (patch) | |
tree | a54e8cced5b6920c4c8e21184ab8a2496fb851b7 /indra/newview/llcofwearables.cpp | |
parent | d2cc5dd0f5d1b83dd7e995a0c7ed2d4a85c9be94 (diff) |
EXT-7472 FIXED Open add to outfit panel by (+) button click on unwearable items and by selecting 'Replace' menu item click body part context menu
Main changes:
- Added callback for a '(+) button' to the LLCOFCallbacks and bind it with LLPanelOutfitEdit::onAddWearableClicked
- Created the callback(LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked) for 'Replace' menu item of context menu
Related changes:
- Changed LLFilteredWearableListManager so that it can use different functors (subclasses of LLInventoryCollectFunctor) as a criterion for LLInventoryItemsList filtering. Before it used only LLFindNonLinksByMask filter. Moved LLFindNonLinksByMask from to the llfilteredwearablelist.cpp to the llinventoryfunctions.h
- Created getter 'LLPanelDummyClothingListItem::getWearableType()' for LLPanelDummyClothingListItem
- Made 'add wearables panel' a member of LLPanelOutfitEdit so that not to use findChild each time panel is needed
Reviewed by Igor Borovkov at http://jira.secondlife.com/browse/EXT-7472
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llcofwearables.cpp')
-rw-r--r-- | indra/newview/llcofwearables.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index dfc203111a..6e7a7fe937 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -43,6 +43,8 @@ #include "llmenugl.h" #include "llviewermenu.h" #include "llwearableitemslist.h" +#include "llpaneloutfitedit.h" +#include "llsidetray.h" static LLRegisterPanelClassWrapper<LLCOFAccordionListAdaptor> t_cof_accodion_list_adaptor("accordion_list_adaptor"); @@ -135,8 +137,10 @@ protected: LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; LLUUID selected_id = mUUIDs.back(); - registrar.add("BodyPart.Replace", boost::bind(&LLAppearanceMgr::wearItemOnAvatar, - LLAppearanceMgr::getInstance(), selected_id, true, true)); + // *HACK* need to pass pointer to LLPanelOutfitEdit instead of LLSideTray::getInstance()->getPanel(). + // LLSideTray::getInstance()->getPanel() is rather slow variant + LLPanelOutfitEdit* panel_oe = dynamic_cast<LLPanelOutfitEdit*>(LLSideTray::getInstance()->getPanel("panel_outfit_edit")); + registrar.add("BodyPart.Replace", boost::bind(&LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked, panel_oe, selected_id)); registrar.add("BodyPart.Edit", boost::bind(LLAgentWearables::editWearable, selected_id)); enable_registrar.add("BodyPart.OnEnable", boost::bind(&CofBodyPartContextMenu::onEnable, this, _2)); @@ -416,6 +420,7 @@ void LLCOFWearables::addClothingTypesDummies(const LLAppearanceMgr::wearables_by LLWearableType::EType w_type = static_cast<LLWearableType::EType>(type); LLPanelInventoryListItemBase* item_panel = LLPanelDummyClothingListItem::create(w_type); if(!item_panel) continue; + item_panel->childSetAction("btn_add", mCOFCallbacks.mAddWearable); mClothing->addItem(item_panel, LLUUID::null, ADD_BOTTOM, false); } } @@ -435,6 +440,13 @@ bool LLCOFWearables::getSelectedUUIDs(uuid_vec_t& selected_ids) return selected_ids.size() != 0; } +LLPanel* LLCOFWearables::getSelectedItem() +{ + if (!mLastSelectedList) return NULL; + + return mLastSelectedList->getSelectedItem(); +} + void LLCOFWearables::clear() { mAttachments->clear(); |