aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltexturectrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lltexturectrl.cpp')
-rw-r--r--linden/indra/newview/lltexturectrl.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/linden/indra/newview/lltexturectrl.cpp b/linden/indra/newview/lltexturectrl.cpp
index 635c2b0..7946604 100644
--- a/linden/indra/newview/lltexturectrl.cpp
+++ b/linden/indra/newview/lltexturectrl.cpp
@@ -154,6 +154,7 @@ public:
154 static void onBtnPipette( void* userdata ); 154 static void onBtnPipette( void* userdata );
155 //static void onBtnRevert( void* userdata ); 155 //static void onBtnRevert( void* userdata );
156 static void onBtnWhite( void* userdata ); 156 static void onBtnWhite( void* userdata );
157 static void onBtnInvisible( void* userdata );
157 static void onBtnNone( void* userdata ); 158 static void onBtnNone( void* userdata );
158 static void onBtnClear( void* userdata ); 159 static void onBtnClear( void* userdata );
159 static void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data); 160 static void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data);
@@ -170,6 +171,7 @@ protected:
170 std::string mFallbackImageName; // What to show if currently selected texture is null. 171 std::string mFallbackImageName; // What to show if currently selected texture is null.
171 172
172 LLUUID mWhiteImageAssetID; 173 LLUUID mWhiteImageAssetID;
174 LLUUID mInvisibleImageAssetID;
173 LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory. 175 LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory.
174 LLUUID mOriginalImageAssetID; 176 LLUUID mOriginalImageAssetID;
175 177
@@ -210,6 +212,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
210 mImageAssetID( owner->getImageAssetID() ), 212 mImageAssetID( owner->getImageAssetID() ),
211 mFallbackImageName( fallback_image_name ), 213 mFallbackImageName( fallback_image_name ),
212 mWhiteImageAssetID( gSavedSettings.getString( "UIImgWhiteUUID" ) ), 214 mWhiteImageAssetID( gSavedSettings.getString( "UIImgWhiteUUID" ) ),
215 mInvisibleImageAssetID(gSavedSettings.getString("UIImgInvisibleUUID")),
213 mOriginalImageAssetID(owner->getImageAssetID()), 216 mOriginalImageAssetID(owner->getImageAssetID()),
214 mLabel(label), 217 mLabel(label),
215 mTentativeLabel(NULL), 218 mTentativeLabel(NULL),
@@ -231,6 +234,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
231 childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this); 234 childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this);
232 childSetAction("None", LLFloaterTexturePicker::onBtnNone,this); 235 childSetAction("None", LLFloaterTexturePicker::onBtnNone,this);
233 childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this); 236 childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this);
237 childSetAction("Invisible", LLFloaterTexturePicker::onBtnInvisible,this);
234 238
235 239
236 childSetCommitCallback("show_folders_check", onShowFolders, this); 240 childSetCommitCallback("show_folders_check", onShowFolders, this);
@@ -571,6 +575,7 @@ void LLFloaterTexturePicker::draw()
571 575
572 childSetEnabled("Default", mImageAssetID != mOwner->getDefaultImageAssetID()); 576 childSetEnabled("Default", mImageAssetID != mOwner->getDefaultImageAssetID());
573 childSetEnabled("Blank", mImageAssetID != mWhiteImageAssetID ); 577 childSetEnabled("Blank", mImageAssetID != mWhiteImageAssetID );
578 childSetEnabled("Invisible", mOwner->getAllowInvisibleTexture() && mImageAssetID != mInvisibleImageAssetID );
574 childSetEnabled("None", mOwner->getAllowNoTexture() && !mImageAssetID.isNull() ); 579 childSetEnabled("None", mOwner->getAllowNoTexture() && !mImageAssetID.isNull() );
575 580
576 LLFloater::draw(); 581 LLFloater::draw();
@@ -706,6 +711,15 @@ void LLFloaterTexturePicker::onBtnWhite(void* userdata)
706 711
707 712
708// static 713// static
714void LLFloaterTexturePicker::onBtnInvisible(void* userdata)
715{
716 LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
717 self->setImageID(self->mInvisibleImageAssetID);
718 self->commitIfImmediateSet();
719}
720
721
722// static
709void LLFloaterTexturePicker::onBtnNone(void* userdata) 723void LLFloaterTexturePicker::onBtnNone(void* userdata)
710{ 724{
711 LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; 725 LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
@@ -918,6 +932,7 @@ LLTextureCtrl::LLTextureCtrl(
918 mDefaultImageName( default_image_name ), 932 mDefaultImageName( default_image_name ),
919 mLabel( label ), 933 mLabel( label ),
920 mAllowNoTexture( FALSE ), 934 mAllowNoTexture( FALSE ),
935 mAllowInvisibleTexture(FALSE),
921 mImmediateFilterPermMask( PERM_NONE ), 936 mImmediateFilterPermMask( PERM_NONE ),
922 mNonImmediateFilterPermMask( PERM_NONE ), 937 mNonImmediateFilterPermMask( PERM_NONE ),
923 mCanApplyImmediately( FALSE ), 938 mCanApplyImmediately( FALSE ),
@@ -977,6 +992,8 @@ LLXMLNodePtr LLTextureCtrl::getXML(bool save_children) const
977 992
978 node->createChild("allow_no_texture", TRUE)->setBoolValue(mAllowNoTexture); 993 node->createChild("allow_no_texture", TRUE)->setBoolValue(mAllowNoTexture);
979 994
995 node->createChild("allow_invisible_texture", TRUE)->setBoolValue(mAllowInvisibleTexture);
996
980 node->createChild("can_apply_immediately", TRUE)->setBoolValue(mCanApplyImmediately ); 997 node->createChild("can_apply_immediately", TRUE)->setBoolValue(mCanApplyImmediately );
981 998
982 return node; 999 return node;
@@ -1005,6 +1022,9 @@ LLView* LLTextureCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor
1005 BOOL allow_no_texture = FALSE; 1022 BOOL allow_no_texture = FALSE;
1006 node->getAttributeBOOL("allow_no_texture", allow_no_texture); 1023 node->getAttributeBOOL("allow_no_texture", allow_no_texture);
1007 1024
1025 BOOL allow_invisible_texture = FALSE;
1026 node->getAttributeBOOL("allow_invisible_texture", allow_invisible_texture);
1027
1008 BOOL can_apply_immediately = FALSE; 1028 BOOL can_apply_immediately = FALSE;
1009 node->getAttributeBOOL("can_apply_immediately", can_apply_immediately); 1029 node->getAttributeBOOL("can_apply_immediately", can_apply_immediately);
1010 1030
@@ -1021,6 +1041,7 @@ LLView* LLTextureCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor
1021 LLUUID(default_image_id), 1041 LLUUID(default_image_id),
1022 default_image_name ); 1042 default_image_name );
1023 texture_picker->setAllowNoTexture(allow_no_texture); 1043 texture_picker->setAllowNoTexture(allow_no_texture);
1044 texture_picker->setAllowInvisibleTexture(allow_invisible_texture);
1024 texture_picker->setCanApplyImmediately(can_apply_immediately); 1045 texture_picker->setCanApplyImmediately(can_apply_immediately);
1025 1046
1026 texture_picker->initFromXML(node, parent); 1047 texture_picker->initFromXML(node, parent);