summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.cpp
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-05-06 10:19:55 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-05-06 10:19:55 -0700
commit1a39876c64be99456291724bb539e71344962ab5 (patch)
treef35843645d599edb7c8f70a7bd760616262384e4 /indra/newview/llpanelface.cpp
parenta9ede989158ceaa4914ea48ff6a2027e89fdbda2 (diff)
NORSPEC-94 fix this without setting in getState causing round-trip wierdness with spec color picker
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rwxr-xr-xindra/newview/llpanelface.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 74b1915cac..1fbf4a39e6 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -1297,6 +1297,7 @@ void LLPanelFace::getState()
mColorSwatch->setEnabled( editable );
mColorSwatch->setCanApplyImmediately( editable );
}
+
// Color transparency
{
getChildView("color trans")->setEnabled(editable);
@@ -1363,14 +1364,10 @@ void LLPanelFace::getState()
getChild<LLUICtrl>("shinycolorswatch")->setTentative(!identical);
getChildView("label shinycolor")->setEnabled(editable);
}
- // NORSPEC-94: Set default specular color to white (will get
- // overwritten from material when loaded)
+
LLColorSwatchCtrl* mShinyColorSwatch = getChild<LLColorSwatchCtrl>("shinycolorswatch");
- color = LLColor4::white;
if(mShinyColorSwatch)
{
- mShinyColorSwatch->setOriginal(color);
- mShinyColorSwatch->set(color, TRUE);
mShinyColorSwatch->setValid(editable);
mShinyColorSwatch->setEnabled( editable );
mShinyColorSwatch->setCanApplyImmediately( editable );
@@ -1716,13 +1713,20 @@ void LLPanelFace::onMaterialLoaded(const LLMaterialID& material_id, const LLMate
getChild<LLUICtrl>("shinyRot")->setValue(rot*RAD_TO_DEG);
getChild<LLUICtrl>("shinyOffsetU")->setValue(offset_x);
getChild<LLUICtrl>("shinyOffsetV")->setValue(offset_y);
- getChild<LLColorSwatchCtrl>("shinycolorswatch")->setOriginal(material->getSpecularLightColor());
- getChild<LLColorSwatchCtrl>("shinycolorswatch")->set(material->getSpecularLightColor(),TRUE);
getChild<LLUICtrl>("glossiness")->setValue(material->getSpecularLightExponent());
getChild<LLUICtrl>("environment")->setValue(material->getEnvironmentIntensity());
}
updateShinyControls(combobox_shininess,this, true);
+ // Assert desired colorswatch color to match material AFTER updateShinyControls
+ // to avoid getting overwritten with the default on some UI state changes.
+ //
+ if (!material->getSpecularID().isNull())
+ {
+ getChild<LLColorSwatchCtrl>("shinycolorswatch")->setOriginal(material->getSpecularLightColor());
+ getChild<LLColorSwatchCtrl>("shinycolorswatch")->set(material->getSpecularLightColor(),TRUE);
+ }
+
// Bumpy (normal)
texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
texture_ctrl->setImageAssetID(material->getNormalID());
@@ -2097,6 +2101,18 @@ void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool mess_
if (!comboShiny->itemExists(USE_TEXTURE))
{
comboShiny->add(USE_TEXTURE);
+
+ // NORSPEC-94: Set default specular color to white
+ //
+ LLColorSwatchCtrl* mShinyColorSwatch = self->getChild<LLColorSwatchCtrl>("shinycolorswatch");
+ if(mShinyColorSwatch)
+ {
+ // Doing sets in a getState func causes the 'blinking updates' of swatch colors....DON'T.
+ //
+ LL_DEBUGS("Materials") << "Resetting specular color to default of white" << LL_ENDL;
+ mShinyColorSwatch->setOriginal(LLColor4::white);
+ mShinyColorSwatch->set(LLColor4::white, TRUE);
+ }
}
comboShiny->setSimple(USE_TEXTURE);
}