summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rwxr-xr-xindra/newview/llpanelface.cpp67
1 files changed, 25 insertions, 42 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 02e05d3d9a..717aece8dd 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -242,6 +242,8 @@ BOOL LLPanelFace::postBuild()
if(mShinyColorSwatch)
{
mShinyColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitShinyColor, this, _2));
+ mShinyColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelShinyColor, this, _2));
+ mShinyColorSwatch->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectShinyColor, this, _2));
mShinyColorSwatch->setFollowsTop();
mShinyColorSwatch->setFollowsLeft();
mShinyColorSwatch->setCanApplyImmediately(TRUE);
@@ -900,52 +902,22 @@ void LLPanelFace::updateUI()
getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha);
}
}
-
- if (shinytexture_ctrl)
- {
- if (identical_spec && (shiny == SHINY_TEXTURE))
- {
- shinytexture_ctrl->setTentative( FALSE );
- shinytexture_ctrl->setEnabled( editable );
- shinytexture_ctrl->setImageAssetID( specmap_id );
- }
- else if (specmap_id.isNull())
- {
- shinytexture_ctrl->setTentative( FALSE );
- shinytexture_ctrl->setEnabled( editable );
- shinytexture_ctrl->setImageAssetID( LLUUID::null );
- }
- else
- {
- shinytexture_ctrl->setTentative( TRUE );
- shinytexture_ctrl->setEnabled( editable );
- shinytexture_ctrl->setImageAssetID( specmap_id );
+
+ if (shinytexture_ctrl)
+ {
+ shinytexture_ctrl->setTentative( !identical_spec );
+ shinytexture_ctrl->setEnabled( editable );
+ shinytexture_ctrl->setImageAssetID( specmap_id );
}
- }
- if (bumpytexture_ctrl)
- {
- if (identical_norm && (bumpy == BUMPY_TEXTURE))
- {
- bumpytexture_ctrl->setTentative( FALSE );
- bumpytexture_ctrl->setEnabled( editable );
- bumpytexture_ctrl->setImageAssetID( normmap_id );
- }
- else if (normmap_id.isNull())
- {
- bumpytexture_ctrl->setTentative( FALSE );
- bumpytexture_ctrl->setEnabled( editable );
- bumpytexture_ctrl->setImageAssetID( LLUUID::null );
- }
- else
- {
- bumpytexture_ctrl->setTentative( TRUE );
- bumpytexture_ctrl->setEnabled( editable );
- bumpytexture_ctrl->setImageAssetID( normmap_id );
- }
+ if (bumpytexture_ctrl)
+ {
+ bumpytexture_ctrl->setTentative( !identical_norm );
+ bumpytexture_ctrl->setEnabled( editable );
+ bumpytexture_ctrl->setImageAssetID( normmap_id );
}
}
-
+
// planar align
bool align_planar = false;
bool identical_planar_aligned = false;
@@ -1463,12 +1435,23 @@ void LLPanelFace::onCancelColor(const LLSD& data)
LLSelectMgr::getInstance()->selectionRevertColors();
}
+void LLPanelFace::onCancelShinyColor(const LLSD& data)
+{
+ LLSelectMgr::getInstance()->selectionRevertShinyColors();
+}
+
void LLPanelFace::onSelectColor(const LLSD& data)
{
LLSelectMgr::getInstance()->saveSelectedObjectColors();
sendColor();
}
+void LLPanelFace::onSelectShinyColor(const LLSD& data)
+{
+ LLSelectedTEMaterial::setSpecularLightColor(this, getChild<LLColorSwatchCtrl>("shinycolorswatch")->get());
+ LLSelectMgr::getInstance()->saveSelectedShinyColors();
+}
+
// static
void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata)
{