aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpanelface.cpp')
-rw-r--r--linden/indra/newview/llpanelface.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/linden/indra/newview/llpanelface.cpp b/linden/indra/newview/llpanelface.cpp
index b1a38e0..9754d2a 100644
--- a/linden/indra/newview/llpanelface.cpp
+++ b/linden/indra/newview/llpanelface.cpp
@@ -36,6 +36,7 @@
36#include "llpanelface.h" 36#include "llpanelface.h"
37 37
38// library includes 38// library includes
39#include "llcalc.h"
39#include "llerror.h" 40#include "llerror.h"
40#include "llfocusmgr.h" 41#include "llfocusmgr.h"
41#include "llrect.h" 42#include "llrect.h"
@@ -61,6 +62,7 @@
61#include "llviewermedia.h" 62#include "llviewermedia.h"
62#include "llviewerobject.h" 63#include "llviewerobject.h"
63#include "llviewerstats.h" 64#include "llviewerstats.h"
65#include "llviewerwindow.h"
64#include "lluictrlfactory.h" 66#include "lluictrlfactory.h"
65 67
66// 68//
@@ -180,6 +182,7 @@ BOOL LLPanelFace::postBuild()
180 childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureInfo, this); 182 childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureInfo, this);
181 childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureInfo, this); 183 childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureInfo, this);
182 childSetAction("button align",onClickAutoFix,this); 184 childSetAction("button align",onClickAutoFix,this);
185 childSetAction("texture_math_constants",onClickTextureConstants,this);
183 186
184 clearCtrls(); 187 clearCtrls();
185 188
@@ -382,6 +385,7 @@ void LLPanelFace::sendTextureInfo()
382void LLPanelFace::getState() 385void LLPanelFace::getState()
383{ 386{
384 LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); 387 LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
388 LLCalc* calcp = LLCalc::getInstance();
385 389
386 if( objectp 390 if( objectp
387 && objectp->getPCode() == LL_PCODE_VOLUME 391 && objectp->getPCode() == LL_PCODE_VOLUME
@@ -755,6 +759,16 @@ void LLPanelFace::getState()
755 childSetEnabled("button apply",enabled); 759 childSetEnabled("button apply",enabled);
756 } 760 }
757 } 761 }
762 childSetEnabled("texture_math_constants",true);
763
764 // Set variable values for numeric expressions
765 calcp->setVar(LLCalc::TEX_U_SCALE, childGetValue("TexScaleU").asReal());
766 calcp->setVar(LLCalc::TEX_V_SCALE, childGetValue("TexScaleV").asReal());
767 calcp->setVar(LLCalc::TEX_U_OFFSET, childGetValue("TexOffsetU").asReal());
768 calcp->setVar(LLCalc::TEX_V_OFFSET, childGetValue("TexOffsetV").asReal());
769 calcp->setVar(LLCalc::TEX_ROTATION, childGetValue("TexRot").asReal());
770 calcp->setVar(LLCalc::TEX_TRANSPARENCY, childGetValue("ColorTrans").asReal());
771 calcp->setVar(LLCalc::TEX_GLOW, childGetValue("glow").asReal());
758 } 772 }
759 else 773 else
760 { 774 {
@@ -790,6 +804,17 @@ void LLPanelFace::getState()
790 804
791 childSetEnabled("button align",FALSE); 805 childSetEnabled("button align",FALSE);
792 childSetEnabled("button apply",FALSE); 806 childSetEnabled("button apply",FALSE);
807
808 childSetEnabled("texture_math_constants",false);
809
810 // Set variable values for numeric expressions
811 calcp->clearVar(LLCalc::TEX_U_SCALE);
812 calcp->clearVar(LLCalc::TEX_V_SCALE);
813 calcp->clearVar(LLCalc::TEX_U_OFFSET);
814 calcp->clearVar(LLCalc::TEX_V_OFFSET);
815 calcp->clearVar(LLCalc::TEX_ROTATION);
816 calcp->clearVar(LLCalc::TEX_TRANSPARENCY);
817 calcp->clearVar(LLCalc::TEX_GLOW);
793 } 818 }
794} 819}
795 820
@@ -972,3 +997,9 @@ void LLPanelFace::onClickAutoFix(void* userdata)
972 LLPanelFaceSendFunctor sendfunc; 997 LLPanelFaceSendFunctor sendfunc;
973 LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc); 998 LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc);
974} 999}
1000
1001// static
1002void LLPanelFace::onClickTextureConstants(void *)
1003{
1004 gViewerWindow->alertXml("ClickTextureConstants");
1005}