diff options
author | Oz Linden <oz@lindenlab.com> | 2016-01-15 16:55:04 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2016-01-15 16:55:04 -0500 |
commit | bc22e587439a2822e5228508e7a4a1e2ec0121c5 (patch) | |
tree | 442540d0c2760617a2c0cf0cb9ba1973ab6fb298 /indra/newview/llpanelface.cpp | |
parent | 317644f5d575ecd4e734c9a5327f2a062ebf914a (diff) | |
parent | 5a5c023e291990a463b1a91846ce82c70da8daab (diff) |
merge changes for 4.0.1-release
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rw-r--r-- | indra/newview/llpanelface.cpp | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index afc1a789c4..21d8b4248c 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -49,6 +49,7 @@ #include "llmaterialmgr.h" #include "llmediaentry.h" #include "llnotificationsutil.h" +#include "llradiogroup.h" #include "llresmgr.h" #include "llselectmgr.h" #include "llspinctrl.h" @@ -90,10 +91,10 @@ std::string USE_TEXTURE; LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit() { LLComboBox* combobox_matmedia = getChild<LLComboBox>("combobox matmedia"); - LLComboBox* combobox_mattype = getChild<LLComboBox>("combobox mattype"); + LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); LLRender::eTexIndex channel_to_edit = (combobox_matmedia && combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? - (combobox_mattype ? (LLRender::eTexIndex)combobox_mattype->getCurrentIndex() : LLRender::DIFFUSE_MAP) : LLRender::DIFFUSE_MAP; + (radio_mat_type ? (LLRender::eTexIndex)radio_mat_type->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; @@ -162,7 +163,6 @@ BOOL LLPanelFace::postBuild() LLComboBox* mComboTexGen; LLComboBox* mComboMatMedia; - LLComboBox* mComboMatType; LLCheckBoxCtrl *mCheckFullbright; @@ -283,12 +283,12 @@ BOOL LLPanelFace::postBuild() mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL); } - mComboMatType = getChild<LLComboBox>("combobox mattype"); - if(mComboMatType) - { - mComboMatType->setCommitCallback(LLPanelFace::onCommitMaterialType, this); - mComboMatType->selectNthItem(MATTYPE_DIFFUSE); - } + LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); + if(radio_mat_type) + { + radio_mat_type->setCommitCallback(LLPanelFace::onCommitMaterialType, this); + radio_mat_type->selectNthItem(MATTYPE_DIFFUSE); + } mCtrlGlow = getChild<LLSpinCtrl>("glow"); if(mCtrlGlow) @@ -676,20 +676,21 @@ void LLPanelFace::updateUI() } getChildView("combobox matmedia")->setEnabled(editable); - LLComboBox* combobox_mattype = getChild<LLComboBox>("combobox mattype"); - if (combobox_mattype) + LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); + if(radio_mat_type) { - if (combobox_mattype->getCurrentIndex() < MATTYPE_DIFFUSE) - { - combobox_mattype->selectNthItem(MATTYPE_DIFFUSE); - } + if (radio_mat_type->getSelectedIndex() < MATTYPE_DIFFUSE) + { + radio_mat_type->selectNthItem(MATTYPE_DIFFUSE); + } + } else { - LL_WARNS("Materials") << "failed getChild for 'combobox mattype'" << LL_ENDL; + LL_WARNS("Materials") << "failed getChild for 'radio_material_type'" << LL_ENDL; } - getChildView("combobox mattype")->setEnabled(editable); + getChildView("radio_material_type")->setEnabled(editable); updateVisibility(); bool identical = true; // true because it is anded below @@ -1200,8 +1201,7 @@ void LLPanelFace::updateUI() BOOL identical_repeats = true; F32 repeats = 1.0f; - U32 material_type = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? combobox_mattype->getCurrentIndex() : MATTYPE_DIFFUSE; - + U32 material_type = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? radio_mat_type->getSelectedIndex() : MATTYPE_DIFFUSE; LLSelectMgr::getInstance()->setTextureChannel(LLRender::eTexIndex(material_type)); switch (material_type) @@ -1466,22 +1466,21 @@ void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata) void LLPanelFace::updateVisibility() { LLComboBox* combo_matmedia = getChild<LLComboBox>("combobox matmedia"); - LLComboBox* combo_mattype = getChild<LLComboBox>("combobox mattype"); + LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); LLComboBox* combo_shininess = getChild<LLComboBox>("combobox shininess"); LLComboBox* combo_bumpiness = getChild<LLComboBox>("combobox bumpiness"); - if (!combo_mattype || !combo_matmedia || !combo_shininess || !combo_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 = combo_mattype->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("combobox mattype")->setVisible(!show_media); - getChildView("rptctrl")->setVisible(true); + getChildView("radio_material_type")->setVisible(!show_media); // Media controls getChildView("media_info")->setVisible(show_media); @@ -1608,9 +1607,9 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh } LLComboBox* combo_matmedia = getChild<LLComboBox>("combobox matmedia"); - LLComboBox* combo_mattype = getChild<LLComboBox>("combobox mattype"); + LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); U32 materials_media = combo_matmedia->getCurrentIndex(); - U32 material_type = combo_mattype->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(); @@ -1693,11 +1692,11 @@ void LLPanelFace::updateAlphaControls() mat_media = combobox_matmedia->getCurrentIndex(); } - LLComboBox* combobox_mattype = getChild<LLComboBox>("combobox mattype"); U32 mat_type = MATTYPE_DIFFUSE; - if (combobox_mattype) + LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); + if(radio_mat_type) { - mat_type = combobox_mattype->getCurrentIndex(); + mat_type = radio_mat_type->getSelectedIndex(); } show_alphactrls = show_alphactrls && (mat_media == MATMEDIA_MATERIAL); @@ -1985,12 +1984,11 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata) LLUICtrl* repeats_ctrl = self->getChild<LLUICtrl>("rptctrl"); LLComboBox* combo_matmedia = self->getChild<LLComboBox>("combobox matmedia"); - LLComboBox* combo_mattype = self->getChild<LLComboBox>("combobox mattype"); + LLRadioGroup* radio_mat_type = self->getChild<LLRadioGroup>("radio_material_type"); U32 materials_media = combo_matmedia->getCurrentIndex(); - - U32 material_type = (materials_media == MATMEDIA_MATERIAL) ? combo_mattype->getCurrentIndex() : 0; + U32 material_type = (materials_media == MATMEDIA_MATERIAL) ? radio_mat_type->getSelectedIndex() : 0; F32 repeats_per_meter = repeats_ctrl->getValue().asReal(); F32 obj_scale_s = 1.0f; @@ -2114,12 +2112,12 @@ void LLPanelFace::onCommitPlanarAlign(LLUICtrl* ctrl, void* userdata) void LLPanelFace::onTextureSelectionChanged(LLInventoryItem* itemp) { LL_DEBUGS("Materials") << "item asset " << itemp->getAssetUUID() << LL_ENDL; - LLComboBox* combo_mattype = getChild<LLComboBox>("combobox mattype"); - if (!combo_mattype) + LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); + if(radio_mat_type) { - return; + return; } - U32 mattype = combo_mattype->getCurrentIndex(); + U32 mattype = radio_mat_type->getSelectedIndex(); std::string which_control="texture control"; switch (mattype) { |