diff options
author | Andrew Polunin <apolunin@productengine.com> | 2010-06-25 17:00:45 +0300 |
---|---|---|
committer | Andrew Polunin <apolunin@productengine.com> | 2010-06-25 17:00:45 +0300 |
commit | 9bc4e69c913225aa57b6f2009dd1f7cb65afddbc (patch) | |
tree | dc225c41640c18e871bfe721b66492ee503920d4 | |
parent | 66ce337a321ce274520e3c18a1c0af3ad5bd2475 (diff) |
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
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 23 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_outfit_gear.xml | 10 |
2 files changed, 33 insertions, 0 deletions
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 @@ -16,6 +16,16 @@ parameter="wear" /> </menu_item_call> <menu_item_call + label="Wear - Add to Current Outfit" + layout="topleft" + name="wear_add"> + <on_click + function="Gear.WearAdd" /> + <on_enable + function="Gear.OnEnable" + parameter="wear_add" /> + </menu_item_call> + <menu_item_call label="Take Off - Remove from Current Outfit" layout="topleft" name="take_off"> |