diff options
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 |