Skip to content
Snippets Groups Projects
Commit 55bfba65 authored by Tofu Linden's avatar Tofu Linden
Browse files

merge VWR-22723 Add More category picker defaults whenever a clothing item is removed

parents b0d16895 97891922
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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);
......
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment