diff options
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rwxr-xr-x[-rw-r--r--] | indra/newview/lltexturectrl.cpp | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 007eb8e33f..4676f7b251 100644..100755 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -144,7 +144,7 @@ public: static void onBtnCancel( void* userdata ); void onBtnPipette( ); //static void onBtnRevert( void* userdata ); - static void onBtnWhite( void* userdata ); + static void onBtnBlank( void* userdata ); static void onBtnNone( void* userdata ); static void onBtnClear( void* userdata ); void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); @@ -165,7 +165,6 @@ protected: LLUUID mImageAssetID; // Currently selected texture LLUIImagePtr mFallbackImage; // What to show if currently selected texture is null. - LLUUID mWhiteImageAssetID; LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory. LLUUID mOriginalImageAssetID; @@ -208,8 +207,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( : LLFloater(LLSD()), mOwner( owner ), mImageAssetID( owner->getImageAssetID() ), - mFallbackImage( fallback_image ), - mWhiteImageAssetID( gSavedSettings.getString( "UIImgWhiteUUID" ) ), + mFallbackImage( fallback_image ), mOriginalImageAssetID(owner->getImageAssetID()), mLabel(label), mTentativeLabel(NULL), @@ -426,7 +424,7 @@ BOOL LLFloaterTexturePicker::postBuild() childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this); childSetAction("None", LLFloaterTexturePicker::onBtnNone,this); - childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this); + childSetAction("Blank", LLFloaterTexturePicker::onBtnBlank,this); childSetCommitCallback("show_folders_check", onShowFolders, this); @@ -571,8 +569,8 @@ void LLFloaterTexturePicker::draw() mTexturep = NULL; if(mImageAssetID.notNull()) { - mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, MIPMAP_YES); - mTexturep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW); + mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID); + mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW); } if (mTentativeLabel) @@ -581,7 +579,7 @@ void LLFloaterTexturePicker::draw() } getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID()); - getChildView("Blank")->setEnabled(mImageAssetID != mWhiteImageAssetID ); + getChildView("Blank")->setEnabled(mImageAssetID != mOwner->getBlankImageAssetID()); getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && !mImageAssetID.isNull() ); LLFloater::draw(); @@ -721,11 +719,11 @@ void LLFloaterTexturePicker::onBtnSetToDefault(void* userdata) } // static -void LLFloaterTexturePicker::onBtnWhite(void* userdata) +void LLFloaterTexturePicker::onBtnBlank(void* userdata) { LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; self->setCanApply(true, true); - self->setImageID( self->mWhiteImageAssetID ); + self->setImageID( self->mOwner->getBlankImageAssetID() ); self->commitIfImmediateSet(); } @@ -1042,6 +1040,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mDragCallback(NULL), mDropCallback(NULL), mOnCancelCallback(NULL), + mOnCloseCallback(NULL), mOnSelectCallback(NULL), mBorderColor( p.border_color() ), mAllowNoTexture( FALSE ), @@ -1056,6 +1055,12 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mDefaultImageName(p.default_image_name), mFallbackImage(p.fallback_image) { + + // Default of defaults is white image for diff tex + // + LLUUID whiteImage( gSavedSettings.getString( "UIImgWhiteUUID" ) ); + setBlankImageAssetID( whiteImage ); + setAllowNoTexture(p.allow_no_texture); setCanApplyImmediately(p.can_apply_immediately); mCommitOnSelection = !p.no_commit_on_selection; @@ -1292,6 +1297,10 @@ void LLTextureCtrl::onFloaterClose() if (floaterp) { + if (mOnCloseCallback) + { + mOnCloseCallback(this,LLSD()); + } floaterp->setOwner(NULL); } @@ -1442,9 +1451,9 @@ void LLTextureCtrl::draw() } else if (!mImageAssetID.isNull()) { - LLPointer<LLViewerFetchedTexture> texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, MIPMAP_YES,LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + LLPointer<LLViewerFetchedTexture> texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES,LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - texture->setBoostLevel(LLViewerTexture::BOOST_PREVIEW); + texture->setBoostLevel(LLGLTexture::BOOST_PREVIEW); texture->forceToSaveRawImage(0) ; mTexturep = texture; |