1. simon_linden
  2. viewer-rabbit

Commits

Andrew Polunin  committed 8c2a515

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/

  • Participants
  • Parent commits 9a01435
  • Branches product-engine

Comments (0)

Files changed (2)

File indra/newview/lloutfitslist.cpp

View file
 		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));
 
 		}
 	}
 
+	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
 				 && LLAppearanceMgr::getInstance()->getBaseOutfitUUID() == mSelectedOutfitUUID )
 				|| hasWornItemSelected();
 	}
+
+	if (command_name == "wear_add")
+	{
+		if (gAgentWearables.isCOFChangeInProgress())
+		{
+			return false;
+		}
+
+		return LLAppearanceMgr::getCanAddToCOF(mSelectedOutfitUUID);
+	}
+
 	return false;
 }
 

File indra/newview/skins/default/xui/en/menu_outfit_gear.xml

View file
          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">