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, 37 insertions, 36 deletions
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index 9a37af4916..a084c93786 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -93,7 +93,7 @@ LLSidepanelAppearance::LLSidepanelAppearance() :
LLPanel(),
mFilterSubString(LLStringUtil::null),
mFilterEditor(NULL),
- mLookInfo(NULL),
+ mOutfitEdit(NULL),
mCurrOutfitPanel(NULL)
{
}
@@ -129,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));
@@ -177,16 +177,14 @@ void LLSidepanelAppearance::onOpen(const LLSD& key)
if(key.size() == 0)
return;
- toggleLookInfoPanel(TRUE);
+ toggleOutfitEditPanel(TRUE);
updateVerbs();
mLookInfoType = key["type"].asString();
- if (mLookInfoType == "look")
+ if (mLookInfoType == "edit_outfit")
{
- LLInventoryCategory *pLook = gInventory.getCategory(key["id"].asUUID());
- if (pLook)
- mLookInfo->displayLookInfo(pLook);
+ mOutfitEdit->displayCurrentOutfit();
}
}
@@ -206,7 +204,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())
@@ -219,13 +217,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();
}
}
}
@@ -241,9 +239,9 @@ void LLSidepanelAppearance::onEditAppearanceButtonClicked()
void LLSidepanelAppearance::onEditButtonClicked()
{
- toggleLookInfoPanel(FALSE);
+ toggleOutfitEditPanel(FALSE);
toggleWearableEditPanel(TRUE, NULL);
- /*if (mLookInfo->getVisible())
+ /*if (mOutfitEdit->getVisible())
{
}
else
@@ -254,7 +252,7 @@ void LLSidepanelAppearance::onEditButtonClicked()
void LLSidepanelAppearance::onNewOutfitButtonClicked()
{
- if (!mLookInfo->getVisible())
+ if (!mOutfitEdit->getVisible())
{
mPanelOutfitsInventory->onSave();
}
@@ -263,22 +261,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,6 +295,8 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we
return;
}
+ mCurrOutfitPanel->setVisible(!visible);
+
mEditWearable->setVisible(visible);
mEditWearable->setWearable(wearable);
mFilterEditor->setVisible(!visible);
@@ -305,7 +305,7 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we
void LLSidepanelAppearance::updateVerbs()
{
- bool is_look_info_visible = mLookInfo->getVisible();
+ bool is_look_info_visible = mOutfitEdit->getVisible();
if (mPanelOutfitsInventory && !is_look_info_visible)
{
@@ -320,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;
@@ -344,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);
}
@@ -354,23 +354,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* avatarp = gAgent.getAvatarObject();
- if(avatarp)
+ if (isAgentAvatarValid())
{
- for (LLVOAvatar::attachment_map_t::const_iterator iter = avatarp->mAttachmentPoints.begin();
- iter != avatarp->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;
@@ -388,7 +389,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())