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.cpp59
1 files changed, 31 insertions, 28 deletions
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index cd4a821774..b951434010 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())
@@ -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);
@@ -297,13 +298,14 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we
}
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 +320,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 +344,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);
}
@@ -356,19 +358,20 @@ void LLSidepanelAppearance::fetchInventory()
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;