diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llcofwearables.cpp | 34 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_cof_clothing.xml | 26 |
2 files changed, 23 insertions, 37 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 1fab5c7683..cbebc93306 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -165,6 +165,14 @@ public: } protected: + static void replaceWearable() + { + static LLButton* show_add_wearables_btn = + LLSideTray::getInstance()->getChild<LLButton>("show_add_wearables_btn"); + + show_add_wearables_btn->onCommit(); + } + /*virtual*/ LLContextMenu* createMenu() { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; @@ -173,8 +181,7 @@ protected: functor_t take_off = boost::bind(&LLAppearanceMgr::removeItemFromAvatar, LLAppearanceMgr::getInstance(), _1); registrar.add("Clothing.TakeOff", boost::bind(handleMultiple, take_off, mUUIDs)); - registrar.add("Clothing.MoveUp", boost::bind(moveWearable, selected_id, false)); - registrar.add("Clothing.MoveDown", boost::bind(moveWearable, selected_id, true)); + registrar.add("Clothing.Replace", boost::bind(replaceWearable)); registrar.add("Clothing.Edit", boost::bind(LLAgentWearables::editWearable, selected_id)); registrar.add("Clothing.Create", boost::bind(&CofClothingContextMenu::createNew, this, selected_id)); @@ -194,15 +201,7 @@ protected: std::string param = data.asString(); LLUUID selected_id = mUUIDs.back(); - if ("move_up" == param) - { - return gAgentWearables.canMoveWearable(selected_id, false); - } - else if ("move_down" == param) - { - return gAgentWearables.canMoveWearable(selected_id, true); - } - else if ("take_off" == param) + if ("take_off" == param) { return get_is_item_worn(selected_id); } @@ -210,15 +209,12 @@ protected: { return mUUIDs.size() == 1 && gAgentWearables.isWearableModifiable(selected_id); } - return true; - } + else if ("replace" == param) + { + return get_is_item_worn(selected_id) && mUUIDs.size() == 1; + } - // We don't use LLAppearanceMgr::moveWearable() directly because - // the item may be invalidated between setting the callback and calling it. - static bool moveWearable(const LLUUID& item_id, bool closer_to_body) - { - LLViewerInventoryItem* item = gInventory.getItem(item_id); - return LLAppearanceMgr::instance().moveWearable(item, closer_to_body); + return true; } }; diff --git a/indra/newview/skins/default/xui/en/menu_cof_clothing.xml b/indra/newview/skins/default/xui/en/menu_cof_clothing.xml index 12ee9b045b..206d49e8c7 100644 --- a/indra/newview/skins/default/xui/en/menu_cof_clothing.xml +++ b/indra/newview/skins/default/xui/en/menu_cof_clothing.xml @@ -13,34 +13,24 @@ parameter="take_off" /> </menu_item_call> <menu_item_call - label="Move Up a Layer" - layout="topleft" - name="move_up"> - <on_click - function="Clothing.MoveUp" /> - <on_enable - function="Clothing.OnEnable" - parameter="move_up" /> - </menu_item_call> - <menu_item_call - label="Move Down a Layer" + label="Edit" layout="topleft" - name="move_down"> + name="edit"> <on_click - function="Clothing.MoveDown" /> + function="Clothing.Edit" /> <on_enable function="Clothing.OnEnable" - parameter="move_down" /> + parameter="edit" /> </menu_item_call> <menu_item_call - label="Edit" + label="Replace" layout="topleft" - name="edit"> + name="replace"> <on_click - function="Clothing.Edit" /> + function="Clothing.Replace" /> <on_enable function="Clothing.OnEnable" - parameter="edit" /> + parameter="replace" /> </menu_item_call> <menu_item_call label="Create New" |