summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-06-08 07:25:47 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-06-08 07:25:47 -0700
commitfba40dc4f72ce2aa2dead5c46c1c9dbc18c13866 (patch)
treec5cb9e9f85eaa87ae1f2dbf98a4e74e03bfc8d3f /indra
parenteba7eb2d062c43cd83cb6972e4e05dc54d409582 (diff)
NORSPEC-226 NORSPEC-222 fix menu content bugs and alpha mask stomp when editing multiple objects
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llpanelface.cpp19
-rwxr-xr-xindra/newview/llpanelface.h12
2 files changed, 14 insertions, 17 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index afc9d5b123..c6d52a0661 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -317,6 +317,7 @@ void LLPanelFace::sendTexture()
void LLPanelFace::sendBump(U32 bumpiness)
{
LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
+ LLUUID current_normal_map = bumpytexture_ctrl->getImageAssetID();
if (bumpiness < BUMPY_TEXTURE)
{
@@ -329,7 +330,7 @@ void LLPanelFace::sendBump(U32 bumpiness)
LLSelectMgr::getInstance()->selectionSetBumpmap( bump );
updateBumpyControls(bumpiness == BUMPY_TEXTURE, true);
- LLSelectedTEMaterial::setNormalID(this, bumpytexture_ctrl->getImageAssetID());
+ LLSelectedTEMaterial::setNormalID(this, current_normal_map);
}
void LLPanelFace::sendTexGen()
@@ -1443,6 +1444,11 @@ void LLPanelFace::onSelectColor(const LLSD& data)
void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace* self = (LLPanelFace*) userdata;
+ // Force to default states to side-step problems with menu contents
+ // and generally reflecting old state when switching tabs or objects
+ //
+ self->updateShinyControls(false,true);
+ self->updateBumpyControls(false,true);
self->updateUI();
}
@@ -1530,10 +1536,11 @@ void LLPanelFace::updateVisibility()
void LLPanelFace::onCommitMaterialType(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace* self = (LLPanelFace*) userdata;
- // This is here to insure that we properly update shared UI elements
- // like the texture ctrls for diffuse/norm/spec so that they are correct
- // when switching modes
- //
+ // Force to default states to side-step problems with menu contents
+ // and generally reflecting old state when switching tabs or objects
+ //
+ self->updateShinyControls(false,true);
+ self->updateBumpyControls(false,true);
self->updateUI();
}
@@ -1801,7 +1808,7 @@ void LLPanelFace::onCommitSpecularTexture( const LLSD& data )
void LLPanelFace::onCommitNormalTexture( const LLSD& data )
{
LL_DEBUGS("Materials") << data << LL_ENDL;
- sendBump(BUMPY_TEXTURE);
+ sendBump(getCurrentNormalMap().isNull() ? 0 : BUMPY_TEXTURE);
}
void LLPanelFace::onCancelSpecularTexture(const LLSD& data)
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index b6a8df19fe..84aba4dc89 100755
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -242,7 +242,7 @@ private:
// Default to matching expected state of UI
//
- new_material->setDiffuseAlphaMode(default_alpha_mode);
+ new_material->setDiffuseAlphaMode(current_material.isNull() ? default_alpha_mode : current_material->getDiffuseAlphaMode());
// Do "It"!
//
@@ -262,16 +262,6 @@ private:
}
else
{
- // Replicate old init behavior
- //
- if (current_material.isNull())
- {
- U8 current_alpha_mode = _panel->getCurrentDiffuseAlphaMode();
- U8 current_alpha_mask_cutoff = _panel->getCurrentAlphaMaskCutoff();
- new_material->setDiffuseAlphaMode(current_alpha_mode);
- new_material->setAlphaMaskCutoff(current_alpha_mask_cutoff);
- }
-
LL_DEBUGS("Materials") << "Putting material on object " << object->getID() << " face " << face << ", material: " << new_material->asLLSD() << LL_ENDL;
LLMaterialMgr::getInstance()->put(object->getID(),face,*new_material);
}