summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-11-18 21:06:48 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-11-18 21:15:54 +0200
commitade79bc6f6b6269dbcb88f3dff2db6584d0c2f53 (patch)
tree67c1e35b47afa9a80f26f86effe2f9d9ca46379b /indra/newview/llpanelmaininventory.cpp
parent32663643c77a931892a2f8e40e011c60bc726d4e (diff)
SL-18677 Disable materials UI when materials caps are not available
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 49562da3f7..8b78ee843f 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -127,6 +127,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this));
mEnableCallbackRegistrar.add("Inventory.EnvironmentEnabled", [](LLUICtrl *, const LLSD &) { return LLPanelMainInventory::hasSettingsInventory(); });
+ mEnableCallbackRegistrar.add("Inventory.MaterialsEnabled", [](LLUICtrl *, const LLSD &) { return LLPanelMainInventory::hasMaterialsInventory(); });
mSavedFolderState = new LLSaveFolderState();
@@ -1595,5 +1596,13 @@ bool LLPanelMainInventory::hasSettingsInventory()
return LLEnvironment::instance().isInventoryEnabled();
}
+bool LLPanelMainInventory::hasMaterialsInventory()
+{
+ std::string agent_url = gAgent.getRegionCapability("UpdateMaterialAgentInventory");
+ std::string task_url = gAgent.getRegionCapability("UpdateMaterialTaskInventory");
+
+ return (!agent_url.empty() && !task_url.empty());
+}
+
// List Commands //
////////////////////////////////////////////////////////////////////////////////