summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelappearance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llsidepanelappearance.cpp')
-rw-r--r--indra/newview/llsidepanelappearance.cpp73
1 files changed, 39 insertions, 34 deletions
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index cd4a821774..511196809a 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -34,6 +34,7 @@
#include "llaccordionctrltab.h"
#include "llagent.h"
+#include "llagentcamera.h"
#include "llagentwearables.h"
#include "llappearancemgr.h"
#include "llinventorypanel.h"
@@ -92,7 +93,7 @@ LLSidepanelAppearance::LLSidepanelAppearance() :
LLPanel(),
mFilterSubString(LLStringUtil::null),
mFilterEditor(NULL),
- mLookInfo(NULL),
+ mOutfitEdit(NULL),
mCurrOutfitPanel(NULL)
{
}
@@ -128,10 +129,10 @@ BOOL LLSidepanelAppearance::postBuild()
mPanelOutfitsInventory = dynamic_cast<LLPanelOutfitsInventory *>(getChild<LLPanel>("panel_outfits_inventory"));
mPanelOutfitsInventory->setParent(this);
- mLookInfo = dynamic_cast<LLPanelLookInfo*>(getChild<LLPanel>("panel_look_info"));
- if (mLookInfo)
+ mOutfitEdit = dynamic_cast<LLPanelOutfitEdit*>(getChild<LLPanel>("panel_outfit_edit"));
+ if (mOutfitEdit)
{
- LLButton* back_btn = mLookInfo->getChild<LLButton>("back_btn");
+ LLButton* back_btn = mOutfitEdit->getChild<LLButton>("back_btn");
if (back_btn)
{
back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onBackButtonClicked, this));
@@ -176,7 +177,7 @@ void LLSidepanelAppearance::onOpen(const LLSD& key)
if(key.size() == 0)
return;
- toggleLookInfoPanel(TRUE);
+ toggleOutfitEditPanel(TRUE);
updateVerbs();
mLookInfoType = key["type"].asString();
@@ -185,7 +186,7 @@ void LLSidepanelAppearance::onOpen(const LLSD& key)
{
LLInventoryCategory *pLook = gInventory.getCategory(key["id"].asUUID());
if (pLook)
- mLookInfo->displayLookInfo(pLook);
+ mOutfitEdit->displayLookInfo(pLook);
}
}
@@ -205,7 +206,7 @@ void LLSidepanelAppearance::onFilterEdit(const std::string& search_string)
void LLSidepanelAppearance::onOpenOutfitButtonClicked()
{
- const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getBaseOutfitLink();
+ const LLViewerInventoryItem *outfit_link = LLAppearanceMgr::getInstance()->getBaseOutfitLink();
if (!outfit_link)
return;
if (!outfit_link->getIsLinkType())
@@ -218,13 +219,13 @@ void LLSidepanelAppearance::onOpenOutfitButtonClicked()
LLInventoryPanel *inventory_panel = tab_outfits->findChild<LLInventoryPanel>("outfitslist_tab");
if (inventory_panel)
{
- LLFolderView *folder = inventory_panel->getRootFolder();
- LLFolderViewItem *outfit_folder = folder->getItemByID(outfit_link->getLinkedUUID());
+ LLFolderView* root = inventory_panel->getRootFolder();
+ LLFolderViewItem *outfit_folder = root->getItemByID(outfit_link->getLinkedUUID());
if (outfit_folder)
{
outfit_folder->setOpen(!outfit_folder->isOpen());
- folder->setSelectionFromRoot(outfit_folder,TRUE);
- folder->scrollToShowSelection();
+ root->setSelectionFromRoot(outfit_folder,TRUE);
+ root->scrollToShowSelection();
}
}
}
@@ -234,15 +235,15 @@ void LLSidepanelAppearance::onEditAppearanceButtonClicked()
{
if (gAgentWearables.areWearablesLoaded())
{
- gAgent.changeCameraToCustomizeAvatar();
+ gAgentCamera.changeCameraToCustomizeAvatar();
}
}
void LLSidepanelAppearance::onEditButtonClicked()
{
- toggleLookInfoPanel(FALSE);
+ toggleOutfitEditPanel(FALSE);
toggleWearableEditPanel(TRUE, NULL);
- /*if (mLookInfo->getVisible())
+ /*if (mOutfitEdit->getVisible())
{
}
else
@@ -253,7 +254,7 @@ void LLSidepanelAppearance::onEditButtonClicked()
void LLSidepanelAppearance::onNewOutfitButtonClicked()
{
- if (!mLookInfo->getVisible())
+ if (!mOutfitEdit->getVisible())
{
mPanelOutfitsInventory->onSave();
}
@@ -262,22 +263,22 @@ void LLSidepanelAppearance::onNewOutfitButtonClicked()
void LLSidepanelAppearance::onBackButtonClicked()
{
- toggleLookInfoPanel(FALSE);
+ toggleOutfitEditPanel(FALSE);
}
void LLSidepanelAppearance::onEditWearBackClicked()
{
mEditWearable->saveChanges();
toggleWearableEditPanel(FALSE, NULL);
- toggleLookInfoPanel(TRUE);
+ toggleOutfitEditPanel(TRUE);
}
-void LLSidepanelAppearance::toggleLookInfoPanel(BOOL visible)
+void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible)
{
- if (!mLookInfo)
+ if (!mOutfitEdit)
return;
- mLookInfo->setVisible(visible);
+ mOutfitEdit->setVisible(visible);
if (mPanelOutfitsInventory) mPanelOutfitsInventory->setVisible(!visible);
mFilterEditor->setVisible(!visible);
mEditBtn->setVisible(!visible);
@@ -296,14 +297,17 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we
return;
}
+ mCurrOutfitPanel->setVisible(!visible);
+
mEditWearable->setVisible(visible);
+ mEditWearable->setWearable(wearable);
mFilterEditor->setVisible(!visible);
mPanelOutfitsInventory->setVisible(!visible);
}
void LLSidepanelAppearance::updateVerbs()
{
- bool is_look_info_visible = mLookInfo->getVisible();
+ bool is_look_info_visible = mOutfitEdit->getVisible();
if (mPanelOutfitsInventory && !is_look_info_visible)
{
@@ -318,11 +322,11 @@ void LLSidepanelAppearance::updateVerbs()
void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name)
{
- mOutfitDirtyTag->setVisible(LLAppearanceManager::getInstance()->isOutfitDirty());
+ mOutfitDirtyTag->setVisible(LLAppearanceMgr::getInstance()->isOutfitDirty());
if (name == "")
{
std::string outfit_name;
- if (LLAppearanceManager::getInstance()->getBaseOutfitName(outfit_name))
+ if (LLAppearanceMgr::getInstance()->getBaseOutfitName(outfit_name))
{
mCurrentLookName->setText(outfit_name);
return;
@@ -342,7 +346,7 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name)
void LLSidepanelAppearance::editWearable(LLWearable *wearable, void *data)
{
LLSidepanelAppearance *panel = (LLSidepanelAppearance*) data;
- panel->toggleLookInfoPanel(FALSE);
+ panel->toggleOutfitEditPanel(FALSE);
panel->toggleWearableEditPanel(TRUE, wearable);
}
@@ -352,23 +356,24 @@ void LLSidepanelAppearance::fetchInventory()
{
mNewOutfitBtn->setEnabled(false);
- LLInventoryFetchObserver::item_ref_t ids;
+ uuid_vec_t ids;
LLUUID item_id;
for(S32 type = (S32)WT_SHAPE; type < (S32)WT_COUNT; ++type)
{
- // MULTI_WEARABLE:
- item_id = gAgentWearables.getWearableItemID((EWearableType)type,0);
- if(item_id.notNull())
+ for (U32 index = 0; index < gAgentWearables.getWearableCount((EWearableType)type); ++index)
{
- ids.push_back(item_id);
+ item_id = gAgentWearables.getWearableItemID((EWearableType)type, index);
+ if(item_id.notNull())
+ {
+ ids.push_back(item_id);
+ }
}
}
- LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
- if( avatar )
+ if (isAgentAvatarValid())
{
- for (LLVOAvatar::attachment_map_t::const_iterator iter = avatar->mAttachmentPoints.begin();
- iter != avatar->mAttachmentPoints.end(); ++iter)
+ for (LLVOAvatar::attachment_map_t::const_iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
+ iter != gAgentAvatarp->mAttachmentPoints.end(); ++iter)
{
LLViewerJointAttachment* attachment = iter->second;
if (!attachment) continue;
@@ -386,7 +391,7 @@ void LLSidepanelAppearance::fetchInventory()
}
LLCurrentlyWornFetchObserver *fetch_worn = new LLCurrentlyWornFetchObserver(this);
- fetch_worn->fetchItems(ids);
+ fetch_worn->fetch(ids);
// If no items to be fetched, done will never be triggered.
// TODO: Change LLInventoryFetchObserver::fetchItems to trigger done() on this condition.
if (fetch_worn->isEverythingComplete())