diff options
author | Anchor Linden <anchor@lindenlab.com> | 2018-06-28 05:14:29 +0530 |
---|---|---|
committer | Anchor Linden <anchor@lindenlab.com> | 2018-06-28 05:14:29 +0530 |
commit | 917ab7be9e1eefec23d67a5ee5c8cb8c1955c2d4 (patch) | |
tree | ae91756c525c92eb9b58bc7e728cfc119e2710f1 /indra | |
parent | b48ca9da4786015f23d265f59f97110b48d0d22f (diff) |
[MAINT 8434] - fix mode select doesnt change on drag n drop,
[MAINT 8410] - fix eye dropper still active after switching to bake mode,
[MAINT 8464] - fix bake mode active for non attached objects
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 87 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.h | 2 |
2 files changed, 70 insertions, 19 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 82ec7ce72b..9d51bbd19b 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -81,6 +81,13 @@ static const S32 LOCAL_TRACKING_ID_COLUMN = 1; //static const char WHITE_IMAGE_NAME[] = "Blank Texture"; //static const char NO_IMAGE_NAME[] = "None"; +static BOOL isBakedImageID(LLUUID mImageAssetID) +{ + return ((mImageAssetID == IMG_USE_BAKED_EYES) || (mImageAssetID == IMG_USE_BAKED_HAIR) || (mImageAssetID == IMG_USE_BAKED_HEAD) || (mImageAssetID == IMG_USE_BAKED_LOWER) || (mImageAssetID == IMG_USE_BAKED_SKIRT) || (mImageAssetID == IMG_USE_BAKED_UPPER) + || (mImageAssetID == IMG_USE_BAKED_LEFTARM) || (mImageAssetID == IMG_USE_BAKED_LEFTLEG) || (mImageAssetID == IMG_USE_BAKED_AUX1) || (mImageAssetID == IMG_USE_BAKED_AUX2) || (mImageAssetID == IMG_USE_BAKED_AUX3)); + +} + LLFloaterTexturePicker::LLFloaterTexturePicker( LLView* owner, LLUUID image_asset_id, @@ -119,7 +126,8 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mOnFloaterCommitCallback(NULL), mOnFloaterCloseCallback(NULL), mSetImageAssetIDCallback(NULL), - mOnUpdateImageStatsCallback(NULL) + mOnUpdateImageStatsCallback(NULL), + mBakeTextureEnabled(FALSE) { buildFromFile("floater_texture_ctrl.xml"); mCanApplyImmediately = can_apply_immediately; @@ -137,26 +145,47 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti mNoCopyTextureSelected = FALSE; mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? mImageAssetID = image_id; - LLUUID item_id = findItemID(mImageAssetID, FALSE); - if (item_id.isNull()) + + if (isBakedImageID(mImageAssetID)) { - mInventoryPanel->getRootFolder()->clearSelection(); + if ( mBakeTextureEnabled && mModeSelector->getSelectedIndex() != 2) + { + mModeSelector->setSelectedIndex(2, 0); + onModeSelect(0,this); + } } else { - LLInventoryItem* itemp = gInventory.getItem(image_id); - if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) + if (mModeSelector->getSelectedIndex() == 2) { - // no copy texture - getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); - mNoCopyTextureSelected = TRUE; + mModeSelector->setSelectedIndex(0, 0); + onModeSelect(0,this); + } + + LLUUID item_id = findItemID(mImageAssetID, FALSE); + if (item_id.isNull()) + { + mInventoryPanel->getRootFolder()->clearSelection(); + } + else + { + LLInventoryItem* itemp = gInventory.getItem(image_id); + if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) + { + // no copy texture + getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); + mNoCopyTextureSelected = TRUE; + } } - } - if (set_selection) - { - mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); + if (set_selection) + { + mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); + } } + + + } } @@ -342,6 +371,10 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); + mModeSelector = getChild<LLRadioGroup>("mode_selection"); + mModeSelector->setCommitCallback(onModeSelect, this); + mModeSelector->setSelectedIndex(0, 0); + if(mInventoryPanel) { U32 filter_types = 0x0; @@ -367,16 +400,15 @@ BOOL LLFloaterTexturePicker::postBuild() // don't put keyboard focus on selected item, because the selection callback // will assume that this was user input - if(!mImageAssetID.isNull()) + + + + if (!mImageAssetID.isNull()) { mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); } } - mModeSelector = getChild<LLRadioGroup>("mode_selection"); - mModeSelector->setCommitCallback(onModeSelect, this); - mModeSelector->setSelectedIndex(0, 0); - childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this); childSetAction("l_rem_btn", LLFloaterTexturePicker::onBtnRemove, this); childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this); @@ -805,6 +837,8 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) if (mode == 2) { + self->stopUsingPipette(); + S8 val = -1; LLUUID imageID = self->mImageAssetID; @@ -1113,8 +1147,23 @@ void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled) { + BOOL changed = (enabled != mBakeTextureEnabled); + + mBakeTextureEnabled = enabled; mModeSelector->setIndexEnabled(2, enabled); - mModeSelector->setSelectedIndex(mModeSelector->getSelectedIndex(), 0); + + if (!mBakeTextureEnabled && (mModeSelector->getSelectedIndex() == 2)) + { + mModeSelector->setSelectedIndex(0, 0); + } + + if (changed && mBakeTextureEnabled && isBakedImageID(mImageAssetID)) + { + if (mModeSelector->getSelectedIndex() != 2) + { + mModeSelector->setSelectedIndex(2, 0); + } + } onModeSelect(0, this); } diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index a2bf17019a..b2a34a37c4 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -381,6 +381,8 @@ private: floater_commit_callback mOnFloaterCommitCallback; set_image_asset_id_callback mSetImageAssetIDCallback; set_on_update_image_stats_callback mOnUpdateImageStatsCallback; + + BOOL mBakeTextureEnabled; }; #endif // LL_LLTEXTURECTRL_H |