diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 5559d72d2b4b38652d6a126ffc793330e234ed15..8870cbba60e09a96221497fc1f920e2b49616809 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -92,11 +92,8 @@ std::string USE_TEXTURE; LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit() { - LLComboBox* combobox_matmedia = getChild<LLComboBox>("combobox matmedia"); - LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); - - LLRender::eTexIndex channel_to_edit = (combobox_matmedia && combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? - (radio_mat_type ? (LLRender::eTexIndex)radio_mat_type->getSelectedIndex() : LLRender::DIFFUSE_MAP) : LLRender::DIFFUSE_MAP; + LLRender::eTexIndex channel_to_edit = (mComboMatMedia && mComboMatMedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? + (mRadioMatType ? (LLRender::eTexIndex)mRadioMatType->getSelectedIndex() : LLRender::DIFFUSE_MAP) : LLRender::DIFFUSE_MAP; channel_to_edit = (channel_to_edit == LLRender::NORMAL_MAP) ? (getCurrentNormalMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit; channel_to_edit = (channel_to_edit == LLRender::SPECULAR_MAP) ? (getCurrentSpecularMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit; @@ -105,24 +102,24 @@ LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit() // Things the UI provides... // -LLUUID LLPanelFace::getCurrentNormalMap() { return getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID(); } -LLUUID LLPanelFace::getCurrentSpecularMap() { return getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID(); } -U32 LLPanelFace::getCurrentShininess() { return getChild<LLComboBox>("combobox shininess")->getCurrentIndex(); } -U32 LLPanelFace::getCurrentBumpiness() { return getChild<LLComboBox>("combobox bumpiness")->getCurrentIndex(); } -U8 LLPanelFace::getCurrentDiffuseAlphaMode() { return (U8)getChild<LLComboBox>("combobox alphamode")->getCurrentIndex(); } -U8 LLPanelFace::getCurrentAlphaMaskCutoff() { return (U8)getChild<LLUICtrl>("maskcutoff")->getValue().asInteger(); } -U8 LLPanelFace::getCurrentEnvIntensity() { return (U8)getChild<LLUICtrl>("environment")->getValue().asInteger(); } -U8 LLPanelFace::getCurrentGlossiness() { return (U8)getChild<LLUICtrl>("glossiness")->getValue().asInteger(); } -F32 LLPanelFace::getCurrentBumpyRot() { return getChild<LLUICtrl>("bumpyRot")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyScaleU() { return getChild<LLUICtrl>("bumpyScaleU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyScaleV() { return getChild<LLUICtrl>("bumpyScaleV")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyOffsetU() { return getChild<LLUICtrl>("bumpyOffsetU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyOffsetV() { return getChild<LLUICtrl>("bumpyOffsetV")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyRot() { return getChild<LLUICtrl>("shinyRot")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyScaleU() { return getChild<LLUICtrl>("shinyScaleU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyScaleV() { return getChild<LLUICtrl>("shinyScaleV")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyOffsetU() { return getChild<LLUICtrl>("shinyOffsetU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyOffsetV() { return getChild<LLUICtrl>("shinyOffsetV")->getValue().asReal(); } +LLUUID LLPanelFace::getCurrentNormalMap() { return mBumpyTextureCtrl->getImageAssetID(); } +LLUUID LLPanelFace::getCurrentSpecularMap() { return mShinyTextureCtrl->getImageAssetID(); } +U32 LLPanelFace::getCurrentShininess() { return mComboShininess->getCurrentIndex(); } +U32 LLPanelFace::getCurrentBumpiness() { return mComboBumpiness->getCurrentIndex(); } +U8 LLPanelFace::getCurrentDiffuseAlphaMode() { return (U8)mComboAlphaMode->getCurrentIndex(); } +U8 LLPanelFace::getCurrentAlphaMaskCutoff() { return (U8)mSpinMaskCutoff->getValue().asInteger(); } +U8 LLPanelFace::getCurrentEnvIntensity() { return (U8)mSpinEnvironment->getValue().asInteger(); } +U8 LLPanelFace::getCurrentGlossiness() { return (U8)mSpinGlossiness->getValue().asInteger(); } +F32 LLPanelFace::getCurrentBumpyRot() { return getChild<LLUICtrl>("bumpyRot")->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyScaleU() { return getChild<LLUICtrl>("bumpyScaleU")->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyScaleV() { return getChild<LLUICtrl>("bumpyScaleV")->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyOffsetU() { return getChild<LLUICtrl>("bumpyOffsetU")->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyOffsetV() { return getChild<LLUICtrl>("bumpyOffsetV")->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyRot() { return getChild<LLUICtrl>("shinyRot")->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyScaleU() { return getChild<LLUICtrl>("shinyScaleU")->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyScaleV() { return getChild<LLUICtrl>("shinyScaleV")->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyOffsetU() { return getChild<LLUICtrl>("shinyOffsetU")->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyOffsetV() { return getChild<LLUICtrl>("shinyOffsetV")->getValue().asReal(); } // // Methods @@ -130,9 +127,15 @@ F32 LLPanelFace::getCurrentShinyOffsetV() { return getChild<LLUICtrl>("shinyOf BOOL LLPanelFace::postBuild() { - childSetCommitCallback("combobox shininess",&LLPanelFace::onCommitShiny,this); - childSetCommitCallback("combobox bumpiness",&LLPanelFace::onCommitBump,this); - childSetCommitCallback("combobox alphamode",&LLPanelFace::onCommitAlphaMode,this); + mComboShininess = getChild<LLComboBox>("combobox shininess"); + mComboShininess->setCommitCallback(std::bind(onCommitShiny, std::placeholders::_1, this)); + + mComboBumpiness = getChild<LLComboBox>("combobox bumpiness"); + mComboBumpiness->setCommitCallback(std::bind(onCommitBump, std::placeholders::_1, this)); + + mComboAlphaMode = getChild<LLComboBox>("combobox alphamode"); + mComboAlphaMode->setCommitCallback(std::bind(onCommitAlphaMode, std::placeholders::_1, this)); + childSetCommitCallback("TexScaleU",&LLPanelFace::onCommitTextureScaleX, this); childSetCommitCallback("TexScaleV",&LLPanelFace::onCommitTextureScaleY, this); childSetCommitCallback("TexRot",&LLPanelFace::onCommitTextureRot, this); @@ -151,33 +154,22 @@ BOOL LLPanelFace::postBuild() childSetCommitCallback("shinyRot",&LLPanelFace::onCommitMaterialShinyRot, this); childSetCommitCallback("shinyOffsetU",&LLPanelFace::onCommitMaterialShinyOffsetX, this); childSetCommitCallback("shinyOffsetV",&LLPanelFace::onCommitMaterialShinyOffsetY, this); - childSetCommitCallback("glossiness",&LLPanelFace::onCommitMaterialGloss, this); - childSetCommitCallback("environment",&LLPanelFace::onCommitMaterialEnv, this); - childSetCommitCallback("maskcutoff",&LLPanelFace::onCommitMaterialMaskCutoff, this); - childSetAction("button align",&LLPanelFace::onClickAutoFix,this); - childSetAction("button align textures", &LLPanelFace::onAlignTexture, this); + mSpinGlossiness = getChild<LLSpinCtrl>("glossiness"); + mSpinGlossiness->setCommitCallback(std::bind(onCommitMaterialGloss, std::placeholders::_1, this)); - LLTextureCtrl* mTextureCtrl; - LLTextureCtrl* mShinyTextureCtrl; - LLTextureCtrl* mBumpyTextureCtrl; - LLColorSwatchCtrl* mColorSwatch; - LLColorSwatchCtrl* mShinyColorSwatch; + mSpinEnvironment = getChild<LLSpinCtrl>("environment"); + mSpinEnvironment->setCommitCallback(std::bind(onCommitMaterialEnv, std::placeholders::_1, this)); - LLComboBox* mComboTexGen; - LLComboBox* mComboMatMedia; + mSpinMaskCutoff = getChild<LLSpinCtrl>("maskcutoff"); + mSpinMaskCutoff->setCommitCallback(std::bind(onCommitMaterialMaskCutoff, std::placeholders::_1, this)); - LLCheckBoxCtrl *mCheckFullbright; - - LLTextBox* mLabelColorTransp; - LLSpinCtrl* mCtrlColorTransp; // transparency = 1 - alpha - - LLSpinCtrl* mCtrlGlow; + childSetAction("button align",&LLPanelFace::onClickAutoFix,this); + childSetAction("button align textures", &LLPanelFace::onAlignTexture, this); setMouseOpaque(FALSE); mTextureCtrl = getChild<LLTextureCtrl>("texture control"); - if(mTextureCtrl) { mTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" ))); mTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitTexture, this, _2) ); @@ -194,7 +186,6 @@ BOOL LLPanelFace::postBuild() } mShinyTextureCtrl = getChild<LLTextureCtrl>("shinytexture control"); - if(mShinyTextureCtrl) { mShinyTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectSpecularTexture" ))); mShinyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitSpecularTexture, this, _2) ); @@ -211,7 +202,6 @@ BOOL LLPanelFace::postBuild() } mBumpyTextureCtrl = getChild<LLTextureCtrl>("bumpytexture control"); - if(mBumpyTextureCtrl) { mBumpyTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectNormalTexture" ))); mBumpyTextureCtrl->setBlankImageAssetID(LLUUID( gSavedSettings.getString( "DefaultBlankNormalTexture" ))); @@ -229,7 +219,6 @@ BOOL LLPanelFace::postBuild() } mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); - if(mColorSwatch) { mColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitColor, this, _2)); mColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelColor, this, _2)); @@ -240,7 +229,6 @@ BOOL LLPanelFace::postBuild() } mShinyColorSwatch = getChild<LLColorSwatchCtrl>("shinycolorswatch"); - if(mShinyColorSwatch) { mShinyColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitShinyColor, this, _2)); mShinyColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelShinyColor, this, _2)); @@ -251,14 +239,12 @@ BOOL LLPanelFace::postBuild() } mLabelColorTransp = getChild<LLTextBox>("color trans"); - if(mLabelColorTransp) { mLabelColorTransp->setFollowsTop(); mLabelColorTransp->setFollowsLeft(); } mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans"); - if(mCtrlColorTransp) { mCtrlColorTransp->setCommitCallback(boost::bind(&LLPanelFace::onCommitAlpha, this, _2)); mCtrlColorTransp->setPrecision(0); @@ -267,39 +253,33 @@ BOOL LLPanelFace::postBuild() } mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright"); - if (mCheckFullbright) { mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright, this); } mComboTexGen = getChild<LLComboBox>("combobox texgen"); - if(mComboTexGen) { mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen, this); mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); } mComboMatMedia = getChild<LLComboBox>("combobox matmedia"); - if(mComboMatMedia) { mComboMatMedia->setCommitCallback(LLPanelFace::onCommitMaterialsMedia,this); mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL); } - LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); - if(radio_mat_type) + mRadioMatType = getChild<LLRadioGroup>("radio_material_type"); { - radio_mat_type->setCommitCallback(LLPanelFace::onCommitMaterialType, this); - radio_mat_type->selectNthItem(MATTYPE_DIFFUSE); + mRadioMatType->setCommitCallback(LLPanelFace::onCommitMaterialType, this); + mRadioMatType->selectNthItem(MATTYPE_DIFFUSE); } mCtrlGlow = getChild<LLSpinCtrl>("glow"); - if(mCtrlGlow) { mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow, this); } - clearCtrls(); return TRUE; @@ -321,8 +301,6 @@ LLPanelFace::~LLPanelFace() void LLPanelFace::sendTexture() { - LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("texture control"); - if(!mTextureCtrl) return; if( !mTextureCtrl->getTentative() ) { // we grab the item id first, because we want to do a @@ -338,17 +316,16 @@ void LLPanelFace::sendTexture() void LLPanelFace::sendBump(U32 bumpiness) { - LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control"); if (bumpiness < BUMPY_TEXTURE) { LL_DEBUGS("Materials") << "clearing bumptexture control" << LL_ENDL; - bumpytexture_ctrl->clear(); - bumpytexture_ctrl->setImageAssetID(LLUUID()); + mBumpyTextureCtrl->clear(); + mBumpyTextureCtrl->setImageAssetID(LLUUID()); } updateBumpyControls(bumpiness == BUMPY_TEXTURE, true); - LLUUID current_normal_map = bumpytexture_ctrl->getImageAssetID(); + LLUUID current_normal_map = mBumpyTextureCtrl->getImageAssetID(); U8 bump = (U8) bumpiness & TEM_BUMP_MASK; @@ -366,20 +343,16 @@ void LLPanelFace::sendBump(U32 bumpiness) void LLPanelFace::sendTexGen() { - LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen"); - if(!mComboTexGen)return; U8 tex_gen = (U8) mComboTexGen->getCurrentIndex() << TEM_TEX_GEN_SHIFT; LLSelectMgr::getInstance()->selectionSetTexGen( tex_gen ); } void LLPanelFace::sendShiny(U32 shininess) { - LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("shinytexture control"); - if (shininess < SHINY_TEXTURE) -{ - texture_ctrl->clear(); - texture_ctrl->setImageAssetID(LLUUID()); + { + mShinyTextureCtrl->clear(); + mShinyTextureCtrl->setImageAssetID(LLUUID()); } LLUUID specmap = getCurrentSpecularMap(); @@ -398,26 +371,18 @@ void LLPanelFace::sendShiny(U32 shininess) void LLPanelFace::sendFullbright() { - LLCheckBoxCtrl* mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright"); - if(!mCheckFullbright)return; U8 fullbright = mCheckFullbright->get() ? TEM_FULLBRIGHT_MASK : 0; LLSelectMgr::getInstance()->selectionSetFullbright( fullbright ); } void LLPanelFace::sendColor() { - - LLColorSwatchCtrl* mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); - if(!mColorSwatch)return; - LLColor4 color = mColorSwatch->get(); - + const LLColor4& color = mColorSwatch->get(); LLSelectMgr::getInstance()->selectionSetColorOnly( color ); } void LLPanelFace::sendAlpha() { - LLSpinCtrl* mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans"); - if(!mCtrlColorTransp)return; F32 alpha = (100.f - mCtrlColorTransp->get()) / 100.f; LLSelectMgr::getInstance()->selectionSetAlphaOnly( alpha ); @@ -426,8 +391,6 @@ void LLPanelFace::sendAlpha() void LLPanelFace::sendGlow() { - LLSpinCtrl* mCtrlGlow = getChild<LLSpinCtrl>("glow"); - llassert(mCtrlGlow); if (mCtrlGlow) { F32 glow = mCtrlGlow->get(); @@ -443,9 +406,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor BOOL valid; F32 value; - LLRadioGroup * radio_mat_type = mPanel->getChild<LLRadioGroup>("radio_material_type"); std::string prefix; - switch (radio_mat_type->getSelectedIndex()) + switch (mPanel->mRadioMatType->getSelectedIndex()) { case MATTYPE_DIFFUSE: prefix = "Tex"; @@ -464,7 +426,6 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor LLSpinCtrl * ctrlTexOffsetT = mPanel->getChild<LLSpinCtrl>(prefix + "OffsetV"); LLSpinCtrl * ctrlTexRotation = mPanel->getChild<LLSpinCtrl>(prefix + "Rot"); - LLComboBox* comboTexGen = mPanel->getChild<LLComboBox>("combobox texgen"); LLCheckBoxCtrl* cb_planar_align = mPanel->getChild<LLCheckBoxCtrl>("checkbox planar align"); bool align_planar = (cb_planar_align && cb_planar_align->get()); @@ -477,8 +438,7 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor if (valid || align_planar) { value = ctrlTexScaleS->get(); - if (comboTexGen && - comboTexGen->getCurrentIndex() == 1) + if (mPanel->mComboTexGen && mPanel->mComboTexGen->getCurrentIndex() == 1) { value *= 0.5f; } @@ -502,8 +462,7 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor //{ // value = -value; //} - if (comboTexGen && - comboTexGen->getCurrentIndex() == 1) + if (mPanel->mComboTexGen && mPanel->mComboTexGen->getCurrentIndex() == 1) { value *= 0.5f; } @@ -785,8 +744,7 @@ void LLPanelFace::alignTestureLayer() bool identical_face = false; LLSelectedTE::getFace(last_face, identical_face); - LLRadioGroup * radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); - LLPanelFaceSetAlignedConcreteTEFunctor setfunc(this, last_face, static_cast<LLRender::eTexIndex>(radio_mat_type->getSelectedIndex())); + LLPanelFaceSetAlignedConcreteTEFunctor setfunc(this, last_face, static_cast<LLRender::eTexIndex>(mRadioMatType->getSelectedIndex())); LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc); } @@ -808,35 +766,19 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) // only turn on auto-adjust button if there is a media renderer and the media is loaded getChildView("button align")->setEnabled(editable); - LLComboBox* combobox_matmedia = getChild<LLComboBox>("combobox matmedia"); - if (combobox_matmedia) + if (mComboMatMedia->getCurrentIndex() < MATMEDIA_MATERIAL) { - if (combobox_matmedia->getCurrentIndex() < MATMEDIA_MATERIAL) - { - combobox_matmedia->selectNthItem(MATMEDIA_MATERIAL); - } + mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL); } - else - { - LL_WARNS() << "failed getChild for 'combobox matmedia'" << LL_ENDL; - } - getChildView("combobox matmedia")->setEnabled(editable); - LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); - if(radio_mat_type) - { - if (radio_mat_type->getSelectedIndex() < MATTYPE_DIFFUSE) - { - radio_mat_type->selectNthItem(MATTYPE_DIFFUSE); - } + mComboMatMedia->setEnabled(editable); - } - else + if (mRadioMatType->getSelectedIndex() < MATTYPE_DIFFUSE) { - LL_WARNS("Materials") << "failed getChild for 'radio_material_type'" << LL_ENDL; + mRadioMatType->selectNthItem(MATTYPE_DIFFUSE); } - getChildView("radio_material_type")->setEnabled(editable); + mRadioMatType->setEnabled(editable); getChildView("checkbox_sync_settings")->setEnabled(editable); childSetValue("checkbox_sync_settings", gSavedSettings.getBOOL("SyncMaterialSettings")); updateVisibility(); @@ -846,10 +788,6 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) bool identical_norm = false; bool identical_spec = false; - LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control"); - LLTextureCtrl* shinytexture_ctrl = getChild<LLTextureCtrl>("shinytexture control"); - LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control"); - LLUUID id; LLUUID normmap_id; LLUUID specmap_id; @@ -858,12 +796,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) { getChildView("color label")->setEnabled(editable); } - LLColorSwatchCtrl* mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); LLColor4 color = LLColor4::white; bool identical_color = false; - if(mColorSwatch) { LLSelectedTE::getColor(color, identical_color); LLColor4 prev_color = mColorSwatch->get(); @@ -880,8 +816,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) getChildView("color trans")->setEnabled(editable); F32 transparency = (1.f - color.mV[VALPHA]) * 100.f; - getChild<LLUICtrl>("ColorTrans")->setValue(editable ? transparency : 0); - getChildView("ColorTrans")->setEnabled(editable); + mCtrlColorTransp->setValue(editable ? transparency : 0); + mCtrlColorTransp->setEnabled(editable); // Specular map LLSelectedTEMaterial::getSpecularID(specmap_id, identical_spec); @@ -895,59 +831,57 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) shiny = specmap_id.isNull() ? shiny : SHINY_TEXTURE; - LLCtrlSelectionInterface* combobox_shininess = childGetSelectionInterface("combobox shininess"); + LLCtrlSelectionInterface* combobox_shininess = mComboShininess->getSelectionInterface(); if (combobox_shininess) { combobox_shininess->selectNthItem((S32)shiny); } getChildView("label shininess")->setEnabled(editable); - getChildView("combobox shininess")->setEnabled(editable); + mComboShininess->setEnabled(editable); getChildView("label glossiness")->setEnabled(editable); - getChildView("glossiness")->setEnabled(editable); + mSpinGlossiness->setEnabled(editable); getChildView("label environment")->setEnabled(editable); - getChildView("environment")->setEnabled(editable); + mSpinEnvironment->setEnabled(editable); getChildView("label shinycolor")->setEnabled(editable); - getChild<LLUICtrl>("combobox shininess")->setTentative(!identical_spec); - getChild<LLUICtrl>("glossiness")->setTentative(!identical_spec); - getChild<LLUICtrl>("environment")->setTentative(!identical_spec); - getChild<LLUICtrl>("shinycolorswatch")->setTentative(!identical_spec); - - LLColorSwatchCtrl* mShinyColorSwatch = getChild<LLColorSwatchCtrl>("shinycolorswatch"); - if(mShinyColorSwatch) - { + mComboShininess->setTentative(!identical_spec); + mSpinGlossiness->setTentative(!identical_spec); + mSpinEnvironment->setTentative(!identical_spec); + + { + mShinyColorSwatch->setTentative(!identical_spec); mShinyColorSwatch->setValid(editable); mShinyColorSwatch->setEnabled( editable ); mShinyColorSwatch->setCanApplyImmediately( editable ); } U8 bumpy = 0; - // Bumpy - { - bool identical_bumpy = false; - LLSelectedTE::getBumpmap(bumpy,identical_bumpy); + // Bumpy + { + bool identical_bumpy = false; + LLSelectedTE::getBumpmap(bumpy, identical_bumpy); - LLUUID norm_map_id = getCurrentNormalMap(); - LLCtrlSelectionInterface* combobox_bumpiness = childGetSelectionInterface("combobox bumpiness"); + LLUUID norm_map_id = getCurrentNormalMap(); + LLCtrlSelectionInterface* combobox_bumpiness = mComboBumpiness->getSelectionInterface(); - bumpy = norm_map_id.isNull() ? bumpy : BUMPY_TEXTURE; + bumpy = norm_map_id.isNull() ? bumpy : BUMPY_TEXTURE; - if (combobox_bumpiness) - { - combobox_bumpiness->selectNthItem((S32)bumpy); - } - else - { - LL_WARNS() << "failed childGetSelectionInterface for 'combobox bumpiness'" << LL_ENDL; - } + if (combobox_bumpiness) + { + combobox_bumpiness->selectNthItem((S32) bumpy); + } + else + { + LL_WARNS() << "failed childGetSelectionInterface for 'combobox bumpiness'" << LL_ENDL; + } - getChildView("combobox bumpiness")->setEnabled(editable); - getChild<LLUICtrl>("combobox bumpiness")->setTentative(!identical_bumpy); - getChildView("label bumpiness")->setEnabled(editable); - } + mComboBumpiness->setEnabled(editable); + mComboBumpiness->setTentative(!identical_bumpy); + getChildView("label bumpiness")->setEnabled(editable); + } // Texture { @@ -996,7 +930,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) // LLSelectedTEMaterial::getCurrentDiffuseAlphaMode(alpha_mode, identical_alpha_mode, mIsAlpha); - LLCtrlSelectionInterface* combobox_alphamode = childGetSelectionInterface("combobox alphamode"); + LLCtrlSelectionInterface* combobox_alphamode = mComboAlphaMode->getSelectionInterface(); if (combobox_alphamode) { //it is invalid to have any alpha mode other than blend if transparency is greater than zero ... @@ -1015,61 +949,55 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) updateAlphaControls(); - if (texture_ctrl) - { - if (identical_diffuse) - { - texture_ctrl->setTentative(FALSE); - texture_ctrl->setEnabled(editable); - texture_ctrl->setImageAssetID(id); - getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f); - getChildView("label alphamode")->setEnabled(editable && mIsAlpha); - getChildView("maskcutoff")->setEnabled(editable && mIsAlpha); - getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); - - texture_ctrl->setBakeTextureEnabled(TRUE); - } - else if (id.isNull()) - { - // None selected - texture_ctrl->setTentative(FALSE); - texture_ctrl->setEnabled(FALSE); - texture_ctrl->setImageAssetID(LLUUID::null); - getChildView("combobox alphamode")->setEnabled(FALSE); - getChildView("label alphamode")->setEnabled(FALSE); - getChildView("maskcutoff")->setEnabled(FALSE); - getChildView("label maskcutoff")->setEnabled(FALSE); - - texture_ctrl->setBakeTextureEnabled(false); - } - else - { - // Tentative: multiple selected with different textures - texture_ctrl->setTentative(TRUE); - texture_ctrl->setEnabled(editable); - texture_ctrl->setImageAssetID(id); - getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f); - getChildView("label alphamode")->setEnabled(editable && mIsAlpha); - getChildView("maskcutoff")->setEnabled(editable && mIsAlpha); - getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); - - texture_ctrl->setBakeTextureEnabled(TRUE); - } - - } - - if (shinytexture_ctrl) { - shinytexture_ctrl->setTentative( !identical_spec ); - shinytexture_ctrl->setEnabled( editable ); - shinytexture_ctrl->setImageAssetID( specmap_id ); - } + if (identical_diffuse) + { + mTextureCtrl->setTentative(FALSE); + mTextureCtrl->setEnabled(editable); + mTextureCtrl->setImageAssetID(id); + mComboAlphaMode->setEnabled(editable && mIsAlpha && transparency <= 0.f); + getChildView("label alphamode")->setEnabled(editable && mIsAlpha); + mSpinMaskCutoff->setEnabled(editable && mIsAlpha); + getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); + + mTextureCtrl->setBakeTextureEnabled(TRUE); + } + else if (id.isNull()) + { + // None selected + mTextureCtrl->setTentative(FALSE); + mTextureCtrl->setEnabled(FALSE); + mTextureCtrl->setImageAssetID(LLUUID::null); + mComboAlphaMode->setEnabled(FALSE); + getChildView("label alphamode")->setEnabled(FALSE); + mSpinMaskCutoff->setEnabled(FALSE); + getChildView("label maskcutoff")->setEnabled(FALSE); + + mTextureCtrl->setBakeTextureEnabled(false); + } + else + { + // Tentative: multiple selected with different textures + mTextureCtrl->setTentative(TRUE); + mTextureCtrl->setEnabled(editable); + mTextureCtrl->setImageAssetID(id); + mComboAlphaMode->setEnabled(editable && mIsAlpha && transparency <= 0.f); + getChildView("label alphamode")->setEnabled(editable && mIsAlpha); + mSpinMaskCutoff->setEnabled(editable && mIsAlpha); + getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); + + mTextureCtrl->setBakeTextureEnabled(TRUE); + } + } - if (bumpytexture_ctrl) { - bumpytexture_ctrl->setTentative( !identical_norm ); - bumpytexture_ctrl->setEnabled( editable ); - bumpytexture_ctrl->setImageAssetID( normmap_id ); + mShinyTextureCtrl->setTentative(!identical_spec); + mShinyTextureCtrl->setEnabled(editable); + mShinyTextureCtrl->setImageAssetID(specmap_id); + + mBumpyTextureCtrl->setTentative(!identical_norm); + mBumpyTextureCtrl->setEnabled(editable); + mBumpyTextureCtrl->setImageAssetID(normmap_id); } } @@ -1299,29 +1227,19 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) F32 glow = 0.f; bool identical_glow = false; LLSelectedTE::getGlow(glow,identical_glow); - getChild<LLUICtrl>("glow")->setValue(glow); - getChild<LLUICtrl>("glow")->setTentative(!identical_glow); - getChildView("glow")->setEnabled(editable); + mCtrlGlow->setValue(glow); + mCtrlGlow->setTentative(!identical_glow); + mCtrlGlow->setEnabled(editable); getChildView("glow label")->setEnabled(editable); } { - LLCtrlSelectionInterface* combobox_texgen = childGetSelectionInterface("combobox texgen"); - if (combobox_texgen) - { - // Maps from enum to combobox entry index - combobox_texgen->selectNthItem(((S32)selected_texgen) >> 1); - } - else - { - LL_WARNS() << "failed childGetSelectionInterface for 'combobox texgen'" << LL_ENDL; - } - - getChildView("combobox texgen")->setEnabled(editable); - getChild<LLUICtrl>("combobox texgen")->setTentative(!identical); - getChildView("tex gen")->setEnabled(editable); - - } + // Maps from enum to combobox entry index + mComboTexGen->selectNthItem(((S32) selected_texgen) >> 1); + mComboTexGen->setEnabled(editable); + mComboTexGen->setTentative(!identical); + getChildView("tex gen")->setEnabled(editable); + } { U8 fullbright_flag = 0; @@ -1329,9 +1247,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) LLSelectedTE::getFullbright(fullbright_flag,identical_fullbright); - getChild<LLUICtrl>("checkbox fullbright")->setValue((S32)(fullbright_flag != 0)); - getChildView("checkbox fullbright")->setEnabled(editable); - getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical_fullbright); + mCheckFullbright->setValue((S32)(fullbright_flag != 0)); + mCheckFullbright->setEnabled(editable); + mCheckFullbright->setTentative(!identical_fullbright); } // Repeats per meter @@ -1348,15 +1266,13 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) LLSelectedTEMaterial::getMaxNormalRepeats(repeats_norm, identical_norm_repeats); LLSelectedTEMaterial::getMaxSpecularRepeats(repeats_spec, identical_spec_repeats); - LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen"); - if (mComboTexGen) { S32 index = mComboTexGen ? mComboTexGen->getCurrentIndex() : 0; BOOL enabled = editable && (index != 1); BOOL identical_repeats = true; F32 repeats = 1.0f; - U32 material_type = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? radio_mat_type->getSelectedIndex() : MATTYPE_DIFFUSE; + U32 material_type = (mComboMatMedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? mRadioMatType->getSelectedIndex() : MATTYPE_DIFFUSE; LLSelectMgr::getInstance()->setTextureChannel(LLRender::eTexIndex(material_type)); switch (material_type) @@ -1414,8 +1330,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) LL_DEBUGS("Materials") << material->asLLSD() << LL_ENDL; // Alpha - LLCtrlSelectionInterface* combobox_alphamode = - childGetSelectionInterface("combobox alphamode"); + LLCtrlSelectionInterface* combobox_alphamode = mComboAlphaMode->getSelectionInterface(); if (combobox_alphamode) { U32 alpha_mode = material->getDiffuseAlphaMode(); @@ -1436,15 +1351,14 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) { LL_WARNS() << "failed childGetSelectionInterface for 'combobox alphamode'" << LL_ENDL; } - getChild<LLUICtrl>("maskcutoff")->setValue(material->getAlphaMaskCutoff()); + mSpinMaskCutoff->setValue(material->getAlphaMaskCutoff()); updateAlphaControls(); identical_planar_texgen = isIdenticalPlanarTexgen(); // Shiny (specular) F32 offset_x, offset_y, repeat_x, repeat_y, rot; - LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("shinytexture control"); - texture_ctrl->setImageAssetID(material->getSpecularID()); + mShinyTextureCtrl->setImageAssetID(material->getSpecularID()); if (!material->getSpecularID().isNull() && (shiny == SHINY_TEXTURE)) { @@ -1463,8 +1377,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) getChild<LLUICtrl>("shinyRot")->setValue(rot*RAD_TO_DEG); getChild<LLUICtrl>("shinyOffsetU")->setValue(offset_x); getChild<LLUICtrl>("shinyOffsetV")->setValue(offset_y); - getChild<LLUICtrl>("glossiness")->setValue(material->getSpecularLightExponent()); - getChild<LLUICtrl>("environment")->setValue(material->getEnvironmentIntensity()); + mSpinGlossiness->setValue(material->getSpecularLightExponent()); + mSpinEnvironment->setValue(material->getEnvironmentIntensity()); updateShinyControls(!material->getSpecularID().isNull(), true); } @@ -1474,17 +1388,15 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) // if (!material->getSpecularID().isNull()) { - LLColorSwatchCtrl* shiny_swatch = getChild<LLColorSwatchCtrl>("shinycolorswatch"); LLColor4 new_color = material->getSpecularLightColor(); - LLColor4 old_color = shiny_swatch->get(); + LLColor4 old_color = mShinyColorSwatch->get(); - shiny_swatch->setOriginal(new_color); - shiny_swatch->set(new_color, force_set_values || old_color != new_color || !editable); + mShinyColorSwatch->setOriginal(new_color); + mShinyColorSwatch->set(new_color, force_set_values || old_color != new_color || !editable); } // Bumpy (normal) - texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control"); - texture_ctrl->setImageAssetID(material->getNormalID()); + mBumpyTextureCtrl->setImageAssetID(material->getNormalID()); if (!material->getNormalID().isNull()) { @@ -1516,8 +1428,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) calcp->setVar(LLCalc::TEX_U_OFFSET, childGetValue("TexOffsetU").asReal()); calcp->setVar(LLCalc::TEX_V_OFFSET, childGetValue("TexOffsetV").asReal()); calcp->setVar(LLCalc::TEX_ROTATION, childGetValue("TexRot").asReal()); - calcp->setVar(LLCalc::TEX_TRANSPARENCY, childGetValue("ColorTrans").asReal()); - calcp->setVar(LLCalc::TEX_GLOW, childGetValue("glow").asReal()); + calcp->setVar(LLCalc::TEX_TRANSPARENCY, mCtrlColorTransp->getValue().asReal()); + calcp->setVar(LLCalc::TEX_GLOW, mCtrlGlow->getValue().asReal()); } else { @@ -1525,25 +1437,19 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) clearCtrls(); // Disable non-UICtrls - LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control"); - if(texture_ctrl) { - texture_ctrl->setImageAssetID( LLUUID::null ); - texture_ctrl->setEnabled( FALSE ); // this is a LLUICtrl, but we don't want it to have keyboard focus so we add it as a child, not a ctrl. -// texture_ctrl->setValid(FALSE); + mTextureCtrl->setImageAssetID(LLUUID::null); + mTextureCtrl->setEnabled( FALSE ); // this is a LLUICtrl, but we don't want it to have keyboard focus so we add it as a child, not a ctrl. +// mTextureCtrl->setValid(FALSE); } - LLColorSwatchCtrl* mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); - if(mColorSwatch) + { mColorSwatch->setEnabled( FALSE ); mColorSwatch->setFallbackImage(LLUI::getUIImage("locked_image.j2c") ); mColorSwatch->setValid(FALSE); } - LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); - if (radio_mat_type) - { - radio_mat_type->setSelectedIndex(0); - } + + mRadioMatType->setSelectedIndex(0); getChildView("color trans")->setEnabled(FALSE); getChildView("rptctrl")->setEnabled(FALSE); getChildView("tex gen")->setEnabled(FALSE); @@ -1592,7 +1498,7 @@ void LLPanelFace::onCommitColor(const LLSD& data) void LLPanelFace::onCommitShinyColor(const LLSD& data) { - LLSelectedTEMaterial::setSpecularLightColor(this, getChild<LLColorSwatchCtrl>("shinycolorswatch")->get()); + LLSelectedTEMaterial::setSpecularLightColor(this, mShinyColorSwatch->get()); } void LLPanelFace::onCommitAlpha(const LLSD& data) @@ -1618,7 +1524,7 @@ void LLPanelFace::onSelectColor(const LLSD& data) void LLPanelFace::onSelectShinyColor(const LLSD& data) { - LLSelectedTEMaterial::setSpecularLightColor(this, getChild<LLColorSwatchCtrl>("shinycolorswatch")->get()); + LLSelectedTEMaterial::setSpecularLightColor(this, mShinyColorSwatch->get()); LLSelectMgr::getInstance()->saveSelectedShinyColors(); } @@ -1637,22 +1543,13 @@ void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata) // static void LLPanelFace::updateVisibility() { - LLComboBox* combo_matmedia = getChild<LLComboBox>("combobox matmedia"); - LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); - LLComboBox* combo_shininess = getChild<LLComboBox>("combobox shininess"); - LLComboBox* combo_bumpiness = getChild<LLComboBox>("combobox bumpiness"); - if (!radio_mat_type || !combo_matmedia || !combo_shininess || !combo_bumpiness) - { - LL_WARNS("Materials") << "Combo box not found...exiting." << LL_ENDL; - return; - } - U32 materials_media = combo_matmedia->getCurrentIndex(); - U32 material_type = radio_mat_type->getSelectedIndex(); - bool show_media = (materials_media == MATMEDIA_MEDIA) && combo_matmedia->getEnabled(); - bool show_texture = (show_media || ((material_type == MATTYPE_DIFFUSE) && combo_matmedia->getEnabled())); - bool show_bumpiness = (!show_media) && (material_type == MATTYPE_NORMAL) && combo_matmedia->getEnabled(); - bool show_shininess = (!show_media) && (material_type == MATTYPE_SPECULAR) && combo_matmedia->getEnabled(); - getChildView("radio_material_type")->setVisible(!show_media); + U32 materials_media = mComboMatMedia->getCurrentIndex(); + U32 material_type = mRadioMatType->getSelectedIndex(); + bool show_media = (materials_media == MATMEDIA_MEDIA) && mComboMatMedia->getEnabled(); + bool show_texture = (show_media || ((material_type == MATTYPE_DIFFUSE) && mComboMatMedia->getEnabled())); + bool show_bumpiness = (!show_media) && (material_type == MATTYPE_NORMAL) && mComboMatMedia->getEnabled(); + bool show_shininess = (!show_media) && (material_type == MATTYPE_SPECULAR) && mComboMatMedia->getEnabled(); + mRadioMatType->setVisible(!show_media); // Media controls getChildView("media_info")->setVisible(show_media); @@ -1661,11 +1558,11 @@ void LLPanelFace::updateVisibility() getChildView("button align")->setVisible(show_media); // Diffuse texture controls - getChildView("texture control")->setVisible(show_texture && !show_media); + mTextureCtrl->setVisible(show_texture && !show_media); getChildView("label alphamode")->setVisible(show_texture && !show_media); - getChildView("combobox alphamode")->setVisible(show_texture && !show_media); + mComboAlphaMode->setVisible(show_texture && !show_media); getChildView("label maskcutoff")->setVisible(false); - getChildView("maskcutoff")->setVisible(false); + mSpinMaskCutoff->setVisible(false); if (show_texture && !show_media) { updateAlphaControls(); @@ -1677,15 +1574,15 @@ void LLPanelFace::updateVisibility() getChildView("TexOffsetV")->setVisible(show_texture); // Specular map controls - getChildView("shinytexture control")->setVisible(show_shininess); - getChildView("combobox shininess")->setVisible(show_shininess); + mShinyTextureCtrl->setVisible(show_shininess); + mComboShininess->setVisible(show_shininess); getChildView("label shininess")->setVisible(show_shininess); getChildView("label glossiness")->setVisible(false); - getChildView("glossiness")->setVisible(false); + mSpinGlossiness->setVisible(false); getChildView("label environment")->setVisible(false); - getChildView("environment")->setVisible(false); + mSpinEnvironment->setVisible(false); getChildView("label shinycolor")->setVisible(false); - getChildView("shinycolorswatch")->setVisible(false); + mShinyColorSwatch->setVisible(false); if (show_shininess) { updateShinyControls(); @@ -1701,8 +1598,8 @@ void LLPanelFace::updateVisibility() { updateBumpyControls(); } - getChildView("bumpytexture control")->setVisible(show_bumpiness); - getChildView("combobox bumpiness")->setVisible(show_bumpiness); + mBumpyTextureCtrl->setVisible(show_bumpiness); + mComboBumpiness->setVisible(show_bumpiness); getChildView("label bumpiness")->setVisible(show_bumpiness); getChildView("bumpyScaleU")->setVisible(show_bumpiness); getChildView("bumpyScaleV")->setVisible(show_bumpiness); @@ -1730,11 +1627,7 @@ void LLPanelFace::onCommitBump(LLUICtrl* ctrl, void* userdata) { LLPanelFace* self = (LLPanelFace*) userdata; - LLComboBox* mComboBumpiness = self->getChild<LLComboBox>("combobox bumpiness"); - if(!mComboBumpiness) - return; - - U32 bumpiness = mComboBumpiness->getCurrentIndex(); + U32 bumpiness = self->mComboBumpiness->getCurrentIndex(); self->sendBump(bumpiness); } @@ -1749,92 +1642,75 @@ void LLPanelFace::onCommitTexGen(LLUICtrl* ctrl, void* userdata) // static void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_shiny_combobox) { - LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("shinytexture control"); - LLUUID shiny_texture_ID = texture_ctrl->getImageAssetID(); + LLUUID shiny_texture_ID = mShinyTextureCtrl->getImageAssetID(); LL_DEBUGS("Materials") << "Shiny texture selected: " << shiny_texture_ID << LL_ENDL; - LLComboBox* comboShiny = getChild<LLComboBox>("combobox shininess"); - if(mess_with_shiny_combobox) { - if (!comboShiny) - { - return; - } if (!shiny_texture_ID.isNull() && is_setting_texture) { - if (!comboShiny->itemExists(USE_TEXTURE)) + if (!mComboShininess->itemExists(USE_TEXTURE)) { - comboShiny->add(USE_TEXTURE); + mComboShininess->add(USE_TEXTURE); } - comboShiny->setSimple(USE_TEXTURE); + mComboShininess->setSimple(USE_TEXTURE); } else { - if (comboShiny->itemExists(USE_TEXTURE)) + if (mComboShininess->itemExists(USE_TEXTURE)) { - comboShiny->remove(SHINY_TEXTURE); - comboShiny->selectFirstItem(); + mComboShininess->remove(SHINY_TEXTURE); + mComboShininess->selectFirstItem(); } } } else { - if (shiny_texture_ID.isNull() && comboShiny && comboShiny->itemExists(USE_TEXTURE)) + if (shiny_texture_ID.isNull() && mComboShininess->itemExists(USE_TEXTURE)) { - comboShiny->remove(SHINY_TEXTURE); - comboShiny->selectFirstItem(); + mComboShininess->remove(SHINY_TEXTURE); + mComboShininess->selectFirstItem(); } } - - LLComboBox* combo_matmedia = getChild<LLComboBox>("combobox matmedia"); - LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); - U32 materials_media = combo_matmedia->getCurrentIndex(); - U32 material_type = radio_mat_type->getSelectedIndex(); - bool show_media = (materials_media == MATMEDIA_MEDIA) && combo_matmedia->getEnabled(); - bool show_shininess = (!show_media) && (material_type == MATTYPE_SPECULAR) && combo_matmedia->getEnabled(); - U32 shiny_value = comboShiny->getCurrentIndex(); + U32 materials_media = mComboMatMedia->getCurrentIndex(); + U32 material_type = mRadioMatType->getSelectedIndex(); + bool show_media = (materials_media == MATMEDIA_MEDIA) && mComboMatMedia->getEnabled(); + bool show_shininess = (!show_media) && (material_type == MATTYPE_SPECULAR) && mComboMatMedia->getEnabled(); + U32 shiny_value = mComboShininess->getCurrentIndex(); bool show_shinyctrls = (shiny_value == SHINY_TEXTURE) && show_shininess; // Use texture getChildView("label glossiness")->setVisible(show_shinyctrls); - getChildView("glossiness")->setVisible(show_shinyctrls); + mSpinGlossiness->setVisible(show_shinyctrls); getChildView("label environment")->setVisible(show_shinyctrls); - getChildView("environment")->setVisible(show_shinyctrls); + mSpinEnvironment->setVisible(show_shinyctrls); getChildView("label shinycolor")->setVisible(show_shinyctrls); - getChildView("shinycolorswatch")->setVisible(show_shinyctrls); + mShinyColorSwatch->setVisible(show_shinyctrls); } // static void LLPanelFace::updateBumpyControls(bool is_setting_texture, bool mess_with_combobox) { - LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control"); - LLUUID bumpy_texture_ID = texture_ctrl->getImageAssetID(); + const LLUUID& bumpy_texture_ID = mBumpyTextureCtrl->getImageAssetID(); LL_DEBUGS("Materials") << "texture: " << bumpy_texture_ID << (mess_with_combobox ? "" : " do not") << " update combobox" << LL_ENDL; - LLComboBox* comboBumpy = getChild<LLComboBox>("combobox bumpiness"); - if (!comboBumpy) - { - return; - } if (mess_with_combobox) { - LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control"); - LLUUID bumpy_texture_ID = texture_ctrl->getImageAssetID(); + const LLUUID& bumpy_texture_ID = mBumpyTextureCtrl->getImageAssetID(); LL_DEBUGS("Materials") << "texture: " << bumpy_texture_ID << (mess_with_combobox ? "" : " do not") << " update combobox" << LL_ENDL; if (!bumpy_texture_ID.isNull() && is_setting_texture) { - if (!comboBumpy->itemExists(USE_TEXTURE)) + if (!mComboBumpiness->itemExists(USE_TEXTURE)) { - comboBumpy->add(USE_TEXTURE); + mComboBumpiness->add(USE_TEXTURE); } - comboBumpy->setSimple(USE_TEXTURE); + mComboBumpiness->setSimple(USE_TEXTURE); } else { - if (comboBumpy->itemExists(USE_TEXTURE)) + if (mComboBumpiness->itemExists(USE_TEXTURE)) { - comboBumpy->remove(BUMPY_TEXTURE); - comboBumpy->selectFirstItem(); + mComboBumpiness->remove(BUMPY_TEXTURE); + mComboBumpiness->selectFirstItem(); } } } @@ -1845,12 +1721,7 @@ void LLPanelFace::onCommitShiny(LLUICtrl* ctrl, void* userdata) { LLPanelFace* self = (LLPanelFace*) userdata; - - LLComboBox* mComboShininess = self->getChild<LLComboBox>("combobox shininess"); - if(!mComboShininess) - return; - - U32 shininess = mComboShininess->getCurrentIndex(); + U32 shininess = self->mComboShininess->getCurrentIndex(); self->sendShiny(shininess); } @@ -1858,33 +1729,17 @@ void LLPanelFace::onCommitShiny(LLUICtrl* ctrl, void* userdata) // static void LLPanelFace::updateAlphaControls() { - LLComboBox* comboAlphaMode = getChild<LLComboBox>("combobox alphamode"); - if (!comboAlphaMode) - { - return; - } - U32 alpha_value = comboAlphaMode->getCurrentIndex(); + U32 alpha_value = mComboAlphaMode->getCurrentIndex(); bool show_alphactrls = (alpha_value == ALPHAMODE_MASK); // Alpha masking - LLComboBox* combobox_matmedia = getChild<LLComboBox>("combobox matmedia"); - U32 mat_media = MATMEDIA_MATERIAL; - if (combobox_matmedia) - { - mat_media = combobox_matmedia->getCurrentIndex(); - } - - U32 mat_type = MATTYPE_DIFFUSE; - LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); - if(radio_mat_type) - { - mat_type = radio_mat_type->getSelectedIndex(); - } + U32 mat_media = mComboMatMedia->getCurrentIndex(); + U32 mat_type = mRadioMatType->getSelectedIndex(); show_alphactrls = show_alphactrls && (mat_media == MATMEDIA_MATERIAL); show_alphactrls = show_alphactrls && (mat_type == MATTYPE_DIFFUSE); getChildView("label maskcutoff")->setVisible(show_alphactrls); - getChildView("maskcutoff")->setVisible(show_alphactrls); + mSpinMaskCutoff->setVisible(show_alphactrls); } // static @@ -1945,8 +1800,7 @@ void LLPanelFace::onSelectTexture(const LLSD& data) bool identical_image_format = false; LLSelectedTE::getImageFormat(image_format, identical_image_format); - LLCtrlSelectionInterface* combobox_alphamode = - childGetSelectionInterface("combobox alphamode"); + LLCtrlSelectionInterface* combobox_alphamode = mComboAlphaMode->getSelectionInterface(); U32 alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; if (combobox_alphamode) @@ -1997,7 +1851,7 @@ void LLPanelFace::onCancelSpecularTexture(const LLSD& data) U8 shiny = 0; bool identical_shiny = false; LLSelectedTE::getShiny(shiny, identical_shiny); - LLUUID spec_map_id = getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID(); + LLUUID spec_map_id = mShinyTextureCtrl->getImageAssetID(); shiny = spec_map_id.isNull() ? shiny : SHINY_TEXTURE; sendShiny(shiny); } @@ -2007,7 +1861,7 @@ void LLPanelFace::onCancelNormalTexture(const LLSD& data) U8 bumpy = 0; bool identical_bumpy = false; LLSelectedTE::getBumpmap(bumpy, identical_bumpy); - LLUUID spec_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID(); + LLUUID spec_map_id = mBumpyTextureCtrl->getImageAssetID(); bumpy = spec_map_id.isNull() ? bumpy : BUMPY_TEXTURE; sendBump(bumpy); } @@ -2402,12 +2256,10 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata) LLPanelFace* self = (LLPanelFace*) userdata; LLUICtrl* repeats_ctrl = self->getChild<LLUICtrl>("rptctrl"); - LLComboBox* combo_matmedia = self->getChild<LLComboBox>("combobox matmedia"); - LLRadioGroup* radio_mat_type = self->getChild<LLRadioGroup>("radio_material_type"); - U32 materials_media = combo_matmedia->getCurrentIndex(); + U32 materials_media = self->mComboMatMedia->getCurrentIndex(); - U32 material_type = (materials_media == MATMEDIA_MATERIAL) ? radio_mat_type->getSelectedIndex() : 0; + U32 material_type = (materials_media == MATMEDIA_MATERIAL) ? self->mRadioMatType->getSelectedIndex() : 0; F32 repeats_per_meter = repeats_ctrl->getValue().asReal(); F32 obj_scale_s = 1.0f; diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 183ae8f410f202b15605a361aeda47e45ecb9eea..d7af8f06cbc052bb8f54885188c42494c33e0a36 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -47,6 +47,7 @@ class LLUICtrl; class LLViewerObject; class LLFloater; class LLMaterialID; +class LLRadioGroup; // Represents an edit for use in replicating the op across one or more materials in the selection set. // @@ -207,7 +208,31 @@ class LLPanelFace : public LLPanel static F32 valueGlow(LLViewerObject* object, S32 face); - +public: + LLTextureCtrl* mTextureCtrl = nullptr; + LLTextureCtrl* mShinyTextureCtrl = nullptr; + LLTextureCtrl* mBumpyTextureCtrl = nullptr; + LLColorSwatchCtrl* mColorSwatch = nullptr; + LLColorSwatchCtrl* mShinyColorSwatch = nullptr; + + LLComboBox* mComboTexGen = nullptr; + LLComboBox* mComboMatMedia = nullptr; + LLComboBox* mComboBumpiness = nullptr; + LLComboBox* mComboShininess = nullptr; + LLComboBox* mComboAlphaMode = nullptr; + + LLRadioGroup* mRadioMatType = nullptr; + + LLCheckBoxCtrl* mCheckFullbright = nullptr; + + LLTextBox* mLabelColorTransp = nullptr; + LLSpinCtrl* mCtrlColorTransp = nullptr; // transparency = 1 - alpha + + LLSpinCtrl* mCtrlGlow = nullptr; + + LLSpinCtrl* mSpinGlossiness = nullptr; + LLSpinCtrl* mSpinEnvironment = nullptr; + LLSpinCtrl* mSpinMaskCutoff = nullptr; private: diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 625ef8993e80a0a5c322275f5cac0b3a65c89e37..6b7d3bcab0d0f25d8473862943135b29908b75bd 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -88,63 +88,94 @@ const F32 DEFAULT_DENSITY = 1000.f; // "Features" Tab BOOL LLPanelVolume::postBuild() { + mLabelEditObject = getChild<LLTextBox>("edit_object"); + mLabelSelectSingle = getChild<LLTextBox>("select_single"); + + mCheckAnimesh = getChild<LLCheckBoxCtrl>("Animated Mesh Checkbox Ctrl"); + mCheckAnimesh->setCommitCallback(std::bind(&LLPanelVolume::onCommitAnimatedMeshCheckbox, this, std::placeholders::_1, this)); + // Flexible Objects Parameters { - childSetCommitCallback("Animated Mesh Checkbox Ctrl", boost::bind(&LLPanelVolume::onCommitAnimatedMeshCheckbox, this, _1, _2), NULL); - childSetCommitCallback("Flexible1D Checkbox Ctrl", boost::bind(&LLPanelVolume::onCommitIsFlexible, this, _1, _2), NULL); - childSetCommitCallback("FlexNumSections",onCommitFlexible,this); - getChild<LLUICtrl>("FlexNumSections")->setValidateBeforeCommit(precommitValidate); - childSetCommitCallback("FlexGravity",onCommitFlexible,this); - getChild<LLUICtrl>("FlexGravity")->setValidateBeforeCommit(precommitValidate); - childSetCommitCallback("FlexFriction",onCommitFlexible,this); - getChild<LLUICtrl>("FlexFriction")->setValidateBeforeCommit(precommitValidate); - childSetCommitCallback("FlexWind",onCommitFlexible,this); - getChild<LLUICtrl>("FlexWind")->setValidateBeforeCommit(precommitValidate); - childSetCommitCallback("FlexTension",onCommitFlexible,this); - getChild<LLUICtrl>("FlexTension")->setValidateBeforeCommit(precommitValidate); - childSetCommitCallback("FlexForceX",onCommitFlexible,this); - getChild<LLUICtrl>("FlexForceX")->setValidateBeforeCommit(precommitValidate); - childSetCommitCallback("FlexForceY",onCommitFlexible,this); - getChild<LLUICtrl>("FlexForceY")->setValidateBeforeCommit(precommitValidate); - childSetCommitCallback("FlexForceZ",onCommitFlexible,this); - getChild<LLUICtrl>("FlexForceZ")->setValidateBeforeCommit(precommitValidate); + mCheckFlexible1D = getChild<LLCheckBoxCtrl>("Flexible1D Checkbox Ctrl"); + mCheckFlexible1D->setCommitCallback(std::bind(&LLPanelVolume::onCommitIsFlexible, this, std::placeholders::_1, this)); + + mSpinSections = getChild<LLSpinCtrl>("FlexNumSections"); + mSpinSections->setValidateBeforeCommit(precommitValidate); + mSpinSections->setCommitCallback(std::bind(onCommitFlexible, std::placeholders::_1, this)); + + mSpinGravity = getChild<LLSpinCtrl>("FlexGravity"); + mSpinGravity->setValidateBeforeCommit(precommitValidate); + mSpinGravity->setCommitCallback(std::bind(onCommitFlexible, std::placeholders::_1, this)); + + mSpinTension = getChild<LLSpinCtrl>("FlexTension"); + mSpinTension->setValidateBeforeCommit(precommitValidate); + mSpinTension->setCommitCallback(std::bind(onCommitFlexible, std::placeholders::_1, this)); + + mSpinFriction = getChild<LLSpinCtrl>("FlexFriction"); + mSpinFriction->setValidateBeforeCommit(precommitValidate); + mSpinFriction->setCommitCallback(std::bind(onCommitFlexible, std::placeholders::_1, this)); + + mSpinWind = getChild<LLSpinCtrl>("FlexWind"); + mSpinWind->setValidateBeforeCommit(precommitValidate); + mSpinWind->setCommitCallback(std::bind(onCommitFlexible, std::placeholders::_1, this)); + + mSpinForceX = getChild<LLSpinCtrl>("FlexForceX"); + mSpinForceX->setValidateBeforeCommit(precommitValidate); + mSpinForceX->setCommitCallback(std::bind(onCommitFlexible, std::placeholders::_1, this)); + + mSpinForceY = getChild<LLSpinCtrl>("FlexForceY"); + mSpinForceY->setValidateBeforeCommit(precommitValidate); + mSpinForceY->setCommitCallback(std::bind(onCommitFlexible, std::placeholders::_1, this)); + + mSpinForceZ = getChild<LLSpinCtrl>("FlexForceZ"); + mSpinForceZ->setValidateBeforeCommit(precommitValidate); + mSpinForceZ->setCommitCallback(std::bind(onCommitFlexible, std::placeholders::_1, this)); } // LIGHT Parameters { - childSetCommitCallback("Light Checkbox Ctrl",onCommitIsLight,this); - LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); - if(LightColorSwatch){ - LightColorSwatch->setOnCancelCallback(boost::bind(&LLPanelVolume::onLightCancelColor, this, _2)); - LightColorSwatch->setOnSelectCallback(boost::bind(&LLPanelVolume::onLightSelectColor, this, _2)); - childSetCommitCallback("colorswatch",onCommitLight,this); - } - - LLTextureCtrl* LightTexPicker = getChild<LLTextureCtrl>("light texture control"); - if (LightTexPicker) - { - LightTexPicker->setOnCancelCallback(boost::bind(&LLPanelVolume::onLightCancelTexture, this, _2)); - LightTexPicker->setOnSelectCallback(boost::bind(&LLPanelVolume::onLightSelectTexture, this, _2)); - childSetCommitCallback("light texture control", onCommitLight, this); - } - - childSetCommitCallback("Light Intensity",onCommitLight,this); - getChild<LLUICtrl>("Light Intensity")->setValidateBeforeCommit(precommitValidate); - childSetCommitCallback("Light Radius",onCommitLight,this); - getChild<LLUICtrl>("Light Radius")->setValidateBeforeCommit(precommitValidate); - childSetCommitCallback("Light Falloff",onCommitLight,this); - getChild<LLUICtrl>("Light Falloff")->setValidateBeforeCommit(precommitValidate); - - childSetCommitCallback("Light FOV", onCommitLight, this); - getChild<LLUICtrl>("Light FOV")->setValidateBeforeCommit( precommitValidate); - childSetCommitCallback("Light Focus", onCommitLight, this); - getChild<LLUICtrl>("Light Focus")->setValidateBeforeCommit( precommitValidate); - childSetCommitCallback("Light Ambiance", onCommitLight, this); - getChild<LLUICtrl>("Light Ambiance")->setValidateBeforeCommit( precommitValidate); + mCheckLight = getChild<LLCheckBoxCtrl>("Light Checkbox Ctrl"); + mCheckLight->setCommitCallback(std::bind(onCommitIsLight, std::placeholders::_1, this)); + + mLightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); + mLightColorSwatch->setOnCancelCallback(std::bind(&LLPanelVolume::onLightCancelColor, this, std::placeholders::_2)); + mLightColorSwatch->setOnSelectCallback(std::bind(&LLPanelVolume::onLightSelectColor, this, std::placeholders::_2)); + mLightColorSwatch->setCommitCallback(std::bind(onCommitLight, std::placeholders::_1, this)); + + mLightTextureCtrl = getChild<LLTextureCtrl>("light texture control"); + mLightTextureCtrl->setOnCancelCallback(boost::bind(&LLPanelVolume::onLightCancelTexture, this, _2)); + mLightTextureCtrl->setOnSelectCallback(boost::bind(&LLPanelVolume::onLightSelectTexture, this, _2)); + mLightTextureCtrl->setCommitCallback(std::bind(onCommitLight, std::placeholders::_1, this)); + + mLightIntensity = getChild<LLSpinCtrl>("Light Intensity"); + mLightIntensity->setValidateBeforeCommit(precommitValidate); + mLightIntensity->setCommitCallback(std::bind(onCommitLight, std::placeholders::_1, this)); + + mLightRadius = getChild<LLSpinCtrl>("Light Radius"); + mLightRadius->setValidateBeforeCommit(precommitValidate); + mLightRadius->setCommitCallback(std::bind(onCommitLight, std::placeholders::_1, this)); + + mLightFalloff = getChild<LLSpinCtrl>("Light Falloff"); + mLightFalloff->setValidateBeforeCommit(precommitValidate); + mLightFalloff->setCommitCallback(std::bind(onCommitLight, std::placeholders::_1, this)); + + mLightFOV = getChild<LLSpinCtrl>("Light FOV"); + mLightFOV->setValidateBeforeCommit(precommitValidate); + mLightFOV->setCommitCallback(std::bind(onCommitLight, std::placeholders::_1, this)); + + mLightFocus = getChild<LLSpinCtrl>("Light Focus"); + mLightFocus->setValidateBeforeCommit(precommitValidate); + mLightFocus->setCommitCallback(std::bind(onCommitLight, std::placeholders::_1, this)); + + mLightAmbiance = getChild<LLSpinCtrl>("Light Ambiance"); + mLightAmbiance->setValidateBeforeCommit(precommitValidate); + mLightAmbiance->setCommitCallback(std::bind(onCommitLight, std::placeholders::_1, this)); } // PHYSICS Parameters { + mLabelPhysicsShapeType = getChild<LLTextBox>("label physicsshapetype"); + // PhysicsShapeType combobox mComboPhysicsShapeType = getChild<LLComboBox>("Physics Shape Type Combo Ctrl"); mComboPhysicsShapeType->setCommitCallback(boost::bind(&LLPanelVolume::sendPhysicsShapeType, this, _1, mComboPhysicsShapeType)); @@ -180,7 +211,7 @@ BOOL LLPanelVolume::postBuild() // material type popup mComboMaterial = getChild<LLComboBox>("material"); - childSetCommitCallback("material",onCommitMaterial,this); + mComboMaterial->setCommitCallback(std::bind(onCommitMaterial, std::placeholders::_1, this)); mComboMaterial->removeall(); for (LLMaterialTable::info_list_t::iterator iter = LLMaterialTable::basic.mMaterialInfoList.begin(); @@ -276,91 +307,77 @@ void LLPanelVolume::getState( ) // Select Single Message if (single_volume) { - getChildView("edit_object")->setVisible(true); - getChildView("edit_object")->setEnabled(true); - getChildView("select_single")->setVisible(false); + mLabelEditObject->setVisible(true); + mLabelEditObject->setEnabled(true); + mLabelSelectSingle->setVisible(false); } else { - getChildView("edit_object")->setVisible(false); - getChildView("select_single")->setVisible(true); - getChildView("select_single")->setEnabled(true); + mLabelEditObject->setVisible(false); + mLabelSelectSingle->setVisible(true); + mLabelSelectSingle->setEnabled(true); } // Light properties BOOL is_light = volobjp && volobjp->getIsLight(); - getChild<LLUICtrl>("Light Checkbox Ctrl")->setValue(is_light); - getChildView("Light Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); + mCheckLight->setValue(is_light); + mCheckLight->setEnabled(editable && single_volume && volobjp); if (is_light && editable && single_volume) { //mLabelColor ->setEnabled( TRUE ); - LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); - if(LightColorSwatch) - { - LightColorSwatch->setEnabled( TRUE ); - LightColorSwatch->setValid( TRUE ); - LightColorSwatch->set(volobjp->getLightSRGBBaseColor()); - } - LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control"); - if (LightTextureCtrl) - { - LightTextureCtrl->setEnabled(TRUE); - LightTextureCtrl->setValid(TRUE); - LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID()); - } + mLightColorSwatch->setEnabled( TRUE ); + mLightColorSwatch->setValid( TRUE ); + mLightColorSwatch->set(volobjp->getLightSRGBBaseColor()); + + mLightTextureCtrl->setEnabled(TRUE); + mLightTextureCtrl->setValid(TRUE); + mLightTextureCtrl->setImageAssetID(volobjp->getLightTextureID()); - getChildView("Light Intensity")->setEnabled(true); - getChildView("Light Radius")->setEnabled(true); - getChildView("Light Falloff")->setEnabled(true); + mLightIntensity->setEnabled(true); + mLightRadius->setEnabled(true); + mLightFalloff->setEnabled(true); - getChildView("Light FOV")->setEnabled(true); - getChildView("Light Focus")->setEnabled(true); - getChildView("Light Ambiance")->setEnabled(true); + mLightFOV->setEnabled(true); + mLightFocus->setEnabled(true); + mLightAmbiance->setEnabled(true); - getChild<LLUICtrl>("Light Intensity")->setValue(volobjp->getLightIntensity()); - getChild<LLUICtrl>("Light Radius")->setValue(volobjp->getLightRadius()); - getChild<LLUICtrl>("Light Falloff")->setValue(volobjp->getLightFalloff()); + mLightIntensity->setValue(volobjp->getLightIntensity()); + mLightRadius->setValue(volobjp->getLightRadius()); + mLightFalloff->setValue(volobjp->getLightFalloff()); LLVector3 params = volobjp->getSpotLightParams(); - getChild<LLUICtrl>("Light FOV")->setValue(params.mV[0]); - getChild<LLUICtrl>("Light Focus")->setValue(params.mV[1]); - getChild<LLUICtrl>("Light Ambiance")->setValue(params.mV[2]); + mLightFOV->setValue(params.mV[0]); + mLightFocus->setValue(params.mV[1]); + mLightAmbiance->setValue(params.mV[2]); mLightSavedColor = volobjp->getLightSRGBBaseColor(); } else { - getChild<LLSpinCtrl>("Light Intensity", true)->clear(); - getChild<LLSpinCtrl>("Light Radius", true)->clear(); - getChild<LLSpinCtrl>("Light Falloff", true)->clear(); + mLightIntensity->clear(); + mLightRadius->clear(); + mLightFalloff->clear(); - LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); - if(LightColorSwatch) - { - LightColorSwatch->setEnabled( FALSE ); - LightColorSwatch->setValid( FALSE ); - } - LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control"); - if (LightTextureCtrl) - { - LightTextureCtrl->setEnabled(FALSE); - LightTextureCtrl->setValid(FALSE); - } + mLightColorSwatch->setEnabled( FALSE ); + mLightColorSwatch->setValid( FALSE ); + + mLightTextureCtrl->setEnabled(FALSE); + mLightTextureCtrl->setValid(FALSE); - getChildView("Light Intensity")->setEnabled(false); - getChildView("Light Radius")->setEnabled(false); - getChildView("Light Falloff")->setEnabled(false); + mLightIntensity->setEnabled(false); + mLightRadius->setEnabled(false); + mLightFalloff->setEnabled(false); - getChildView("Light FOV")->setEnabled(false); - getChildView("Light Focus")->setEnabled(false); - getChildView("Light Ambiance")->setEnabled(false); + mLightFOV->setEnabled(false); + mLightFocus->setEnabled(false); + mLightAmbiance->setEnabled(false); } // Animated Mesh BOOL is_animated_mesh = single_root_volume && root_volobjp && root_volobjp->isAnimatedObject(); - getChild<LLUICtrl>("Animated Mesh Checkbox Ctrl")->setValue(is_animated_mesh); + mCheckAnimesh->setValue(is_animated_mesh); BOOL enabled_animated_object_box = FALSE; if (root_volobjp && root_volobjp == volobjp) { @@ -384,7 +401,7 @@ void LLPanelVolume::getState( ) enabled_animated_object_box = false; } } - getChildView("Animated Mesh Checkbox Ctrl")->setEnabled(enabled_animated_object_box); + mCheckAnimesh->setEnabled(enabled_animated_object_box); //refresh any bakes if (root_volobjp) @@ -392,10 +409,8 @@ void LLPanelVolume::getState( ) root_volobjp->refreshBakeTexture(); LLViewerObject::const_child_list_t& child_list = root_volobjp->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); ++iter) + for (LLViewerObject* objectp : child_list) { - LLViewerObject* objectp = *iter; if (objectp) { objectp->refreshBakeTexture(); @@ -411,65 +426,65 @@ void LLPanelVolume::getState( ) // Flexible properties BOOL is_flexible = volobjp && volobjp->isFlexible(); - getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(is_flexible); + mCheckFlexible1D->setValue(is_flexible); if (is_flexible || (volobjp && volobjp->canBeFlexible())) { - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh() && !objectp->isPermanentEnforced()); + mCheckFlexible1D->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh() && !objectp->isPermanentEnforced()); } else { - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); + mCheckFlexible1D->setEnabled(false); } if (is_flexible && editable && single_volume) { - getChildView("FlexNumSections")->setVisible(true); - getChildView("FlexGravity")->setVisible(true); - getChildView("FlexTension")->setVisible(true); - getChildView("FlexFriction")->setVisible(true); - getChildView("FlexWind")->setVisible(true); - getChildView("FlexForceX")->setVisible(true); - getChildView("FlexForceY")->setVisible(true); - getChildView("FlexForceZ")->setVisible(true); - - getChildView("FlexNumSections")->setEnabled(true); - getChildView("FlexGravity")->setEnabled(true); - getChildView("FlexTension")->setEnabled(true); - getChildView("FlexFriction")->setEnabled(true); - getChildView("FlexWind")->setEnabled(true); - getChildView("FlexForceX")->setEnabled(true); - getChildView("FlexForceY")->setEnabled(true); - getChildView("FlexForceZ")->setEnabled(true); + mSpinSections->setVisible(true); + mSpinGravity->setVisible(true); + mSpinTension->setVisible(true); + mSpinFriction->setVisible(true); + mSpinWind->setVisible(true); + mSpinForceX->setVisible(true); + mSpinForceY->setVisible(true); + mSpinForceZ->setVisible(true); + + mSpinSections->setEnabled(true); + mSpinGravity->setEnabled(true); + mSpinTension->setEnabled(true); + mSpinFriction->setEnabled(true); + mSpinWind->setEnabled(true); + mSpinForceX->setEnabled(true); + mSpinForceY->setEnabled(true); + mSpinForceZ->setEnabled(true); LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getFlexibleObjectData(); - getChild<LLUICtrl>("FlexNumSections")->setValue((F32)attributes->getSimulateLOD()); - getChild<LLUICtrl>("FlexGravity")->setValue(attributes->getGravity()); - getChild<LLUICtrl>("FlexTension")->setValue(attributes->getTension()); - getChild<LLUICtrl>("FlexFriction")->setValue(attributes->getAirFriction()); - getChild<LLUICtrl>("FlexWind")->setValue(attributes->getWindSensitivity()); - getChild<LLUICtrl>("FlexForceX")->setValue(attributes->getUserForce().mV[VX]); - getChild<LLUICtrl>("FlexForceY")->setValue(attributes->getUserForce().mV[VY]); - getChild<LLUICtrl>("FlexForceZ")->setValue(attributes->getUserForce().mV[VZ]); + mSpinSections->setValue((F32) attributes->getSimulateLOD()); + mSpinGravity->setValue(attributes->getGravity()); + mSpinTension->setValue(attributes->getTension()); + mSpinFriction->setValue(attributes->getAirFriction()); + mSpinWind->setValue(attributes->getWindSensitivity()); + mSpinForceX->setValue(attributes->getUserForce().mV[VX]); + mSpinForceY->setValue(attributes->getUserForce().mV[VY]); + mSpinForceZ->setValue(attributes->getUserForce().mV[VZ]); } else { - getChild<LLSpinCtrl>("FlexNumSections", true)->clear(); - getChild<LLSpinCtrl>("FlexGravity", true)->clear(); - getChild<LLSpinCtrl>("FlexTension", true)->clear(); - getChild<LLSpinCtrl>("FlexFriction", true)->clear(); - getChild<LLSpinCtrl>("FlexWind", true)->clear(); - getChild<LLSpinCtrl>("FlexForceX", true)->clear(); - getChild<LLSpinCtrl>("FlexForceY", true)->clear(); - getChild<LLSpinCtrl>("FlexForceZ", true)->clear(); - - getChildView("FlexNumSections")->setEnabled(false); - getChildView("FlexGravity")->setEnabled(false); - getChildView("FlexTension")->setEnabled(false); - getChildView("FlexFriction")->setEnabled(false); - getChildView("FlexWind")->setEnabled(false); - getChildView("FlexForceX")->setEnabled(false); - getChildView("FlexForceY")->setEnabled(false); - getChildView("FlexForceZ")->setEnabled(false); + mSpinSections->clear(); + mSpinGravity->clear(); + mSpinTension->clear(); + mSpinFriction->clear(); + mSpinWind->clear(); + mSpinForceX->clear(); + mSpinForceY->clear(); + mSpinForceZ->clear(); + + mSpinSections->setEnabled(false); + mSpinGravity->setEnabled(false); + mSpinTension->setEnabled(false); + mSpinFriction->setEnabled(false); + mSpinWind->setEnabled(false); + mSpinForceX->setEnabled(false); + mSpinForceY->setEnabled(false); + mSpinForceZ->setEnabled(false); } // Material properties @@ -587,10 +602,10 @@ void LLPanelVolume::refresh() BOOL visible = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 0 ? TRUE : FALSE; - getChildView("Light FOV")->setVisible( visible); - getChildView("Light Focus")->setVisible( visible); - getChildView("Light Ambiance")->setVisible( visible); - getChildView("light texture control")->setVisible( visible); + mLightFOV->setVisible(visible); + mLightFocus->setVisible(visible); + mLightAmbiance->setVisible(visible); + mLightTextureCtrl->setVisible( visible); bool enable_mesh = false; @@ -602,12 +617,12 @@ void LLPanelVolume::refresh() region->getSimulatorFeatures(sim_features); enable_mesh = sim_features.has("PhysicsShapeTypes"); } - getChildView("label physicsshapetype")->setVisible(enable_mesh); - getChildView("Physics Shape Type Combo Ctrl")->setVisible(enable_mesh); - getChildView("Physics Gravity")->setVisible(enable_mesh); - getChildView("Physics Friction")->setVisible(enable_mesh); - getChildView("Physics Density")->setVisible(enable_mesh); - getChildView("Physics Restitution")->setVisible(enable_mesh); + mLabelPhysicsShapeType->setVisible(enable_mesh); + mComboPhysicsShapeType->setVisible(enable_mesh); + mSpinPhysicsGravity->setVisible(enable_mesh); + mSpinPhysicsFriction->setVisible(enable_mesh); + mSpinPhysicsDensity->setVisible(enable_mesh); + mSpinPhysicsRestitution->setVisible(enable_mesh); /* TODO: add/remove individual physics shape types as per the PhysicsShapeTypes simulator features */ } @@ -623,38 +638,34 @@ void LLPanelVolume::clearCtrls() { LLPanel::clearCtrls(); - getChildView("select_single")->setEnabled(false); - getChildView("select_single")->setVisible(true); - getChildView("edit_object")->setEnabled(false); - getChildView("edit_object")->setVisible(false); - getChildView("Light Checkbox Ctrl")->setEnabled(false);; - LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); - if(LightColorSwatch) - { - LightColorSwatch->setEnabled( FALSE ); - LightColorSwatch->setValid( FALSE ); - } - LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control"); - if(LightTextureCtrl) - { - LightTextureCtrl->setEnabled( FALSE ); - LightTextureCtrl->setValid( FALSE ); - } - - getChildView("Light Intensity")->setEnabled(false); - getChildView("Light Radius")->setEnabled(false); - getChildView("Light Falloff")->setEnabled(false); - - getChildView("Animated Mesh Checkbox Ctrl")->setEnabled(false); - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); - getChildView("FlexNumSections")->setEnabled(false); - getChildView("FlexGravity")->setEnabled(false); - getChildView("FlexTension")->setEnabled(false); - getChildView("FlexFriction")->setEnabled(false); - getChildView("FlexWind")->setEnabled(false); - getChildView("FlexForceX")->setEnabled(false); - getChildView("FlexForceY")->setEnabled(false); - getChildView("FlexForceZ")->setEnabled(false); + mLabelSelectSingle->setEnabled(false); + mLabelSelectSingle->setVisible(true); + mLabelEditObject->setEnabled(false); + mLabelEditObject->setVisible(false); + mCheckLight->setEnabled(false); + + mLightColorSwatch->setEnabled( FALSE ); + mLightColorSwatch->setValid( FALSE ); + mLightTextureCtrl->setEnabled( FALSE ); + mLightTextureCtrl->setValid( FALSE ); + + mLightIntensity->setEnabled(false); + mLightRadius->setEnabled(false); + mLightFalloff->setEnabled(false); + mLightFOV->setEnabled(false); + mLightFocus->setEnabled(false); + mLightAmbiance->setEnabled(false); + + mCheckAnimesh->setEnabled(false); + mCheckFlexible1D->setEnabled(false); + mSpinSections->setEnabled(false); + mSpinGravity->setEnabled(false); + mSpinTension->setEnabled(false); + mSpinFriction->setEnabled(false); + mSpinWind->setEnabled(false); + mSpinForceX->setEnabled(false); + mSpinForceY->setEnabled(false); + mSpinForceZ->setEnabled(false); mSpinPhysicsGravity->setEnabled(FALSE); mSpinPhysicsFriction->setEnabled(FALSE); @@ -677,7 +688,7 @@ void LLPanelVolume::sendIsLight() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL value = getChild<LLUICtrl>("Light Checkbox Ctrl")->getValue(); + BOOL value = mCheckLight->get(); volobjp->setIsLight(value); LL_INFOS() << "update light sent" << LL_ENDL; } @@ -691,7 +702,7 @@ void LLPanelVolume::sendIsFlexible() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL is_flexible = getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->getValue(); + BOOL is_flexible = mCheckFlexible1D->getValue(); //BOOL is_flexible = mCheckFlexible1D->get(); if (is_flexible) @@ -758,36 +769,31 @@ void LLPanelVolume::refreshCost() void LLPanelVolume::onLightCancelColor(const LLSD& data) { - LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); - if(LightColorSwatch) - { - LightColorSwatch->setColor(mLightSavedColor); - } + mLightColorSwatch->setColor(mLightSavedColor); onLightSelectColor(data); } void LLPanelVolume::onLightCancelTexture(const LLSD& data) { - LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control"); LLVOVolume *volobjp = (LLVOVolume *) mObject.get(); - if (volobjp && LightTextureCtrl) + if (volobjp) { // Cancel the light texture as requested // NORSPEC-292 // // Texture picker triggers cancel both in case of actual cancel and in case of // selection of "None" texture. - LLUUID tex_id = LightTextureCtrl->getImageAssetID(); + LLUUID tex_id = mLightTextureCtrl->getImageAssetID(); bool is_spotlight = volobjp->isLightSpotlight(); volobjp->setLightTextureID(tex_id); //updates spotlight if (!is_spotlight && tex_id.notNull()) { LLVector3 spot_params = volobjp->getSpotLightParams(); - getChild<LLUICtrl>("Light FOV")->setValue(spot_params.mV[0]); - getChild<LLUICtrl>("Light Focus")->setValue(spot_params.mV[1]); - getChild<LLUICtrl>("Light Ambiance")->setValue(spot_params.mV[2]); + mLightFOV->setValue(spot_params.mV[0]); + mLightFocus->setValue(spot_params.mV[1]); + mLightAmbiance->setValue(spot_params.mV[2]); } } } @@ -801,15 +807,10 @@ void LLPanelVolume::onLightSelectColor(const LLSD& data) } LLVOVolume *volobjp = (LLVOVolume *)objectp; - - LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); - if(LightColorSwatch) - { - LLColor4 clr = LightColorSwatch->get(); - LLColor3 clr3( clr ); - volobjp->setLightSRGBColor(clr3); - mLightSavedColor = clr; - } + LLColor4 clr = mLightColorSwatch->get(); + LLColor3 clr3( clr ); + volobjp->setLightSRGBColor(clr3); + mLightSavedColor = clr; } void LLPanelVolume::onLightSelectTexture(const LLSD& data) @@ -820,13 +821,8 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data) } LLVOVolume *volobjp = (LLVOVolume *) mObject.get(); - - LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control"); - if(LightTextureCtrl) - { - LLUUID id = LightTextureCtrl->getImageAssetID(); - volobjp->setLightTextureID(id); - } + LLUUID id = mLightTextureCtrl->getImageAssetID(); + volobjp->setLightTextureID(id); } // static @@ -873,30 +869,24 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLVOVolume *volobjp = (LLVOVolume *)objectp; - volobjp->setLightIntensity((F32)self->getChild<LLUICtrl>("Light Intensity")->getValue().asReal()); - volobjp->setLightRadius((F32)self->getChild<LLUICtrl>("Light Radius")->getValue().asReal()); - volobjp->setLightFalloff((F32)self->getChild<LLUICtrl>("Light Falloff")->getValue().asReal()); + volobjp->setLightIntensity((F32) self->mLightIntensity->getValue().asReal()); + volobjp->setLightRadius((F32) self->mLightRadius->getValue().asReal()); + volobjp->setLightFalloff((F32) self->mLightFalloff->getValue().asReal()); - LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch"); - if(LightColorSwatch) - { - LLColor4 clr = LightColorSwatch->get(); - volobjp->setLightSRGBColor(LLColor3(clr)); - } + LLColor4 clr = self->mLightColorSwatch->get(); + volobjp->setLightSRGBColor(LLColor3(clr)); - LLTextureCtrl* LightTextureCtrl = self->getChild<LLTextureCtrl>("light texture control"); - if(LightTextureCtrl) { - LLUUID id = LightTextureCtrl->getImageAssetID(); + LLUUID id = self->mLightTextureCtrl->getImageAssetID(); if (id.notNull()) { if (!volobjp->isLightSpotlight()) { //this commit is making this a spot light, set UI to default params volobjp->setLightTextureID(id); LLVector3 spot_params = volobjp->getSpotLightParams(); - self->getChild<LLUICtrl>("Light FOV")->setValue(spot_params.mV[0]); - self->getChild<LLUICtrl>("Light Focus")->setValue(spot_params.mV[1]); - self->getChild<LLUICtrl>("Light Ambiance")->setValue(spot_params.mV[2]); + self->mLightFOV->setValue(spot_params.mV[0]); + self->mLightFocus->setValue(spot_params.mV[1]); + self->mLightAmbiance->setValue(spot_params.mV[2]); } else { //modifying existing params, this time volobjp won't change params on its own. @@ -906,18 +896,18 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) } LLVector3 spot_params; - spot_params.mV[0] = (F32) self->getChild<LLUICtrl>("Light FOV")->getValue().asReal(); - spot_params.mV[1] = (F32) self->getChild<LLUICtrl>("Light Focus")->getValue().asReal(); - spot_params.mV[2] = (F32) self->getChild<LLUICtrl>("Light Ambiance")->getValue().asReal(); + spot_params.mV[0] = (F32) self->mLightFOV->getValue().asReal(); + spot_params.mV[1] = (F32) self->mLightFocus->getValue().asReal(); + spot_params.mV[2] = (F32) self->mLightAmbiance->getValue().asReal(); volobjp->setSpotLightParams(spot_params); } } else if (volobjp->isLightSpotlight()) { //no longer a spot light volobjp->setLightTextureID(id); - //self->getChildView("Light FOV")->setEnabled(FALSE); - //self->getChildView("Light Focus")->setEnabled(FALSE); - //self->getChildView("Light Ambiance")->setEnabled(FALSE); + //self->mLightFOV->setEnabled(FALSE); + //self->mLightFocus->setEnabled(FALSE); + //self->mLightAmbiance->setEnabled(FALSE); } } @@ -950,14 +940,14 @@ void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata ) new_attributes = *attributes; - new_attributes.setSimulateLOD(self->getChild<LLUICtrl>("FlexNumSections")->getValue().asInteger());//(S32)self->mSpinSections->get()); - new_attributes.setGravity((F32)self->getChild<LLUICtrl>("FlexGravity")->getValue().asReal()); - new_attributes.setTension((F32)self->getChild<LLUICtrl>("FlexTension")->getValue().asReal()); - new_attributes.setAirFriction((F32)self->getChild<LLUICtrl>("FlexFriction")->getValue().asReal()); - new_attributes.setWindSensitivity((F32)self->getChild<LLUICtrl>("FlexWind")->getValue().asReal()); - F32 fx = (F32)self->getChild<LLUICtrl>("FlexForceX")->getValue().asReal(); - F32 fy = (F32)self->getChild<LLUICtrl>("FlexForceY")->getValue().asReal(); - F32 fz = (F32)self->getChild<LLUICtrl>("FlexForceZ")->getValue().asReal(); + new_attributes.setSimulateLOD(self->mSpinSections->getValue().asInteger()); //(S32)self->mSpinSections->get()); + new_attributes.setGravity((F32)self->mSpinGravity->getValue().asReal()); + new_attributes.setTension((F32)self->mSpinTension->getValue().asReal()); + new_attributes.setAirFriction((F32)self->mSpinFriction->getValue().asReal()); + new_attributes.setWindSensitivity((F32)self->mSpinWind->getValue().asReal()); + F32 fx = (F32)self->mSpinForceX->getValue().asReal(); + F32 fy = (F32) self->mSpinForceY->getValue().asReal(); + F32 fz = (F32) self->mSpinForceZ->getValue().asReal(); LLVector3 force(fx,fy,fz); new_attributes.setUserForce(force); @@ -976,7 +966,7 @@ void LLPanelVolume::onCommitAnimatedMeshCheckbox(LLUICtrl *, void*) return; } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL animated_mesh = getChild<LLUICtrl>("Animated Mesh Checkbox Ctrl")->getValue(); + BOOL animated_mesh = mCheckAnimesh->getValue(); U32 flags = volobjp->getExtendedMeshFlags(); U32 new_flags = flags; if (animated_mesh) @@ -998,10 +988,8 @@ void LLPanelVolume::onCommitAnimatedMeshCheckbox(LLUICtrl *, void*) volobjp->refreshBakeTexture(); LLViewerObject::const_child_list_t& child_list = volobjp->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); ++iter) + for (LLViewerObject* objectp : child_list) { - LLViewerObject* objectp = *iter; if (objectp) { objectp->refreshBakeTexture(); @@ -1035,6 +1023,6 @@ void LLPanelVolume::handleResponseChangeToFlexible(const LLSD &pNotification, co } else { - getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(FALSE); + mCheckFlexible1D->setValue(FALSE); } } diff --git a/indra/newview/llpanelvolume.h b/indra/newview/llpanelvolume.h index 39d876b11f33e28adc0fcc92c17aa929bd4d9bd8..2dab68b3846c48e25919980307d23a0fe3a9e8c6 100644 --- a/indra/newview/llpanelvolume.h +++ b/indra/newview/llpanelvolume.h @@ -40,6 +40,7 @@ class LLButton; class LLViewerObject; class LLComboBox; class LLColorSwatchCtrl; +class LLTextureCtrl; class LLPanelVolume final : public LLPanel { @@ -87,39 +88,50 @@ class LLPanelVolume final : public LLPanel void handleResponseChangeToFlexible(const LLSD &pNotification, const LLSD &pResponse); -/* - LLTextBox* mLabelSelectSingleMessage; + + //Animesh + LLCheckBoxCtrl* mCheckAnimesh = nullptr; + + LLTextBox* mLabelEditObject = nullptr; + LLTextBox* mLabelSelectSingle = nullptr; + // Light - LLCheckBoxCtrl* mCheckLight; - LLCheckBoxCtrl* mCheckFlexible1D; - LLTextBox* mLabelColor; - LLColorSwatchCtrl* mLightColorSwatch; - LLSpinCtrl* mLightIntensity; - LLSpinCtrl* mLightRadius; - LLSpinCtrl* mLightFalloff; - LLSpinCtrl* mLightCutoff; + LLCheckBoxCtrl* mCheckLight = nullptr; + LLTextBox* mLabelColor = nullptr; + LLTextureCtrl* mLightTextureCtrl = nullptr; + LLColorSwatchCtrl* mLightColorSwatch = nullptr; + LLSpinCtrl* mLightIntensity = nullptr; + LLSpinCtrl* mLightRadius = nullptr; + LLSpinCtrl* mLightFalloff = nullptr; + LLSpinCtrl* mLightFOV = nullptr; + LLSpinCtrl* mLightFocus = nullptr; + LLSpinCtrl* mLightAmbiance = nullptr; + // Flexibile - LLSpinCtrl* mSpinSections; - LLSpinCtrl* mSpinGravity; - LLSpinCtrl* mSpinTension; - LLSpinCtrl* mSpinFriction; - LLSpinCtrl* mSpinWind; - LLSpinCtrl* mSpinForce[3]; -*/ + LLCheckBoxCtrl* mCheckFlexible1D = nullptr; + LLSpinCtrl* mSpinSections = nullptr; + LLSpinCtrl* mSpinGravity = nullptr; + LLSpinCtrl* mSpinTension = nullptr; + LLSpinCtrl* mSpinFriction = nullptr; + LLSpinCtrl* mSpinWind = nullptr; + LLSpinCtrl* mSpinForceX = nullptr; + LLSpinCtrl* mSpinForceY = nullptr; + LLSpinCtrl* mSpinForceZ = nullptr; S32 mComboMaterialItemCount; - LLComboBox* mComboMaterial; + LLComboBox* mComboMaterial = nullptr; LLColor4 mLightSavedColor; LLPointer<LLViewerObject> mObject; LLPointer<LLViewerObject> mRootObject; - LLComboBox* mComboPhysicsShapeType; - LLSpinCtrl* mSpinPhysicsGravity; - LLSpinCtrl* mSpinPhysicsFriction; - LLSpinCtrl* mSpinPhysicsDensity; - LLSpinCtrl* mSpinPhysicsRestitution; + LLTextBox* mLabelPhysicsShapeType = nullptr; + LLComboBox* mComboPhysicsShapeType = nullptr; + LLSpinCtrl* mSpinPhysicsGravity = nullptr; + LLSpinCtrl* mSpinPhysicsFriction = nullptr; + LLSpinCtrl* mSpinPhysicsDensity = nullptr; + LLSpinCtrl* mSpinPhysicsRestitution = nullptr; }; #endif