diff options
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 102 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.h | 11 | ||||
-rw-r--r-- | indra/newview/llsidetray.h | 4 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_attachment_self.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_avatar_self.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 4 |
9 files changed, 55 insertions, 88 deletions
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 660615df5a..ea75c16c56 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -134,11 +134,6 @@ void LLPanelOutfitsInventory::onOpen(const LLSD& key) void LLPanelOutfitsInventory::updateVerbs() { - if (mParent) - { - mParent->updateVerbs(); - } - if (mListCommands) { updateListCommands(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 0086c6aec4..658a7b52e3 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -118,9 +118,6 @@ BOOL LLSidepanelAppearance::postBuild() childSetAction("edit_outfit_btn", boost::bind(&LLSidepanelAppearance::onEditOutfitButtonClicked, this)); - mEditBtn = getChild<LLButton>("edit_btn"); - mEditBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditButtonClicked, this)); - mNewOutfitBtn = getChild<LLButton>("newlook_btn"); mNewOutfitBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onNewOutfitButtonClicked, this)); mNewOutfitBtn->setEnabled(false); @@ -172,24 +169,24 @@ void LLSidepanelAppearance::onOpen(const LLSD& key) { fetchInventory(); refreshCurrentOutfitName(); - updateVerbs(); if (mPanelOutfitsInventory) { mPanelOutfitsInventory->onOpen(key); } - if(key.size() == 0) + if (!key.has("type")) return; - - toggleOutfitEditPanel(TRUE); - updateVerbs(); - - mLookInfoType = key["type"].asString(); - if (mLookInfoType == "edit_outfit") + // Switch to the requested panel. + std::string type = key["type"].asString(); + if (type == "my_outfits") { - mOutfitEdit->displayCurrentOutfit(); + showOutfitsInventoryPanel(); + } + else if (type == "edit_outfit") + { + showOutfitEditPanel(/*update = */ true); } } @@ -233,6 +230,7 @@ void LLSidepanelAppearance::onOpenOutfitButtonClicked() } } +// *TODO: obsolete? void LLSidepanelAppearance::onEditAppearanceButtonClicked() { if (gAgentWearables.areWearablesLoaded()) @@ -248,19 +246,6 @@ void LLSidepanelAppearance::onEditOutfitButtonClicked() LLSideTray::getInstance()->showPanel("sidepanel_appearance", key); } -void LLSidepanelAppearance::onEditButtonClicked() -{ - toggleOutfitEditPanel(FALSE); - toggleWearableEditPanel(TRUE, NULL); - /*if (mOutfitEdit->getVisible()) - { - } - else - { - mPanelOutfitsInventory->onEdit(); - }*/ -} - void LLSidepanelAppearance::onNewOutfitButtonClicked() { if (!mOutfitEdit->getVisible()) @@ -271,33 +256,27 @@ void LLSidepanelAppearance::onNewOutfitButtonClicked() void LLSidepanelAppearance::onEditWearBackClicked() { - mEditWearable->saveChanges(); - toggleWearableEditPanel(FALSE, NULL); - toggleOutfitEditPanel(TRUE); + showOutfitEditPanel(/* update = */ false); } void LLSidepanelAppearance::showOutfitsInventoryPanel() { - mOutfitEdit->setVisible(FALSE); - - mPanelOutfitsInventory->setVisible(TRUE); - - mFilterEditor->setVisible(TRUE); - mEditBtn->setVisible(TRUE); - mNewOutfitBtn->setVisible(TRUE); - mCurrOutfitPanel->setVisible(TRUE); + toggleWearableEditPanel(FALSE); + toggleOutfitEditPanel(FALSE); } -void LLSidepanelAppearance::showOutfitEditPanel() +void LLSidepanelAppearance::showOutfitEditPanel(bool update) { - mOutfitEdit->setVisible(TRUE); - - mPanelOutfitsInventory->setVisible(FALSE); + if (!mOutfitEdit) + return; + + toggleWearableEditPanel(FALSE); + toggleOutfitEditPanel(TRUE); - mFilterEditor->setVisible(FALSE); - mEditBtn->setVisible(FALSE); - mNewOutfitBtn->setVisible(FALSE); - mCurrOutfitPanel->setVisible(FALSE); + if (update) + { + mOutfitEdit->displayCurrentOutfit(); + } } void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible) @@ -305,16 +284,27 @@ void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible) if (!mOutfitEdit) return; + if (mOutfitEdit->getVisible() == visible) + { + // visibility isn't changing, hence nothing to do + return; + } + mOutfitEdit->setVisible(visible); if (mPanelOutfitsInventory) mPanelOutfitsInventory->setVisible(!visible); mFilterEditor->setVisible(!visible); - mEditBtn->setVisible(!visible); mNewOutfitBtn->setVisible(!visible); mCurrOutfitPanel->setVisible(!visible); } void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *wearable) { + if (mEditWearable->getVisible() == visible) + { + // visibility isn't changing, hence nothing to do + return; + } + if (!wearable) { wearable = gAgentWearables.getWearable(LLWearableType::WT_SHAPE, 0); @@ -324,6 +314,13 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we return; } + // Save changes if closing. + if (!visible) + { + mEditWearable->saveChanges(); + } + + // Toggle panel visibility. mCurrOutfitPanel->setVisible(!visible); mEditWearable->setVisible(visible); @@ -332,21 +329,6 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we mPanelOutfitsInventory->setVisible(!visible); } -void LLSidepanelAppearance::updateVerbs() -{ - bool is_look_info_visible = mOutfitEdit->getVisible(); - - if (mPanelOutfitsInventory && !is_look_info_visible) - { -// const bool is_correct_type = (mPanelOutfitsInventory->getCorrectListenerForAction() != NULL); -// mEditBtn->setEnabled(is_correct_type); - } - else - { - mEditBtn->setEnabled(FALSE); - } -} - void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) { // Set current outfit status (wearing/unsaved). diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 2900831099..a919b07ed6 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -60,11 +60,10 @@ public: void fetchInventory(); void inventoryFetched(); - void updateVerbs(); void onNewOutfitButtonClicked(); void showOutfitsInventoryPanel(); - void showOutfitEditPanel(); + void showOutfitEditPanel(bool update); void setWearablesLoading(bool val); private: @@ -73,12 +72,11 @@ private: void onOpenOutfitButtonClicked(); void onEditAppearanceButtonClicked(); void onEditOutfitButtonClicked(); - void onEditButtonClicked(); void onEditWearBackClicked(); //@deprecated use showXXX() methods instead void toggleOutfitEditPanel(BOOL visible); - void toggleWearableEditPanel(BOOL visible, LLWearable* wearable); + void toggleWearableEditPanel(BOOL visible, LLWearable* wearable = NULL); LLFilterEditor* mFilterEditor; LLPanelOutfitsInventory* mPanelOutfitsInventory; @@ -87,7 +85,6 @@ private: LLButton* mOpenOutfitBtn; LLButton* mEditAppearanceBtn; - LLButton* mEditBtn; LLButton* mNewOutfitBtn; LLPanel* mCurrOutfitPanel; @@ -103,10 +100,6 @@ private: // Search string for filtering landmarks and teleport // history locations std::string mFilterSubString; - - // Information type currently shown in Look Information panel - std::string mLookInfoType; - }; #endif //LL_LLSIDEPANELAPPEARANCE_H diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 140a9c818a..e8fdee9430 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -94,7 +94,7 @@ public: * if no such tab - return NULL, otherwise a pointer to the panel * Pass params as array, or they may be overwritten(example - params["name"]="nearby") */ - LLPanel* showPanel (const std::string& panel_name, const LLSD& params); + LLPanel* showPanel (const std::string& panel_name, const LLSD& params = LLSD()); /** * Toggling Side Tray tab which contains "sub_panel" child of "panel_name" panel. @@ -102,7 +102,7 @@ public: * otherwise Side Tray is collapsed. * params are passed to "panel_name" panel onOpen(). */ - void togglePanel (LLPanel* &sub_panel, const std::string& panel_name, const LLSD& params); + void togglePanel (LLPanel* &sub_panel, const std::string& panel_name, const LLSD& params = LLSD()); /* * get the panel (don't show it or do anything else with it) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 42428bab03..c245650d51 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5597,10 +5597,7 @@ void handle_viewer_disable_message_log(void*) void handle_customize_avatar() { - if (gAgentWearables.areWearablesLoaded()) - { - gAgentCamera.changeCameraToCustomizeAvatar(); - } + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "my_outfits")); } void handle_report_abuse() diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml index 5c30b9ee94..dc51ae8b92 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml @@ -68,8 +68,8 @@ function="Self.EnableStandUp" /> </menu_item_call> <menu_item_call - label="My Appearance" - name="Appearance..."> + label="Change Outfit" + name="Change Outfit"> <menu_item_call.on_click function="CustomizeAvatar" /> <menu_item_call.on_enable diff --git a/indra/newview/skins/default/xui/en/menu_avatar_self.xml b/indra/newview/skins/default/xui/en/menu_avatar_self.xml index a21c1ac44b..0efe598243 100644 --- a/indra/newview/skins/default/xui/en/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_self.xml @@ -183,9 +183,9 @@ </menu_item_call> </context_menu> <menu_item_call - label="My Appearance" + label="Change Outfit" layout="topleft" - name="Appearance..."> + name="Chenge Outfit"> <menu_item_call.on_click function="CustomizeAvatar" /> <menu_item_call.on_enable diff --git a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml index 03bd93e271..ea18e02ca1 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml @@ -16,8 +16,8 @@ function="Self.EnableStandUp" /> </menu_item_call> <menu_item_call - label="My Appearance" - name="my_appearance"> + label="Change Outfit" + name="change_outfit"> <menu_item_call.on_click function="CustomizeAvatar" /> <menu_item_call.on_enable diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index c9ebeb60fb..16c2581d63 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -38,8 +38,8 @@ parameter="agent" /> </menu_item_call> <menu_item_call - label="My Appearance" - name="Appearance"> + label="Change Outfit" + name="ChangeOutfit"> <menu_item_call.on_click function="CustomizeAvatar" /> <menu_item_call.on_enable |