summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-09-10 00:48:20 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-09-10 00:57:39 +0300
commitc118c2762302b44fb312752c6d94c384bfda529a (patch)
tree0b61d3cdc73bf0bb87c87a84e779ab62a91d6fae /indra/newview/llinventorybridge.cpp
parente9da22cecc526087b62c39c5d0824ec918b874bc (diff)
SL-18117 Smarter add and detach inventory menus
The 'exceptions' solution is a bit ugly, but alternative is remaking all inventory and chat menus to act based on registars
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index c18ee0c4a0..e29308d3d1 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -734,15 +734,15 @@ void hide_context_entries(LLMenuGL& menu,
}
bool found = false;
- menuentry_vec_t::const_iterator itor2;
- for (itor2 = entries_to_show.begin(); itor2 != entries_to_show.end(); ++itor2)
- {
- if (*itor2 == name)
- {
- found = true;
- break;
- }
- }
+
+ std::string myinput;
+ std::vector<std::string> mylist{ "a", "b", "c" };
+
+ menuentry_vec_t::const_iterator itor2 = std::find(entries_to_show.begin(), entries_to_show.end(), name);
+ if (itor2 != entries_to_show.end())
+ {
+ found = true;
+ }
// Don't allow multiple separators in a row (e.g. such as if there are no items
// between two separators).
@@ -760,7 +760,21 @@ void hide_context_entries(LLMenuGL& menu,
menu_item->setVisible(FALSE);
}
- menu_item->setEnabled(FALSE);
+ if (menu_item->getEnabled())
+ {
+ // These should stay enabled unless specifically disabled
+ const menuentry_vec_t exceptions = {
+ "Detach From Yourself",
+ "Wearable And Object Wear",
+ "Wearable Add",
+ };
+
+ menuentry_vec_t::const_iterator itor2 = std::find(exceptions.begin(), exceptions.end(), name);
+ if (itor2 == exceptions.end())
+ {
+ menu_item->setEnabled(FALSE);
+ }
+ }
}
else
{