From f05e58715e0a18a7ba2ace87c2ae45684c864169 Mon Sep 17 00:00:00 2001
From: Dave Houlton <euclid@lindenlab.com>
Date: Fri, 29 Apr 2022 17:04:22 -0600
Subject: [PATCH] SL-17116, SL-17277 single-face material save only

---
 indra/newview/llpanelface.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 6f4d57f30e6..6b3ca434026 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -1412,9 +1412,14 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
 			LLMaterialPtr material;
 			LLSelectedTEMaterial::getCurrent(material, identical);
 
-            // QUICKHACK - enable this UI box, indiscriminatly.  TODO discriminate DJH 2022-04
-            childSetEnabled("button save material", true);
-            
+            // enable this UI box if a single face is selected.
+            BOOL is_single_face = !LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected();
+            childSetEnabled("button save material", static_cast<bool>(is_single_face));
+            childSetEnabled("materialID", static_cast<bool>(is_single_face));   // doesn't work - why?
+
+            // TODO: 2022-04 conflicts with media button placement. hide the button if applying media
+            // i.e.  childSetVisible("button save material", !applying_media);
+
             if (material && editable)
 			{
 				LL_DEBUGS("Materials") << material->asLLSD() << LL_ENDL;
-- 
GitLab