summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dyukov <adyukov@productengine.com>2010-06-24 18:00:09 +0300
committerAndrew Dyukov <adyukov@productengine.com>2010-06-24 18:00:09 +0300
commita209e339ee96095e884e4de51ea5c88e51825d62 (patch)
tree80f1cc0542605d89db6e90caca9d67bc96dbecaa
parentcb801fafb2cce28d2eecd87f011bc50eae686f1b (diff)
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
-rw-r--r--indra/newview/lloutfitslist.cpp20
-rw-r--r--indra/newview/lloutfitslist.h3
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp9
3 files changed, 31 insertions, 1 deletions
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<LLWearableItemsList*>(ctrl);
diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h
index f86a415200..26722f2a96 100644
--- a/indra/newview/lloutfitslist.h
+++ b/indra/newview/lloutfitslist.h
@@ -107,6 +107,9 @@ public:
boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb);
+ // Collects selected items from all selected lists and wears them(if possible- adds, else replaces)
+ void wearSelectedItems();
+
/**
* Returns true if there is a selection inside currently selected outfit
*/
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 2f1cad8a75..076e6485a8 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -169,7 +169,14 @@ void LLPanelOutfitsInventory::onSearchEdit(const std::string& string)
void LLPanelOutfitsInventory::onWearButtonClick()
{
- mMyOutfitsPanel->performAction("replaceoutfit");
+ if (mMyOutfitsPanel->hasItemSelected())
+ {
+ mMyOutfitsPanel->wearSelectedItems();
+ }
+ else
+ {
+ mMyOutfitsPanel->performAction("replaceoutfit");
+ }
}
bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD& response)