summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelwearing.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-05-09 23:51:11 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-05-16 15:16:13 +0300
commit738cf84c340d8ade3ab462340d1444c4e70ef9f5 (patch)
tree07bb35f01c09d0598f57261f8a976fb7559e244b /indra/newview/llpanelwearing.cpp
parent50b93bd83af7cc4ddbd5b8b68f20099dac5f5ed2 (diff)
viewer#1424 Favorite support for items in outfits
For now marking originals, pointless to marks links in COF, needs a revision due to inconsistency with inventory
Diffstat (limited to 'indra/newview/llpanelwearing.cpp')
-rw-r--r--indra/newview/llpanelwearing.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index b66c546f9b..aecdf13495 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -113,6 +113,7 @@ protected:
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs));
registrar.add("Wearing.Detach",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs));
+ registrar.add("Wearing.Favorite", boost::bind(toggle_linked_favorite, mUUIDs.front()));
LLContextMenu* menu = createFromFile("menu_wearing_tab.xml");
updateMenuItemsVisibility(menu);
@@ -125,6 +126,8 @@ protected:
bool bp_selected = false; // true if body parts selected
bool clothes_selected = false;
bool attachments_selected = false;
+ bool can_favorite = false;
+ bool can_unfavorite = false;
// See what types of wearables are selected.
for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it)
@@ -137,6 +140,9 @@ protected:
continue;
}
+ LLUUID linked_id = item->getLinkedUUID();
+ LLViewerInventoryItem* linked_item = gInventory.getItem(linked_id);
+
LLAssetType::EType type = item->getType();
if (type == LLAssetType::AT_CLOTHING)
{
@@ -150,6 +156,8 @@ protected:
{
attachments_selected = true;
}
+ can_favorite |= !linked_item->getIsFavorite();
+ can_unfavorite |= linked_item->getIsFavorite();
}
// Enable/disable some menu items depending on the selection.
@@ -166,6 +174,8 @@ protected:
menu->setItemVisible("detach", allow_detach);
menu->setItemVisible("edit_outfit_separator", show_touch | show_edit | allow_take_off || allow_detach);
menu->setItemVisible("show_original", mUUIDs.size() == 1);
+ menu->setItemVisible("favorites_add", can_favorite);
+ menu->setItemVisible("favorites_remove", can_unfavorite);
}
};