diff options
author | Dave Parks <davep@lindenlab.com> | 2022-11-16 16:07:58 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-11-16 16:07:58 -0600 |
commit | d5395502525ad3ebcfa2b75be23544d022b18dbc (patch) | |
tree | 532311803cc838bcc234f0eaa0212d6281d4df0f /indra/newview/lltexturectrl.cpp | |
parent | bc4694e82a5fa7aaafe77e9e3cb84f5b781e741a (diff) | |
parent | 6387fbb378ff3ec5a8cf1e217eb4f2d71134c180 (diff) |
Merge branch 'DRTVWR-559' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 7aa3639df7..3374af1c76 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -301,8 +301,24 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop( BOOL handled = FALSE; bool is_mesh = cargo_type == DAD_MESH; + bool is_texture = cargo_type == DAD_TEXTURE; + bool is_material = cargo_type == DAD_MATERIAL; - if ((cargo_type == DAD_TEXTURE) || is_mesh) + bool allow_dnd = false; + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) + { + allow_dnd = is_material; + } + else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) + { + allow_dnd = is_texture || is_mesh; + } + else + { + allow_dnd = is_texture || is_mesh || is_material; + } + + if (allow_dnd) { LLInventoryItem *item = (LLInventoryItem *)cargo_data; @@ -1246,6 +1262,21 @@ void LLFloaterTexturePicker::setInventoryPickType(LLTextureCtrl::EPickInventoryT S32 index = mModeSelector->getValue().asInteger(); getChild<LLButton>("Pipette")->setVisible(index == 0); } + + if (!mLabel.empty()) + { + std::string pick = getString("pick title"); + + setTitle(pick + mLabel); + } + else if(mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) + { + setTitle(getString("pick_material")); + } + else + { + setTitle(getString("pick_texture")); + } } void LLFloaterTexturePicker::onPickerCallback(const std::vector<std::string>& filenames, LLHandle<LLFloater> handle) @@ -1770,11 +1801,26 @@ BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, // returns true, then the cast was valid, and we can perform // the third test without problems. LLInventoryItem* item = (LLInventoryItem*)cargo_data; - bool is_mesh = cargo_type == DAD_MESH; - if (getEnabled() && - ((cargo_type == DAD_TEXTURE) || is_mesh) && - allowDrop(item)) + bool is_mesh = cargo_type == DAD_MESH; + bool is_texture = cargo_type == DAD_TEXTURE; + bool is_material = cargo_type == DAD_MATERIAL; + + bool allow_dnd = false; + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) + { + allow_dnd = is_material; + } + else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) + { + allow_dnd = is_texture || is_mesh; + } + else + { + allow_dnd = is_texture || is_mesh || is_material; + } + + if (getEnabled() && allow_dnd && allowDrop(item)) { if (drop) { |