From a209e339ee96095e884e4de51ea5c88e51825d62 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Thu, 24 Jun 2010 18:00:09 +0300 Subject: EXT-7793 FIXED Implemented wearing separate wearables instead of whole outfit when individual items are selected in list. - Added wearSelectedItems() method to LLOutfitsList which wears all items selected in outfit lists (if possible- adds, else replaces). It is called when clicking wear if there is selection of individual items(LLOutfitsList::hasItemSelected() returns true). Otherwise whole outfit is worn. Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/638 --HG-- branch : product-engine --- indra/newview/lloutfitslist.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/newview/lloutfitslist.cpp') diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index ec7fb06c8e..6c2566813f 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -960,6 +960,26 @@ void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const } } +void LLOutfitsList::wearSelectedItems() +{ + uuid_vec_t selected_uuids; + getSelectedItemsUUIDs(selected_uuids); + + if(selected_uuids.empty()) + { + return; + } + + uuid_vec_t::const_iterator it; + // Wear items from all selected lists(if possible- add, else replace) + for (it = selected_uuids.begin(); it != selected_uuids.end()-1; ++it) + { + LLAppearanceMgr::getInstance()->wearItemOnAvatar(*it, false, false); + } + // call update only when wearing last item + LLAppearanceMgr::getInstance()->wearItemOnAvatar(*it, true, false); +} + void LLOutfitsList::onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y) { LLWearableItemsList* list = dynamic_cast(ctrl); -- cgit v1.2.3