diff options
Diffstat (limited to 'linden/indra/newview/llpanelface.cpp')
-rw-r--r-- | linden/indra/newview/llpanelface.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/linden/indra/newview/llpanelface.cpp b/linden/indra/newview/llpanelface.cpp index 4742627..d1c34f1 100644 --- a/linden/indra/newview/llpanelface.cpp +++ b/linden/indra/newview/llpanelface.cpp | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "llpanelface.h" | 35 | #include "llpanelface.h" |
36 | 36 | ||
37 | // library includes | 37 | // library includes |
38 | #include "llcalc.h" | ||
38 | #include "llerror.h" | 39 | #include "llerror.h" |
39 | #include "llfocusmgr.h" | 40 | #include "llfocusmgr.h" |
40 | #include "llrect.h" | 41 | #include "llrect.h" |
@@ -60,6 +61,7 @@ | |||
60 | #include "llviewermedia.h" | 61 | #include "llviewermedia.h" |
61 | #include "llviewerobject.h" | 62 | #include "llviewerobject.h" |
62 | #include "llviewerstats.h" | 63 | #include "llviewerstats.h" |
64 | #include "llviewerwindow.h" | ||
63 | #include "lluictrlfactory.h" | 65 | #include "lluictrlfactory.h" |
64 | 66 | ||
65 | // | 67 | // |
@@ -179,6 +181,7 @@ BOOL LLPanelFace::postBuild() | |||
179 | childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureInfo, this); | 181 | childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureInfo, this); |
180 | childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureInfo, this); | 182 | childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureInfo, this); |
181 | childSetAction("button align",onClickAutoFix,this); | 183 | childSetAction("button align",onClickAutoFix,this); |
184 | childSetAction("texture_math_constants",onClickTextureConstants,this); | ||
182 | 185 | ||
183 | clearCtrls(); | 186 | clearCtrls(); |
184 | 187 | ||
@@ -381,6 +384,7 @@ void LLPanelFace::sendTextureInfo() | |||
381 | void LLPanelFace::getState() | 384 | void LLPanelFace::getState() |
382 | { | 385 | { |
383 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); | 386 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
387 | LLCalc* calcp = LLCalc::getInstance(); | ||
384 | 388 | ||
385 | if( objectp | 389 | if( objectp |
386 | && objectp->getPCode() == LL_PCODE_VOLUME | 390 | && objectp->getPCode() == LL_PCODE_VOLUME |
@@ -754,6 +758,16 @@ void LLPanelFace::getState() | |||
754 | childSetEnabled("button apply",enabled); | 758 | childSetEnabled("button apply",enabled); |
755 | } | 759 | } |
756 | } | 760 | } |
761 | childSetEnabled("texture_math_constants",true); | ||
762 | |||
763 | // Set variable values for numeric expressions | ||
764 | calcp->setVar(LLCalc::TEX_U_SCALE, childGetValue("TexScaleU").asReal()); | ||
765 | calcp->setVar(LLCalc::TEX_V_SCALE, childGetValue("TexScaleV").asReal()); | ||
766 | calcp->setVar(LLCalc::TEX_U_OFFSET, childGetValue("TexOffsetU").asReal()); | ||
767 | calcp->setVar(LLCalc::TEX_V_OFFSET, childGetValue("TexOffsetV").asReal()); | ||
768 | calcp->setVar(LLCalc::TEX_ROTATION, childGetValue("TexRot").asReal()); | ||
769 | calcp->setVar(LLCalc::TEX_TRANSPARENCY, childGetValue("ColorTrans").asReal()); | ||
770 | calcp->setVar(LLCalc::TEX_GLOW, childGetValue("glow").asReal()); | ||
757 | } | 771 | } |
758 | else | 772 | else |
759 | { | 773 | { |
@@ -787,6 +801,17 @@ void LLPanelFace::getState() | |||
787 | 801 | ||
788 | childSetEnabled("button align",FALSE); | 802 | childSetEnabled("button align",FALSE); |
789 | childSetEnabled("button apply",FALSE); | 803 | childSetEnabled("button apply",FALSE); |
804 | |||
805 | childSetEnabled("texture_math_constants",false); | ||
806 | |||
807 | // Set variable values for numeric expressions | ||
808 | calcp->clearVar(LLCalc::TEX_U_SCALE); | ||
809 | calcp->clearVar(LLCalc::TEX_V_SCALE); | ||
810 | calcp->clearVar(LLCalc::TEX_U_OFFSET); | ||
811 | calcp->clearVar(LLCalc::TEX_V_OFFSET); | ||
812 | calcp->clearVar(LLCalc::TEX_ROTATION); | ||
813 | calcp->clearVar(LLCalc::TEX_TRANSPARENCY); | ||
814 | calcp->clearVar(LLCalc::TEX_GLOW); | ||
790 | } | 815 | } |
791 | } | 816 | } |
792 | 817 | ||
@@ -969,3 +994,9 @@ void LLPanelFace::onClickAutoFix(void* userdata) | |||
969 | LLPanelFaceSendFunctor sendfunc; | 994 | LLPanelFaceSendFunctor sendfunc; |
970 | LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc); | 995 | LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc); |
971 | } | 996 | } |
997 | |||
998 | // static | ||
999 | void LLPanelFace::onClickTextureConstants(void *) | ||
1000 | { | ||
1001 | gViewerWindow->alertXml("ClickTextureConstants"); | ||
1002 | } \ No newline at end of file | ||