From 309fb9e892beb724a442c85bcfd07d6f3f7c9c07 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 29 Mar 2021 23:36:55 +0300 Subject: [PATCH 1/3] SL-15034 Revisions to dedicated Avatar menus --- indra/newview/llpaneloutfitsinventory.cpp | 6 ++ indra/newview/llpaneloutfitsinventory.h | 2 + indra/newview/llsidepanelappearance.cpp | 54 ++++++++++------ indra/newview/llsidepanelappearance.h | 5 +- indra/newview/llviewermenu.cpp | 6 ++ .../default/xui/en/menu_attachment_self.xml | 38 +++++++----- .../skins/default/xui/en/menu_avatar_self.xml | 46 ++++++++------ .../skins/default/xui/en/menu_viewer.xml | 62 +++++++++++-------- .../default/xui/en/panel_outfit_edit.xml | 2 +- 9 files changed, 139 insertions(+), 82 deletions(-) diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index baacdd65b5..531073526b 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -249,6 +249,12 @@ LLPanelOutfitsInventory* LLPanelOutfitsInventory::findInstance() return dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfits_inventory")); } +void LLPanelOutfitsInventory::openApearanceTab(const std::string& tab_name) +{ + if (!mAppearanceTabs) return; + mAppearanceTabs->selectTabByName(tab_name); +} + ////////////////////////////////////////////////////////////////////////////////// // List Commands // diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index e68f04e28d..50d7074d4b 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -59,6 +59,8 @@ public: static LLPanelOutfitsInventory* findInstance(); + void openApearanceTab(const std::string& tab_name); + protected: void updateVerbs(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 48151c17ea..6dfe40c29a 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -164,8 +164,12 @@ void LLSidepanelAppearance::onOpen(const LLSD& key) std::string type = key["type"].asString(); if (type == "my_outfits") { - showOutfitsInventoryPanel(); + showOutfitsInventoryPanel("outfitslist_tab"); } + else if (type == "now_wearing") + { + showOutfitsInventoryPanel("cof_tab"); + } else if (type == "edit_outfit") { showOutfitEditPanel(); @@ -287,7 +291,14 @@ void LLSidepanelAppearance::showOutfitsInventoryPanel() { toggleWearableEditPanel(FALSE); toggleOutfitEditPanel(FALSE); - toggleMyOutfitsPanel(TRUE); + toggleMyOutfitsPanel(TRUE, ""); +} + +void LLSidepanelAppearance::showOutfitsInventoryPanel(const std::string &tab_name) +{ + toggleWearableEditPanel(FALSE); + toggleOutfitEditPanel(FALSE); + toggleMyOutfitsPanel(TRUE, tab_name); } void LLSidepanelAppearance::showOutfitEditPanel() @@ -312,37 +323,42 @@ void LLSidepanelAppearance::showOutfitEditPanel() return; } - toggleMyOutfitsPanel(FALSE); + toggleMyOutfitsPanel(FALSE, ""); toggleWearableEditPanel(FALSE, NULL, TRUE); // don't switch out of edit appearance mode toggleOutfitEditPanel(TRUE); } void LLSidepanelAppearance::showWearableEditPanel(LLViewerWearable *wearable /* = NULL*/, BOOL disable_camera_switch) { - toggleMyOutfitsPanel(FALSE); + toggleMyOutfitsPanel(FALSE, ""); toggleOutfitEditPanel(FALSE, TRUE); // don't switch out of edit appearance mode toggleWearableEditPanel(TRUE, wearable, disable_camera_switch); } -void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible) +void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible, const std::string& tab_name) { - if (!mPanelOutfitsInventory || mPanelOutfitsInventory->getVisible() == visible) - { - // visibility isn't changing, hence nothing to do - return; - } + if (!mPanelOutfitsInventory + || (mPanelOutfitsInventory->getVisible() == visible && tab_name.empty())) + { + // visibility isn't changing, hence nothing to do + return; + } - mPanelOutfitsInventory->setVisible(visible); + mPanelOutfitsInventory->setVisible(visible); - // *TODO: Move these controls to panel_outfits_inventory.xml - // so that we don't need to toggle them explicitly. - mFilterEditor->setVisible(visible); - mCurrOutfitPanel->setVisible(visible); + // *TODO: Move these controls to panel_outfits_inventory.xml + // so that we don't need to toggle them explicitly. + mFilterEditor->setVisible(visible); + mCurrOutfitPanel->setVisible(visible); - if (visible) - { - mPanelOutfitsInventory->onOpen(LLSD()); - } + if (visible) + { + mPanelOutfitsInventory->onOpen(LLSD()); + if (!tab_name.empty()) + { + mPanelOutfitsInventory->openApearanceTab(tab_name); + } + } } void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch) diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 7817fd317c..bb9709a2b8 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -56,7 +56,8 @@ public: void fetchInventory(); void inventoryFetched(); - void showOutfitsInventoryPanel(); + void showOutfitsInventoryPanel(); // last selected + void showOutfitsInventoryPanel(const std::string& tab_name); void showOutfitEditPanel(); void showWearableEditPanel(LLViewerWearable *wearable = NULL, BOOL disable_camera_switch = FALSE); void setWearablesLoading(bool val); @@ -72,7 +73,7 @@ private: void onOpenOutfitButtonClicked(); void onEditAppearanceButtonClicked(); - void toggleMyOutfitsPanel(BOOL visible); + void toggleMyOutfitsPanel(BOOL visible, const std::string& tab_name); void toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch = FALSE); void toggleWearableEditPanel(BOOL visible, LLViewerWearable* wearable = NULL, BOOL disable_camera_switch = FALSE); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1aa67a30cd..6104f72fc8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6373,6 +6373,11 @@ void handle_edit_outfit() LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_outfit")); } +void handle_now_wearing() +{ + LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "now_wearing")); +} + void handle_edit_shape() { LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_shape")); @@ -8985,6 +8990,7 @@ void initialize_menus() view_listener_t::addMenu(new LLEnableHoverHeight(), "Edit.EnableHoverHeight"); view_listener_t::addMenu(new LLEnableEditPhysics(), "Edit.EnableEditPhysics"); commit.add("CustomizeAvatar", boost::bind(&handle_customize_avatar)); + commit.add("NowWearing", boost::bind(&handle_now_wearing)); commit.add("EditOutfit", boost::bind(&handle_edit_outfit)); commit.add("EditShape", boost::bind(&handle_edit_shape)); commit.add("HoverHeight", boost::bind(&handle_hover_height)); 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 856bf4ce73..13e4b9ba7b 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml @@ -37,39 +37,47 @@ layout="topleft" /> + + + + - + + function="HoverHeight" /> + function="Edit.EnableHoverHeight" /> + name="Edit Shape"> - - - + + + + + + + - - - - - - - - @@ -35,8 +28,25 @@ + + + + + + + + - - - + function="NowWearing" /> - + + function="CustomizeAvatar" /> - - - - @@ -207,8 +189,26 @@ + + + + + + + + + + + + - From 89b4611fc00a17d923c06d510da6842002113199 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 30 Mar 2021 15:53:22 +0300 Subject: [PATCH 2/3] SL-15036 Add actions to move landmarks between tabs in the Places floater --- indra/newview/llfavoritesbar.cpp | 4 ++ indra/newview/llinventoryfunctions.cpp | 20 +++++++ indra/newview/llinventoryfunctions.h | 2 + indra/newview/llpanellandmarks.cpp | 56 ++++++++++++++++++- .../skins/default/xui/en/menu_favorites.xml | 8 +++ .../xui/en/menu_places_gear_landmark.xml | 22 ++++++++ 6 files changed, 110 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 8791f605e9..4a40a74dec 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1281,6 +1281,10 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) LLNotificationsUtil::add("RenameLandmark", args, payload, boost::bind(onRenameCommit, _1, _2)); } + else if (action == "move_to_landmarks") + { + change_item_parent(mSelectedItemID, gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); + } // Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item). // See EXT-4217 and STORM-207. diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f84bc68c82..f2e06d19f3 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1847,6 +1847,26 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_ return result && !has_bad_items; } +void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id) +{ + LLInventoryItem* inv_item = gInventory.getItem(item_id); + if (inv_item) + { + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(inv_item->getParentUUID(), -1); + update.push_back(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1); + update.push_back(new_folder); + gInventory.accountForUpdate(update); + + LLPointer new_item = new LLViewerInventoryItem(inv_item); + new_item->setParent(new_parent_id); + new_item->updateParentOnServer(FALSE); + gInventory.updateItem(new_item); + gInventory.notifyObservers(); + } +} + ///---------------------------------------------------------------------------- /// LLInventoryCollectFunctor implementations ///---------------------------------------------------------------------------- diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 04eb962372..37c3c47336 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -92,6 +92,8 @@ S32 depth_nesting_in_marketplace(LLUUID cur_uuid); LLUUID nested_parent_id(LLUUID cur_uuid, S32 depth); S32 compute_stock_count(LLUUID cat_uuid, bool force_count = false); +void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id); + /** Miscellaneous global functions ** ** *******************************************************************************/ diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 8bc4bca675..4b73412e60 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -615,6 +615,8 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const ? mCurrentSelectedList->getRootFolder() : NULL; + bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1; + if ("collapse_all" == command_name) { return has_expanded_folders(mCurrentSelectedList->getRootFolder()); @@ -669,7 +671,6 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const ) { // disable some commands for multi-selection. EXT-1757 - bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1; if (!is_single_selection) { return false; @@ -718,7 +719,6 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const } else if ("add_landmark" == command_name) { - bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1; if (!is_single_selection) { return false; @@ -759,6 +759,36 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const } return true; } + else if (command_name == "move_to_landmarks" || command_name == "move_to_favorites") + { + LLFolderViewModelItemInventory* cur_item_model = getCurSelectedViewModelItem(); + if (cur_item_model) + { + LLFolderType::EType folder_type = command_name == "move_to_landmarks" ? LLFolderType::FT_FAVORITE : LLFolderType::FT_LANDMARK; + if (!gInventory.isObjectDescendentOf(cur_item_model->getUUID(), gInventory.findCategoryUUIDForType(folder_type))) + { + return false; + } + + if (root_folder_view) + { + std::set selected_uuids = root_folder_view->getSelectionList(); + for (std::set::const_iterator iter = selected_uuids.begin(); iter != selected_uuids.end(); ++iter) + { + LLFolderViewItem* item = *iter; + if (!item) return false; + + cur_item_model = static_cast(item->getViewModelItem()); + if (!cur_item_model || cur_item_model->getInventoryType() != LLInventoryType::IT_LANDMARK) + { + return false; + } + } + return true; + } + } + return false; + } else { LL_WARNS() << "Unprocessed command has come: " << command_name << LL_ENDL; @@ -798,6 +828,28 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata) { mCurrentSelectedList->doToSelected(userdata); } + else if (command_name == "move_to_landmarks" || command_name == "move_to_favorites") + { + LLFolderView* root_folder_view = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : NULL; + if (root_folder_view) + { + LLFolderType::EType folder_type = command_name == "move_to_landmarks" ? LLFolderType::FT_LANDMARK : LLFolderType::FT_FAVORITE; + std::set selected_uuids = root_folder_view->getSelectionList(); + for (std::set::const_iterator iter = selected_uuids.begin(); iter != selected_uuids.end(); ++iter) + { + LLFolderViewItem* item = *iter; + if (item) + { + LLFolderViewModelItemInventory* item_model = static_cast(item->getViewModelItem()); + if (item_model) + { + change_item_parent(item_model->getUUID(), gInventory.findCategoryUUIDForType(folder_type)); + } + } + } + } + + } } void LLLandmarksPanel::onMenuVisibilityChange(LLUICtrl* ctrl, const LLSD& param) diff --git a/indra/newview/skins/default/xui/en/menu_favorites.xml b/indra/newview/skins/default/xui/en/menu_favorites.xml index 6c28032e3f..0eab7c451b 100644 --- a/indra/newview/skins/default/xui/en/menu_favorites.xml +++ b/indra/newview/skins/default/xui/en/menu_favorites.xml @@ -20,6 +20,14 @@ function="Favorites.DoToSelected" parameter="about" /> + + + + + + + + + + + Date: Tue, 30 Mar 2021 18:34:50 +0300 Subject: [PATCH 3/3] SL-15050 Change name of toolbar button to "Guidebook" --- indra/newview/skins/default/xui/en/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index d9d0b659cc..921f689732 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4126,7 +4126,7 @@ Try enclosing path to the editor with double quotes. My Environments Gestures Grid status - How to + Guidebook Inventory Map Marketplace