diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-05-28 21:38:00 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-05-28 21:38:00 +0300 |
commit | b08ba3fa7bc9e6309891e510fbfb5c4e2b5c922e (patch) | |
tree | 3e5294e3b8ff07778e6134ed9dd41458386032ac /indra/newview/llpanelvolume.cpp | |
parent | b9ab6c3644da02bed6941dc8df433fb1c626f8c7 (diff) | |
parent | de8275b14b30bf754cdba1da867cb2e6c2783639 (diff) |
Merge branch 'main' into marchcat/2505-merge
# Conflicts:
# .github/workflows/qatest.yaml
# indra/llcommon/llsdutil.h
# indra/llui/llflatlistview.h
# indra/newview/llinventorybridge.cpp
# indra/newview/lloutfitgallery.cpp
# indra/newview/lloutfitgallery.h
Diffstat (limited to 'indra/newview/llpanelvolume.cpp')
-rw-r--r-- | indra/newview/llpanelvolume.cpp | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 951dc45a78..2fbdbeaf59 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -576,32 +576,48 @@ void LLPanelVolume::getState( ) return object->getMaterial(); } } func; - bool material_same = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, material_code ); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); + bool material_same = selection->getSelectedTEValue( &func, material_code ); std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); - if (editable && single_volume && material_same) + + bool enable_material = editable && single_volume && material_same; + LLCachedControl<bool> edit_linked(gSavedSettings, "EditLinkedParts", false); + if (!enable_material && !edit_linked()) { - mComboMaterial->setEnabled( true ); - if (material_code == LL_MCODE_LIGHT) + LLViewerObject* root = selection->getPrimaryObject(); + while (root && !root->isAvatar() && root->getParent()) { - if (mComboMaterial->getItemCount() == mComboMaterialItemCount) + LLViewerObject* parent = (LLViewerObject*)root->getParent(); + if (parent->isAvatar()) { - mComboMaterial->add(LEGACY_FULLBRIGHT_DESC); + break; } - mComboMaterial->setSimple(LEGACY_FULLBRIGHT_DESC); + root = parent; } - else + if (root) { - if (mComboMaterial->getItemCount() != mComboMaterialItemCount) - { - mComboMaterial->remove(LEGACY_FULLBRIGHT_DESC); - } + material_code = root->getMaterial(); + } + } - mComboMaterial->setSimple(std::string(LLMaterialTable::basic.getName(material_code))); + mComboMaterial->setEnabled(enable_material); + + if (material_code == LL_MCODE_LIGHT) + { + if (mComboMaterial->getItemCount() == mComboMaterialItemCount) + { + mComboMaterial->add(LEGACY_FULLBRIGHT_DESC); } + mComboMaterial->setSimple(LEGACY_FULLBRIGHT_DESC); } else { - mComboMaterial->setEnabled( false ); + if (mComboMaterial->getItemCount() != mComboMaterialItemCount) + { + mComboMaterial->remove(LEGACY_FULLBRIGHT_DESC); + } + + mComboMaterial->setSimple(std::string(LLMaterialTable::basic.getName(material_code))); } // Physics properties |