diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-09-01 15:51:16 +0100 | 
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-09-01 15:51:16 +0100 | 
| commit | 55bfba65fc855ed819436785aa3c40d7221f46ec (patch) | |
| tree | 18c7ac64120b0050174865e2c7f9fe69618468c5 /indra | |
| parent | b0d1689516e60de80aca1ef56fdfc4815287a554 (diff) | |
| parent | 978919227545cd96f6e1b7133c6186de80f1ff0a (diff) | |
merge VWR-22723 Add More category picker defaults whenever a clothing item is removed
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llcofwearables.cpp | 21 | ||||
| -rw-r--r-- | indra/newview/llcofwearables.h | 5 | ||||
| -rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 8 | 
3 files changed, 33 insertions, 1 deletions
| diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 194d461f94..b1e11e1a2a 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -708,4 +708,25 @@ void LLCOFWearables::onListRightClick(LLUICtrl* ctrl, S32 x, S32 y, LLListContex  	}  } +void LLCOFWearables::selectClothing(LLWearableType::EType clothing_type) +{ +	std::vector<LLPanel*> clothing_items; + +	mClothing->getItems(clothing_items); + +	std::vector<LLPanel*>::iterator it; + +	for (it = clothing_items.begin(); it != clothing_items.end(); ++it ) +	{ +		LLPanelClothingListItem* clothing_item = dynamic_cast<LLPanelClothingListItem*>(*it); + +		if (clothing_item && clothing_item->getWearableType() == clothing_type) +		{ // clothing item has specified LLWearableType::EType. Select it and exit. + +			mClothing->selectItem(clothing_item); +			break; +		} +	} +} +  //EOF diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index d981fa4196..1f8d6d0c94 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -86,6 +86,11 @@ public:  	LLCOFCallbacks& getCOFCallbacks() { return mCOFCallbacks; } +	/** +	 * Selects first clothing item with specified LLWearableType::EType from clothing list +	 */ +	void selectClothing(LLWearableType::EType clothing_type); +  protected:  	void populateAttachmentsAndBodypartsLists(const LLInventoryModel::item_array_t& cof_items); diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index c9380bf6e6..086583fb2c 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -911,8 +911,14 @@ LLWearableType::EType LLPanelOutfitEdit::getWearableTypeByItemUUID(const LLUUID&  void LLPanelOutfitEdit::onRemoveFromOutfitClicked(void)  {  	LLUUID id_to_remove = mCOFWearables->getSelectedUUID(); -	 +	LLWearableType::EType type = getWearableTypeByItemUUID(id_to_remove); +  	LLAppearanceMgr::getInstance()->removeItemFromAvatar(id_to_remove); + +	if (!mCOFWearables->getSelectedItem()) +	{ +		mCOFWearables->selectClothing(type); +	}  } | 
