From 00d0f810c74787de8544418ee121d7870e44fa5a Mon Sep 17 00:00:00 2001 From: Cinders Date: Sun, 29 Sep 2013 12:39:07 -0600 Subject: [PATCH] Fix some copypasta and add adjustable decimal precision to the other spinners in the face panel. --- indra/newview/llpanelface.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 1726527681..91918f1ff1 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -218,7 +218,7 @@ BOOL LLPanelFace::postBuild() { mCtrlBumpyOffsetV->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyOffsetY, this); } - mCtrlShinyOffsetU = getChild("bumpyOffsetU"); + mCtrlShinyOffsetU = getChild("shinyOffsetU"); if (mCtrlShinyOffsetU) { mCtrlShinyOffsetU->setCommitCallback(&LLPanelFace::onCommitMaterialShinyOffsetX, this); @@ -238,11 +238,16 @@ BOOL LLPanelFace::postBuild() { mCtrlBumpyRot->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyRot, this); } - mCtrlShinyRot = getChild("TexRot"); + mCtrlShinyRot = getChild("shinyRot"); if (mCtrlShinyRot) { mCtrlShinyRot->setCommitCallback(&LLPanelFace::onCommitMaterialShinyRot, this); } + mCtrlRpt = getChild("rptctrl"); + if (mCtrlRpt) + { + mCtrlRpt->setCommitCallback(LLPanelFace::onCommitRepeatsPerMeter, this); + } changePrecision(gSavedSettings.getS32("FSBuildToolDecimalPrecision")); // @@ -390,14 +395,6 @@ BOOL LLPanelFace::postBuild() { mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow, this); } - - // - mCtrlRpt = getChild("rptctrl"); - if (mCtrlRpt) - { - mCtrlRpt->setCommitCallback(LLPanelFace::onCommitRepeatsPerMeter, this); - } - // clearCtrls(); @@ -2741,7 +2738,7 @@ void LLPanelFace::onCommitFlip(const LLUICtrl* ctrl, const LLSD& user_data) void LLPanelFace::changePrecision(S32 decimal_precision) { if (decimal_precision < 0) decimal_precision = 0; - else if (decimal_precision > 10) decimal_precision = 9; + else if (decimal_precision > 9) decimal_precision = 9; mCtrlTexScaleU->setPrecision(decimal_precision); mCtrlTexScaleV->setPrecision(decimal_precision); @@ -2755,5 +2752,9 @@ void LLPanelFace::changePrecision(S32 decimal_precision) mCtrlBumpyOffsetV->setPrecision(decimal_precision); mCtrlShinyOffsetU->setPrecision(decimal_precision); mCtrlShinyOffsetV->setPrecision(decimal_precision); + mCtrlTexRot->setPrecision(decimal_precision); + mCtrlBumpyRot->setPrecision(decimal_precision); + mCtrlShinyRot->setPrecision(decimal_precision); + mCtrlRpt->setPrecision(decimal_precision); } //