summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 44832ac496..4178fd9c90 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -210,7 +210,8 @@ LLPanelOutfitEdit::LLPanelOutfitEdit()
mCOFWearables(NULL),
mInventoryItemsPanel(NULL),
mCOFObserver(NULL),
- mCOFDragAndDropObserver(NULL)
+ mCOFDragAndDropObserver(NULL),
+ mInitialized(false)
{
mSavedFolderState = new LLSaveFolderState();
mSavedFolderState->setApply(FALSE);
@@ -307,6 +308,16 @@ BOOL LLPanelOutfitEdit::postBuild()
return TRUE;
}
+// virtual
+void LLPanelOutfitEdit::onOpen(const LLSD& key)
+{
+ if (!mInitialized)
+ {
+ displayCurrentOutfit();
+ mInitialized = true;
+ }
+}
+
void LLPanelOutfitEdit::moveWearable(bool closer_to_body)
{
LLUUID item_id = mCOFWearables->getSelectedUUID();
@@ -446,13 +457,25 @@ void LLPanelOutfitEdit::onSearchEdit(const std::string& string)
void LLPanelOutfitEdit::onAddToOutfitClicked(void)
{
- LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem();
- if (!curr_item) return;
+ LLUUID selected_id;
+ if (mInventoryItemsPanel->getVisible())
+ {
+ LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem();
+ if (!curr_item) return;
+
+ LLFolderViewEventListener* listenerp = curr_item->getListener();
+ if (!listenerp) return;
+
+ selected_id = listenerp->getUUID();
+ }
+ else if (mWearableItemsPanel->getVisible())
+ {
+ selected_id = mWearableItemsList->getSelectedUUID();
+ }
- LLFolderViewEventListener* listenerp = curr_item->getListener();
- if (!listenerp) return;
+ if (selected_id.isNull()) return;
- LLAppearanceMgr::getInstance()->wearItemOnAvatar(listenerp->getUUID());
+ LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id);
}