summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-26 10:25:35 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-26 10:25:35 +0100
commita0467365140c504eb0f5ad053ac22a2698a2abd7 (patch)
treea152b229228a5923bfb293948d7dfca8f9a4bc8c /indra/newview/llpaneloutfitedit.cpp
parent1993732a6ca6a27f5e433e108b614eed5153cd1f (diff)
parentd0204a2b149462371ee20725067e43b018c485bb (diff)
merge from PE's viewer-trunk
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp37
1 files changed, 33 insertions, 4 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index e139cb31d6..ae181e2819 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -73,6 +73,9 @@ const U64 WEARABLE_MASK = (1LL << LLInventoryType::IT_WEARABLE);
const U64 ATTACHMENT_MASK = (1LL << LLInventoryType::IT_ATTACHMENT) | (1LL << LLInventoryType::IT_OBJECT);
const U64 ALL_ITEMS_MASK = WEARABLE_MASK | ATTACHMENT_MASK;
+static const std::string SAVE_BTN("save_btn");
+static const std::string REVERT_BTN("revert_btn");
+
class LLInventoryLookObserver : public LLInventoryObserver
{
public:
@@ -221,10 +224,9 @@ BOOL LLPanelOutfitEdit::postBuild()
mEditWearableBtn->setVisible(FALSE);
mEditWearableBtn->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onEditWearableClicked, this));
- childSetAction("revert_btn", boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance()));
+ childSetAction(REVERT_BTN, boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance()));
- childSetAction("save_btn", boost::bind(&LLPanelOutfitEdit::saveOutfit, this, false));
- childSetAction("save_as_btn", boost::bind(&LLPanelOutfitEdit::saveOutfit, this, true));
+ childSetAction(SAVE_BTN, boost::bind(&LLPanelOutfitEdit::saveOutfit, this, false));
childSetAction("save_flyout_btn", boost::bind(&LLPanelOutfitEdit::showSaveMenu, this));
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar;
@@ -234,10 +236,22 @@ BOOL LLPanelOutfitEdit::postBuild()
mWearableListManager = new LLFilteredWearableListManager(
getChild<LLInventoryItemsList>("filtered_wearables_list"), ALL_ITEMS_MASK);
+
+ childSetAction("move_closer_btn", boost::bind(&LLPanelOutfitEdit::moveWearable, this, true));
+ childSetAction("move_further_btn", boost::bind(&LLPanelOutfitEdit::moveWearable, this, false));
return TRUE;
}
+void LLPanelOutfitEdit::moveWearable(bool closer_to_body)
+{
+ LLViewerInventoryItem* wearable_to_move = gInventory.getItem(mLookContents->getSelectionInterface()->getCurrentID());
+ LLAppearanceMgr::getInstance()->moveWearable(wearable_to_move, closer_to_body);
+
+ //*TODO why not to listen to inventory?
+ updateLookInfo();
+}
+
void LLPanelOutfitEdit::showAddWearablesPanel()
{
childSetVisible("add_wearables_panel", childGetValue("add_btn"));
@@ -267,6 +281,8 @@ void LLPanelOutfitEdit::saveOutfit(bool as_new)
{
panel_outfits_inventory->onSave();
}
+
+ //*TODO how to get to know when base outfit is updated or new outfit is created?
}
void LLPanelOutfitEdit::showSaveMenu()
@@ -542,10 +558,12 @@ void LLPanelOutfitEdit::lookFetched(void)
columns[0]["value"] = item->getName();
columns[1]["column"] = "look_item_sort";
columns[1]["type"] = "text"; // TODO: multi-wearable sort "type" should go here.
- columns[1]["value"] = "BAR"; // TODO: Multi-wearable sort index should go here
+ columns[1]["value"] = item->LLInventoryItem::getDescription();
mLookContents->addElement(row);
}
+
+ updateVerbs();
}
void LLPanelOutfitEdit::updateLookInfo()
@@ -589,4 +607,15 @@ void LLPanelOutfitEdit::displayCurrentOutfit()
updateLookInfo();
}
+//private
+void LLPanelOutfitEdit::updateVerbs()
+{
+ bool outfit_is_dirty = LLAppearanceMgr::getInstance()->isOutfitDirty();
+
+ childSetEnabled(SAVE_BTN, outfit_is_dirty);
+ childSetEnabled(REVERT_BTN, outfit_is_dirty);
+
+ mSaveMenu->setItemEnabled("save_outfit", outfit_is_dirty);
+}
+
// EOF