diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 20 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.h | 3 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.cpp | 9 |
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) |