summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelwearing.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-10-12 13:34:06 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-10-12 13:34:06 +0300
commitdcb5cf5bc21ba2e316cc2889b2c1371860b0348d (patch)
tree2ccd2671ce46abb8bf12786ccf53e597e6a0049d /indra/newview/llpanelwearing.cpp
parent1b19919eff1104f9f1ee97004420e91c45349e29 (diff)
parent738cf84c340d8ade3ab462340d1444c4e70ef9f5 (diff)
Merge commit '738cf84c34' into marchcat/c-develop
# Conflicts: # indra/llui/llfolderviewitem.cpp # indra/llui/llfolderviewitem.h # indra/llui/llfolderviewmodel.h # indra/newview/llconversationmodel.h # indra/newview/llfloaterinventorysettings.cpp # indra/newview/llfolderviewmodelinventory.h # indra/newview/llinventorybridge.cpp # indra/newview/llinventorybridge.h # indra/newview/llinventoryfunctions.cpp # indra/newview/llinventorygallery.h # indra/newview/llinventorygallerymenu.cpp # indra/newview/llinventorypanel.cpp # indra/newview/llinventorypanel.h # indra/newview/lloutfitgallery.cpp # indra/newview/lloutfitgallery.h # indra/newview/lloutfitslist.cpp # indra/newview/lloutfitslist.h # indra/newview/llpanelobjectinventory.cpp # indra/newview/llpaneloutfitsinventory.h # indra/newview/llpanelwearing.cpp # indra/newview/llsidepanelappearance.cpp # indra/newview/llwearableitemslist.cpp
Diffstat (limited to 'indra/newview/llpanelwearing.cpp')
-rw-r--r--indra/newview/llpanelwearing.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index 1056f73d58..5646c8b80c 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -113,6 +113,7 @@ protected:
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs, no_op));
registrar.add("Wearing.Detach",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs, no_op));
+ 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.
@@ -162,10 +170,12 @@ protected:
menu->setItemEnabled("touch_attach", 1 == mUUIDs.size() && enable_attachment_touch(mUUIDs.front()));
menu->setItemVisible("edit_item", show_edit);
menu->setItemEnabled("edit_item", 1 == mUUIDs.size() && get_is_item_editable(mUUIDs.front()));
- menu->setItemVisible("take_off", allow_take_off);
- menu->setItemVisible("detach", allow_detach);
+ menu->setItemVisible("take_off", allow_take_off);
+ 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("show_original", mUUIDs.size() == 1);
+ menu->setItemVisible("favorites_add", can_favorite);
+ menu->setItemVisible("favorites_remove", can_unfavorite);
}
};
@@ -232,6 +242,10 @@ LLPanelWearing::~LLPanelWearing()
{
mAttachmentsChangedConnection.disconnect();
}
+ if (mGearMenuConnection.connected())
+ {
+ mGearMenuConnection.disconnect();
+ }
}
bool LLPanelWearing::postBuild()
@@ -560,6 +574,16 @@ void LLPanelWearing::onRemoveAttachment()
}
}
+LLToggleableMenu* LLPanelWearing::getGearMenu()
+{
+ return mGearMenu->getMenu();
+}
+
+LLToggleableMenu* LLPanelWearing::getSortMenu()
+{
+ return NULL;
+}
+
void LLPanelWearing::onRemoveItem()
{
if (mWearablesTab->isExpanded())