diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-29 00:27:47 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-29 00:27:47 +0300 |
commit | c61224bef22686c4e6f5b4a6af9acbeb27d561ab (patch) | |
tree | be00801c20c7ecee3056009c4fc01331b84b8929 /indra/newview | |
parent | 6d0fcc0e616ff58f4a83bc3730374c5509ee959a (diff) |
SL-17699 Hide pipette for material picker
At the moment there is no specification how it should work, it can't work like it does for textures due to material overrides.
Also removed some dead code
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 36 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_texture_ctrl.xml | 13 |
3 files changed, 25 insertions, 25 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 07e09ec038..7aa3639df7 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -479,7 +479,6 @@ BOOL LLFloaterTexturePicker::postBuild() LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1)); getChild<LLComboBox>("l_bake_use_texture_combo_box")->setCommitCallback(onBakeTextureSelect, this); - getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setCommitCallback(onHideBaseMeshRegionCheck, this); setBakeTextureEnabled(TRUE); return TRUE; @@ -822,7 +821,6 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) self->getChild<LLButton>("Default")->setVisible(index == 0 ? TRUE : FALSE); 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<LLFilterEditor>("inventory search editor")->setVisible(index == 0 ? TRUE : FALSE); self->getChild<LLInventoryPanel>("inventory panel")->setVisible(index == 0 ? TRUE : FALSE); @@ -832,7 +830,10 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) self->getChild<LLScrollListCtrl>("l_name_list")->setVisible(index == 1 ? TRUE : FALSE); self->getChild<LLComboBox>("l_bake_use_texture_combo_box")->setVisible(index == 2 ? TRUE : FALSE); - self->getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setVisible(FALSE);// index == 2 ? TRUE : FALSE); + + bool pipette_visible = (index == 0) + && (self->mInventoryPickType != LLTextureCtrl::PICK_MATERIAL); + self->getChild<LLButton>("Pipette")->setVisible(pipette_visible); if (index == 2) { @@ -1111,13 +1112,6 @@ void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void *user_data } } -//static -void LLFloaterTexturePicker::onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *user_data) -{ - //LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data; - //LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl; -} - void LLFloaterTexturePicker::updateFilterPermMask() { //mInventoryPanel->setFilterPermMask( getFilterPermMask() ); Commented out due to no-copy texture loss. @@ -1242,6 +1236,16 @@ void LLFloaterTexturePicker::setInventoryPickType(LLTextureCtrl::EPickInventoryT mInventoryPickType = type; refreshLocalList(); refreshInventoryFilter(); + + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) + { + getChild<LLButton>("Pipette")->setVisible(false); + } + else + { + S32 index = mModeSelector->getValue().asInteger(); + getChild<LLButton>("Pipette")->setVisible(index == 0); + } } void LLFloaterTexturePicker::onPickerCallback(const std::vector<std::string>& filenames, LLHandle<LLFloater> handle) @@ -1292,7 +1296,17 @@ void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) if (inventory_item_id.notNull()) { LLToolPipette::getInstance()->setResult(TRUE, ""); - setImageID(te.getID()); + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) + { + // tes have no data about material ids + // Plus gltf materials are layered with overrides, + // which mean that end result might have no id. + LL_WARNS() << "tes have no data about material ids" << LL_ENDL; + } + else + { + setImageID(te.getID()); + } mNoCopyTextureSelected = FALSE; LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 0a5a281e76..d06a82bbd5 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -352,7 +352,6 @@ public: static void onLocalScrollCommit(LLUICtrl* ctrl, void* userdata); static void onBakeTextureSelect(LLUICtrl* ctrl, void *userdata); - static void onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *userdata); void setLocalTextureEnabled(BOOL enabled); void setBakeTextureEnabled(BOOL enabled); 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 0cb69137e3..18631c3ae7 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml @@ -275,19 +275,6 @@ name="BAKED_AUX3" value="10" /> </combo_box> - <check_box - follows="left|top" - height="20" - initial_value="false" - label="Hide Base Mesh Region" - -layout="topleft" - name="hide_base_mesh_region" - left_delta="0" - top_pad="10" - top_delta="0" - width="120" - visible="false"/> <!-- bottom static --> <button follows="bottom" |