diff options
author | Dave Parks <davep@lindenlab.com> | 2022-09-13 09:39:39 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-09-13 09:39:39 -0500 |
commit | 0af4adbb8696178767b5972e4c7d879bcdc527e9 (patch) | |
tree | 8faaffb34d69d43c2067c2bbeb31e902913a25e5 /indra/newview | |
parent | e49d602bd99f5a3b1257ba1bc7ded133eab1eb1c (diff) | |
parent | 87b55e7293d7b87650e9e792f6be6b7e894773de (diff) |
Merge branch 'DRTVWR-559' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelface.cpp | 20 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 101 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.h | 8 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_texture_ctrl.xml | 93 |
4 files changed, 62 insertions, 160 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index ac4c76351d..28b8a64131 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1090,10 +1090,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) 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); + getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f && !has_pbr_material); + getChildView("label alphamode")->setEnabled(editable && mIsAlpha && !has_pbr_material); + getChildView("maskcutoff")->setEnabled(editable && mIsAlpha && !has_pbr_material); + getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha && !has_pbr_material); texture_ctrl->setBakeTextureEnabled(TRUE); } @@ -1116,10 +1116,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) 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); + getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f && !has_pbr_material); + getChildView("label alphamode")->setEnabled(editable && mIsAlpha && !has_pbr_material); + getChildView("maskcutoff")->setEnabled(editable && mIsAlpha && !has_pbr_material); + getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha && !has_pbr_material); texture_ctrl->setBakeTextureEnabled(TRUE); } @@ -1823,8 +1823,8 @@ void LLPanelFace::updateVisibility() // Diffuse texture controls getChildView("texture control")->setVisible(show_texture && show_material); - getChildView("label alphamode")->setVisible((show_texture && show_material) || show_pbr); - getChildView("combobox alphamode")->setVisible((show_texture && show_material) || show_pbr); + getChildView("label alphamode")->setVisible(show_texture && show_material); + getChildView("combobox alphamode")->setVisible(show_texture && show_material); getChildView("label maskcutoff")->setVisible(false); getChildView("maskcutoff")->setVisible(false); if ((show_texture && show_material) || show_pbr) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 2dad9cd2dc..b887b079ce 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -416,15 +416,6 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); - // if can select both materials and textures, set textures_material_combo's layout as visible - childSetVisible("combo_layout", mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL); - - mTextureMaterialsCombo = getChild<LLComboBox>("textures_material_combo"); - mTextureMaterialsCombo->setCommitCallback(onSelectTextureMaterials, this); - - // set the combo box to the first entry in the list (currently textures and materials) - mTextureMaterialsCombo->selectByValue(0); - mModeSelector = getChild<LLComboBox>("mode_selection"); mModeSelector->setCommitCallback(onModeSelect, this); mModeSelector->selectByValue(0); @@ -435,7 +426,7 @@ BOOL LLFloaterTexturePicker::postBuild() // selected at startup, we call the same function that is triggered // when a texture/materials/both choice is made and let it take care // of setting the filters - onSelectTextureMaterials(0, this); + refreshInventoryFilter(); mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); @@ -469,21 +460,7 @@ BOOL LLFloaterTexturePicker::postBuild() mLocalScrollCtrl = getChild<LLScrollListCtrl>("l_name_list"); mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit, this); - mLocalScrollCtrl->clearRows(); - - if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } - else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } - else if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) - { - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } + refreshLocalList(); mNoCopyTextureSelected = FALSE; @@ -843,7 +820,6 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) self->getChild<LLButton>("Blank")->setVisible(index == 0 ? TRUE : FALSE); self->getChild<LLButton>("None")->setVisible(index == 0 ? TRUE : FALSE); self->getChild<LLButton>("Pipette")->setVisible(index == 0 ? TRUE : FALSE); - self->getChild<LLComboBox>("textures_material_combo")->setVisible(index == 0 ? TRUE : FALSE); self->getChild<LLFilterEditor>("inventory search editor")->setVisible(index == 0 ? TRUE : FALSE); self->getChild<LLInventoryPanel>("inventory panel")->setVisible(index == 0 ? TRUE : FALSE); @@ -963,21 +939,7 @@ void LLFloaterTexturePicker::onBtnRemove(void* userdata) self->getChild<LLButton>("l_rem_btn")->setEnabled(false); self->getChild<LLButton>("l_upl_btn")->setEnabled(false); - self->mLocalScrollCtrl->clearRows(); - - if (self->mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl); - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl); - } - else if (self->mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl); - } - else if (self->mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) - { - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl); - } + self->refreshLocalList(); } } @@ -1205,36 +1167,46 @@ void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string ) mInventoryPanel->setFilterSubString(search_string); } -void LLFloaterTexturePicker::onSelectTextureMaterials(LLUICtrl* ctrl, void *userdata) +void LLFloaterTexturePicker::refreshLocalList() { - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)userdata; - int index = self->mTextureMaterialsCombo->getValue().asInteger(); - - U32 filter_types = 0x0; + mLocalScrollCtrl->clearRows(); - if (self->mInventoryPickType != LLTextureCtrl::PICK_TEXTURE_MATERIAL) + if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL) + { + LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); + LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); + } + else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) + { + LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); + } + else if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) { - // mInventoryPickType overrides combo - index = self->mInventoryPickType; + LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); } +} - if (index == LLTextureCtrl::PICK_TEXTURE_MATERIAL) +void LLFloaterTexturePicker::refreshInventoryFilter() +{ + U32 filter_types = 0x0; + + if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL) { filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; filter_types |= 0x1 << LLInventoryType::IT_MATERIAL; } - else if (index == LLTextureCtrl::PICK_TEXTURE) + else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) { filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; } - else if (index == LLTextureCtrl::PICK_MATERIAL) + else if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) { filter_types |= 0x1 << LLInventoryType::IT_MATERIAL; } - self->mInventoryPanel->setFilterTypes(filter_types); + mInventoryPanel->setFilterTypes(filter_types); } void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) @@ -1267,27 +1239,8 @@ void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled) void LLFloaterTexturePicker::setInventoryPickType(LLTextureCtrl::EPickInventoryType type) { mInventoryPickType = type; - - // if can select both materials and textures, set textures_material_combo's layout as visible - childSetVisible("combo_layout", mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL); - - mLocalScrollCtrl->clearRows(); - if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } - else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } - else if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) - { - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } - - // refresh filters - onSelectTextureMaterials(0, this); + refreshLocalList(); + refreshInventoryFilter(); } void LLFloaterTexturePicker::onPickerCallback(const std::vector<std::string>& filenames, LLHandle<LLFloater> handle) diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 9cb86a2e74..0a5a281e76 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -78,8 +78,6 @@ public: TEXTURE_CANCEL } ETexturePickOp; - // Should match the entries in floater_texture_ctrl.xml - // for the textures_material_combo combo box typedef enum e_pick_inventory_type { PICK_TEXTURE_MATERIAL = 0, @@ -356,8 +354,6 @@ public: static void onBakeTextureSelect(LLUICtrl* ctrl, void *userdata); static void onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *userdata); - static void onSelectTextureMaterials(LLUICtrl* ctrl, void *userdata); - void setLocalTextureEnabled(BOOL enabled); void setBakeTextureEnabled(BOOL enabled); @@ -366,6 +362,9 @@ public: static void onPickerCallback(const std::vector<std::string>& filenames, LLHandle<LLFloater> handle); protected: + void refreshLocalList(); + void refreshInventoryFilter(); + LLPointer<LLViewerTexture> mTexturep; LLView* mOwner; @@ -387,7 +386,6 @@ protected: BOOL mActive; LLFilterEditor* mFilterEdit; - LLComboBox* mTextureMaterialsCombo; LLInventoryPanel* mInventoryPanel; PermissionMask mImmediateFilterPermMask; PermissionMask mDnDFilterPermMask; diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml index b6a2aaf31b..0cb69137e3 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml @@ -139,77 +139,28 @@ visible="false" width="87" /> - <layout_stack name="inventory_stack" - width="231" - height="276" - top="20" - left="175" - follows="all" - animate="false" - orientation="vertical"> - <layout_panel name="combo_layout" - border="false" - bevel_style="in" - auto_resize="false" - user_resize="false" - visible="false" - width="231" - height="24"> - <combo_box - follows="left|top|right" - height="23" - label="Choose Textures, Materials or LIFE!" - layout="topleft" - left="0" - name="textures_material_combo" - top="0" - width="231"> - <combo_box.item - label="Materials & Textures" - name="Materials_Textures" - value="0" /> - <combo_box.item - label="Textures" - name="Textures" - value="1" /> - <combo_box.item - label="Materials" - name="Materials" - value="2" /> - </combo_box> - </layout_panel> - <layout_panel name="inventory_layout" - border="false" - bevel_style="in" - auto_resize="true" - user_resize="false" - visible="true" - width="231" - height="252"> - <filter_editor - follows="left|top|right" - height="23" - label="Filter Textures" - layout="topleft" - left="0" - name="inventory search editor" - top="4" - width="231" /> - <asset_filtered_inv_panel - allow_multi_select="false" - bg_visible="true" - bg_alpha_color="DkGray2" - border="false" - follows="all" - height="221" - layout="topleft" - left_delta="0" - name="inventory panel" - top_pad="4" - width="231" - filter_asset_types="texture|material"/> - </layout_panel> - </layout_stack> + <filter_editor + follows="left|top|right" + height="23" + label="Filter Textures" + layout="topleft" + left="175" + name="inventory search editor" + top="20" + width="231" /> + <asset_filtered_inv_panel + allow_multi_select="false" + bg_visible="true" + bg_alpha_color="DkGray2" + border="false" + follows="all" + height="242" + layout="topleft" + left_delta="0" + name="inventory panel" + top_pad="4" + width="231" + filter_asset_types="texture|material"/> <!-- middle: local mode --> <button |