From 9bc4e69c913225aa57b6f2009dd1f7cb65afddbc Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Fri, 25 Jun 2010 17:00:45 +0300 Subject: EXT-7972 FIXED (My Outfits: Add \"Add to current outfit\" menu item into gear menu) - Added menu item 'Wear - Add to Current Outfit' (menu_outfit_gear.xml). - Added menu item handler onAdd(). Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/657/ --HG-- branch : product-engine --- indra/newview/lloutfitslist.cpp | 23 ++++++++++++++++++++++ .../skins/default/xui/en/menu_outfit_gear.xml | 10 ++++++++++ 2 files changed, 33 insertions(+) diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 6c2566813f..075cfa0543 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -88,6 +88,8 @@ public: registrar.add("Gear.Delete", boost::bind(&LLOutfitListGearMenu::onDelete, this)); registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2)); + registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenu::onAdd, this)); + enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitsList::isActionEnabled, mOutfitList, _2)); enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenu::onVisible, this, _2)); @@ -146,6 +148,16 @@ private: } } + void onAdd() + { + const LLUUID& selected_id = getSelectedOutfitID(); + + if (selected_id.notNull()) + { + LLAppearanceMgr::getInstance()->addCategoryToCurrentOutfit(selected_id); + } + } + void onTakeOff() { // Take off selected items if there are any @@ -648,6 +660,17 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata) && LLAppearanceMgr::getInstance()->getBaseOutfitUUID() == mSelectedOutfitUUID ) || hasWornItemSelected(); } + + if (command_name == "wear_add") + { + if (gAgentWearables.isCOFChangeInProgress()) + { + return false; + } + + return LLAppearanceMgr::getCanAddToCOF(mSelectedOutfitUUID); + } + return false; } diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml index 8e7ef7f0b5..c4c7a5034a 100644 --- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml @@ -15,6 +15,16 @@ function="Gear.OnVisible" parameter="wear" /> + + + +