From 694f6c11d11be695f1d95ec7478e1b9ca5811a0d Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Wed, 17 Aug 2022 12:21:01 -0700 Subject: SL-17699 Add upport for materials to texture picker. MAke sure the default (index 0) option is selected and update filters accordingly at startup --- indra/newview/lltexturectrl.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index a0d4667827..d9ecfbc81d 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -420,11 +420,13 @@ BOOL LLFloaterTexturePicker::postBuild() mFilterEdit = getChild("inventory search editor"); mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2)); + mInventoryPanel = getChild("inventory panel"); + mTextureMaterialsCombo = getChild("textures_material_combo"); mTextureMaterialsCombo->setCommitCallback(onSelectTextureMaterials, this); - mTextureMaterialsCombo->selectByValue(0); - mInventoryPanel = getChild("inventory panel"); + // set the combo box to the first entry in the list (currently textures and materials) + mTextureMaterialsCombo->selectByValue(0); mModeSelector = getChild("mode_selection"); mModeSelector->setCommitCallback(onModeSelect, this); @@ -432,12 +434,12 @@ BOOL LLFloaterTexturePicker::postBuild() if(mInventoryPanel) { - U32 filter_types = 0x0; - filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; - filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; + // to avoid having to make an assumption about which option is + // 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); - mInventoryPanel->setFilterTypes(filter_types); - //mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss. mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); -- cgit v1.2.3