Skip to content
Snippets Groups Projects
Commit e161b128 authored by Maxim Nikolenko's avatar Maxim Nikolenko
Browse files

SL-19379 WIP one more batch of context menu items

parent 0d068b0f
Branches
Tags
No related merge requests found
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
#include "llviewerfoldertype.h" #include "llviewerfoldertype.h"
#include "llviewerwindow.h" #include "llviewerwindow.h"
#include "llvoavatarself.h"
LLContextMenu* LLInventoryGalleryContextMenu::createMenu() LLContextMenu* LLInventoryGalleryContextMenu::createMenu()
{ {
...@@ -276,6 +277,18 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata, const LLU ...@@ -276,6 +277,18 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata, const LLU
{ {
ungroup_folder_items(selected_id); 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) void LLInventoryGalleryContextMenu::onRename(const LLSD& notification, const LLSD& response)
...@@ -564,6 +577,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men ...@@ -564,6 +577,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
&& obj->getType() != LLAssetType::AT_OBJECT && obj->getType() != LLAssetType::AT_OBJECT
&& obj->getType() != LLAssetType::AT_CLOTHING && obj->getType() != LLAssetType::AT_CLOTHING
&& obj->getType() != LLAssetType::AT_CATEGORY && obj->getType() != LLAssetType::AT_CATEGORY
&& obj->getType() != LLAssetType::AT_LANDMARK
&& obj->getType() != LLAssetType::AT_BODYPART)) && obj->getType() != LLAssetType::AT_BODYPART))
{ {
bool can_open = !LLAssetType::lookupIsLinkType(obj->getType()); bool can_open = !LLAssetType::lookupIsLinkType(obj->getType());
...@@ -585,6 +599,46 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men ...@@ -585,6 +599,46 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
{ {
items.push_back(std::string("Landmark Open")); 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) if (is_link)
{ {
items.push_back(std::string("Find Original")); items.push_back(std::string("Find Original"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment