diff options
author | Callum Prentice <callum@lindenlab.com> | 2022-08-17 12:21:01 -0700 |
---|---|---|
committer | Callum Prentice <callum@lindenlab.com> | 2022-08-17 12:21:01 -0700 |
commit | 694f6c11d11be695f1d95ec7478e1b9ca5811a0d (patch) | |
tree | 947adf951e46da94e9b83c9133e05c174efb4ca1 /indra/newview/lltexturectrl.cpp | |
parent | 6b71300db74711bbcefb8c6c65e2f162305d068f (diff) |
SL-17699 Add upport for materials to texture picker. MAke sure the default (index 0) option is selected and update filters accordingly at startup
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 16 |
1 files 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<LLFilterEditor>("inventory search editor"); mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2)); + mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); + mTextureMaterialsCombo = getChild<LLComboBox>("textures_material_combo"); mTextureMaterialsCombo->setCommitCallback(onSelectTextureMaterials, this); - mTextureMaterialsCombo->selectByValue(0); - mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); + // 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); @@ -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); |