summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturectrl.cpp
diff options
context:
space:
mode:
authorAnchor Linden <anchor@lindenlab.com>2018-03-21 01:40:35 -0700
committerAnchor Linden <anchor@lindenlab.com>2018-03-21 01:40:35 -0700
commitf33541443532551f58ff0b16560ec4af398e520f (patch)
tree040f9340b40bef83abdb16185f0f5842d4a3e2c0 /indra/newview/lltexturectrl.cpp
parentac558e384214e22b4a8da2045854e2180b7428bf (diff)
fixed MAINT-8413,8409,8408
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rw-r--r--indra/newview/lltexturectrl.cpp46
1 files changed, 38 insertions, 8 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 0aeea15b97..d9170dd832 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -487,9 +487,9 @@ void LLFloaterTexturePicker::draw()
if ((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))
{
- if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1)
+ LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
+ if (obj)
{
- LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID);
texture = viewerTexture ? dynamic_cast<LLViewerFetchedTexture*>(viewerTexture) : NULL;
}
@@ -990,9 +990,23 @@ void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void *user_data
if (imageID.notNull())
{
- self->setCanApply(true, true);
self->setImageID(imageID);
- self->commitIfImmediateSet();
+ self->mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here?
+
+ if (!self->mPreviewSettingChanged)
+ {
+ self->mCanPreview = gSavedSettings.getBOOL("TextureLivePreview");
+ }
+ else
+ {
+ self->mPreviewSettingChanged = false;
+ }
+
+ if (self->mCanPreview)
+ {
+ // only commit intentional selections, not implicit ones
+ self->commitIfImmediateSet();
+ }
}
else
{
@@ -1067,6 +1081,8 @@ void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled)
void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled)
{
mModeSelector->setIndexEnabled(2, enabled);
+ mModeSelector->setSelectedIndex(mModeSelector->getSelectedIndex(), 0);
+ onModeSelect(0, this);
}
void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te )
@@ -1310,13 +1326,15 @@ void LLTextureCtrl::showPicker(BOOL take_focus)
{
texture_floaterp->setSetImageAssetIDCallback(boost::bind(&LLTextureCtrl::setImageAssetID, this, _1));
}
+ if (texture_floaterp)
+ {
+ texture_floaterp->setBakeTextureEnabled(mBakeTextureEnabled);
+ }
LLFloater* root_floater = gFloaterView->getParentFloater(this);
if (root_floater)
root_floater->addDependentFloater(floaterp);
floaterp->openFloater();
-
- texture_floaterp->setBakeTextureEnabled(mBakeTextureEnabled);
}
if (take_focus)
@@ -1480,6 +1498,17 @@ void LLTextureCtrl::setImageAssetID( const LLUUID& asset_id )
}
}
+void LLTextureCtrl::setBakeTextureEnabled(BOOL enabled)
+{
+ mBakeTextureEnabled = enabled;
+ LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get();
+ if (floaterp)
+ {
+ floaterp->setBakeTextureEnabled(enabled);
+ floaterp->resetDirty();
+ }
+}
+
BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
EAcceptance *accept,
@@ -1538,12 +1567,13 @@ void LLTextureCtrl::draw()
if ((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))
{
- if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1)
+ LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
+ if (obj)
{
- LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID);
texture = viewerTexture ? dynamic_cast<LLViewerFetchedTexture*>(viewerTexture) : NULL;
}
+
}
if (texture.isNull())