diff options
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rw-r--r-- | indra/newview/llpanelface.cpp | 60 |
1 files changed, 44 insertions, 16 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index ee0426c7df..b50c6442e1 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -65,6 +65,7 @@ #include "llvovolume.h" #include "lluictrlfactory.h" #include "llpluginclassmedia.h" +#include "llviewertexturelist.h" // // Methods @@ -264,10 +265,13 @@ void LLPanelFace::sendAlpha() void LLPanelFace::sendGlow() { - LLSpinCtrl* mCtrlGlow = getChild<LLSpinCtrl>("glow"); - F32 glow = mCtrlGlow->get(); - - LLSelectMgr::getInstance()->selectionSetGlow( glow ); + LLSpinCtrl* mCtrlGlow = getChild<LLSpinCtrl>("glow"); + llassert(mCtrlGlow); + if (mCtrlGlow) + { + F32 glow = mCtrlGlow->get(); + LLSelectMgr::getInstance()->selectionSetGlow( glow ); + } } struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor @@ -285,6 +289,9 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor LLCheckBoxCtrl* checkFlipScaleS = mPanel->getChild<LLCheckBoxCtrl>("checkbox flip s"); LLCheckBoxCtrl* checkFlipScaleT = mPanel->getChild<LLCheckBoxCtrl>("checkbox flip t"); LLComboBox* comboTexGen = mPanel->getChild<LLComboBox>("combobox texgen"); + llassert(comboTexGen); + llassert(object); + if (ctrlTexScaleS) { valid = !ctrlTexScaleS->getTentative() || !checkFlipScaleS->getTentative(); @@ -295,7 +302,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor { value = -value; } - if (comboTexGen->getCurrentIndex() == 1) + if (comboTexGen && + comboTexGen->getCurrentIndex() == 1) { value *= 0.5f; } @@ -313,7 +321,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor { value = -value; } - if (comboTexGen->getCurrentIndex() == 1) + if (comboTexGen && + comboTexGen->getCurrentIndex() == 1) { value *= 0.5f; } @@ -406,14 +415,40 @@ void LLPanelFace::getState() LLUUID id; struct f1 : public LLSelectedTEGetFunctor<LLUUID> { - LLUUID get(LLViewerObject* object, S32 te) + LLUUID get(LLViewerObject* object, S32 te_index) { - LLViewerTexture* image = object->getTEImage(te); - return image ? image->getID() : LLUUID::null; + LLUUID id; + + LLViewerTexture* image = object->getTEImage(te_index); + if (image) id = image->getID(); + + if (!id.isNull() && LLViewerMedia::textureHasMedia(id)) + { + LLTextureEntry *te = object->getTE(te_index); + if (te) + { + LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID()) : NULL ; + if(!tex) + { + tex = LLViewerFetchedTexture::sDefaultImagep; + } + if (tex) + { + id = tex->getID(); + } + } + } + return id; } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id ); + if(LLViewerMedia::textureHasMedia(id)) + { + childSetEnabled("textbox autofix",editable); + childSetEnabled("button align",editable); + } + if (identical) { // All selected have the same texture @@ -444,13 +479,6 @@ void LLPanelFace::getState() } } } - - if(LLViewerMedia::textureHasMedia(id)) - { - childSetEnabled("textbox autofix",editable); - childSetEnabled("button align",editable); - } - } |