diff options
| author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-30 02:36:14 +0300 | 
|---|---|---|
| committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-30 02:36:14 +0300 | 
| commit | e161b128c7eac6df63b6d9210f3bca6c3cbc77ea (patch) | |
| tree | c3ea7e08fd80c68e940ead103fe4364b571f91b0 | |
| parent | 0d068b0f3080a3378b54d508029bbc11e262aa2f (diff) | |
SL-19379 WIP one more batch of context menu items
| -rw-r--r-- | indra/newview/llinventorygallerymenu.cpp | 54 | 
1 files changed, 54 insertions, 0 deletions
| diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index 11dd5e6690..a501f02e00 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -42,6 +42,7 @@  #include "llnotificationsutil.h"  #include "llviewerfoldertype.h"  #include "llviewerwindow.h" +#include "llvoavatarself.h"  LLContextMenu* LLInventoryGalleryContextMenu::createMenu()  { @@ -276,6 +277,18 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata, const LLU      {          ungroup_folder_items(selected_id);      } +    else if ("take_off" == action || "detach" == action) +    { +        LLAppearanceMgr::instance().removeItemFromAvatar(selected_id); +    } +    else if ("wear_add" == action) +    { +        LLAppearanceMgr::instance().wearItemOnAvatar(selected_id, true, false); // Don't replace if adding. +    } +    else if ("wear" == action) +    { +        LLAppearanceMgr::instance().wearItemOnAvatar(selected_id, true, true); +    }  }  void LLInventoryGalleryContextMenu::onRename(const LLSD& notification, const LLSD& response) @@ -564,6 +577,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men                 && obj->getType() != LLAssetType::AT_OBJECT                 && obj->getType() != LLAssetType::AT_CLOTHING                 && obj->getType() != LLAssetType::AT_CATEGORY +               && obj->getType() != LLAssetType::AT_LANDMARK                 && obj->getType() != LLAssetType::AT_BODYPART))          {              bool can_open = !LLAssetType::lookupIsLinkType(obj->getType()); @@ -585,6 +599,46 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men          {              items.push_back(std::string("Landmark Open"));          } +        else if (obj->getType() == LLAssetType::AT_OBJECT || obj->getType() == LLAssetType::AT_CLOTHING || obj->getType() == LLAssetType::AT_BODYPART) +        { +            items.push_back(std::string("Wearable And Object Separator")); +            if(obj->getType() == LLAssetType::AT_CLOTHING) +            { +                items.push_back(std::string("Take Off")); +            } +            if(get_is_item_worn(selected_id)) +            { +                if(obj->getType() == LLAssetType::AT_OBJECT) +                { +                    items.push_back(std::string("Detach From Yourself")); +                } +                disabled_items.push_back(std::string("Wearable And Object Wear")); +                disabled_items.push_back(std::string("Wearable Add")); +            } +            else +            { +                if(obj->getType() == LLAssetType::AT_OBJECT) +                { +                    items.push_back(std::string("Wearable Add")); +                } +                items.push_back(std::string("Wearable And Object Wear")); +                disabled_items.push_back(std::string("Take Off")); +            } + +            if (!gAgentAvatarp->canAttachMoreObjects() && (obj->getType() == LLAssetType::AT_OBJECT)) +            { +                disabled_items.push_back(std::string("Wearable And Object Wear")); +                disabled_items.push_back(std::string("Wearable Add")); +            } +            if (selected_item && (obj->getType() != LLAssetType::AT_OBJECT) && LLWearableType::getInstance()->getAllowMultiwear(selected_item->getWearableType())) +            { +                items.push_back(std::string("Wearable Add")); +                if (!gAgentWearables.canAddWearable(selected_item->getWearableType())) +                { +                    disabled_items.push_back(std::string("Wearable Add")); +                } +            } +        }          if (is_link)          {              items.push_back(std::string("Find Original")); | 
