diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-02-16 21:33:14 +0200 |
---|---|---|
committer | akleshchev <117672381+akleshchev@users.noreply.github.com> | 2023-02-16 22:51:29 +0200 |
commit | 17d3f3786376578b765cd7a9b7f9a9e391e53cb9 (patch) | |
tree | 275600c54f33301fe1f3f2b96283c84cbbdeebf3 /indra/newview | |
parent | 5baee50c654ae26428af07f59a512dee8814f24e (diff) |
SL-17640 Fix 'Apply now' being enabled when importing
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llmaterialeditor.cpp | 15 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 12 |
2 files changed, 22 insertions, 5 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 41085afb3d..64ce5fd4d2 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -420,6 +420,13 @@ BOOL LLMaterialEditor::postBuild() mEmissiveTextureCtrl->setOnSelectCallback(boost::bind(&LLMaterialEditor::onSelectCtrl, this, _1, _2, MATERIAL_EMISIVE_TEX_DIRTY)); mNormalTextureCtrl->setOnSelectCallback(boost::bind(&LLMaterialEditor::onSelectCtrl, this, _1, _2, MATERIAL_NORMAL_TEX_DIRTY)); } + else + { + mBaseColorTextureCtrl->setCanApplyImmediately(false); + mMetallicTextureCtrl->setCanApplyImmediately(false); + mEmissiveTextureCtrl->setCanApplyImmediately(false); + mNormalTextureCtrl->setCanApplyImmediately(false); + } if (!mIsOverride) { @@ -461,6 +468,10 @@ BOOL LLMaterialEditor::postBuild() mBaseColorCtrl->setOnCancelCallback(boost::bind(&LLMaterialEditor::onCancelCtrl, this, _1, _2, MATERIAL_BASE_COLOR_DIRTY)); mBaseColorCtrl->setOnSelectCallback(boost::bind(&LLMaterialEditor::onSelectCtrl, this, _1, _2, MATERIAL_BASE_COLOR_DIRTY)); } + else + { + mBaseColorCtrl->setCanApplyImmediately(false); + } // transparency is a part of base color childSetCommitCallback("transparency", changes_callback, (void*)&MATERIAL_BASE_COLOR_DIRTY); childSetCommitCallback("alpha mode", changes_callback, (void*)&MATERIAL_ALPHA_MODE_DIRTY); @@ -477,6 +488,10 @@ BOOL LLMaterialEditor::postBuild() mEmissiveColorCtrl->setOnCancelCallback(boost::bind(&LLMaterialEditor::onCancelCtrl, this, _1, _2, MATERIAL_EMISIVE_COLOR_DIRTY)); mEmissiveColorCtrl->setOnSelectCallback(boost::bind(&LLMaterialEditor::onSelectCtrl, this, _1, _2, MATERIAL_EMISIVE_COLOR_DIRTY)); } + else + { + mEmissiveColorCtrl->setCanApplyImmediately(false); + } if (!mIsOverride) { diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 4849015e79..6c38550049 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -251,7 +251,9 @@ void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b) { mCanApplyImmediately = b; - getChild<LLUICtrl>("apply_immediate_check")->setValue(mCanApplyImmediately); + LLUICtrl *apply_checkbox = getChild<LLUICtrl>("apply_immediate_check"); + apply_checkbox->setValue(mCanApplyImmediately && gSavedSettings.getBOOL("TextureLivePreview")); + apply_checkbox->setEnabled(mCanApplyImmediately); } void LLFloaterTexturePicker::stopUsingPipette() @@ -528,7 +530,7 @@ BOOL LLFloaterTexturePicker::postBuild() mNoCopyTextureSelected = FALSE; - getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("TextureLivePreview")); + getChild<LLUICtrl>("apply_immediate_check")->setValue(mCanApplyImmediately && gSavedSettings.getBOOL("TextureLivePreview")); childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); getChildView("apply_immediate_check")->setEnabled(mCanApplyImmediately); @@ -862,7 +864,7 @@ void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem if(!mPreviewSettingChanged) { - mCanPreview = gSavedSettings.getBOOL("TextureLivePreview"); + mCanPreview = mCanApplyImmediately && gSavedSettings.getBOOL("TextureLivePreview"); } else { @@ -1163,7 +1165,7 @@ void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void *user_data if (!self->mPreviewSettingChanged) { - self->mCanPreview = gSavedSettings.getBOOL("TextureLivePreview"); + self->mCanPreview = self->mCanApplyImmediately && gSavedSettings.getBOOL("TextureLivePreview"); } else { @@ -1184,7 +1186,7 @@ void LLFloaterTexturePicker::setCanApply(bool can_preview, bool can_apply) getChildRef<LLUICtrl>("apply_immediate_check").setVisible(can_preview); mCanApply = can_apply; - mCanPreview = can_preview ? gSavedSettings.getBOOL("TextureLivePreview") : false; + mCanPreview = can_preview ? (mCanApplyImmediately && gSavedSettings.getBOOL("TextureLivePreview")) : false; mPreviewSettingChanged = true; } |