summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/lltexturectrl.cpp43
-rw-r--r--indra/newview/lltexturectrl.h3
-rw-r--r--indra/newview/skins/default/xui/en/floater_texture_ctrl.xml30
3 files changed, 69 insertions, 7 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index e8ff14daac..a0d4667827 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -417,8 +417,12 @@ BOOL LLFloaterTexturePicker::postBuild()
childSetCommitCallback("show_folders_check", onShowFolders, this);
getChildView("show_folders_check")->setVisible( FALSE);
- mFilterEdit = getChild<LLFilterEditor>("inventory search editor");
- mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2));
+ mFilterEdit = getChild<LLFilterEditor>("inventory search editor");
+ mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2));
+
+ mTextureMaterialsCombo = getChild<LLComboBox>("textures_material_combo");
+ mTextureMaterialsCombo->setCommitCallback(onSelectTextureMaterials, this);
+ mTextureMaterialsCombo->selectByValue(0);
mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
@@ -430,7 +434,7 @@ BOOL LLFloaterTexturePicker::postBuild()
{
U32 filter_types = 0x0;
filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
- filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
+ filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
mInventoryPanel->setFilterTypes(filter_types);
//mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss.
@@ -817,6 +821,7 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata)
self->getChild<LLButton>("Blank")->setVisible(index == 0 ? TRUE : FALSE);
self->getChild<LLButton>("None")->setVisible(index == 0 ? TRUE : FALSE);
self->getChild<LLButton>("Pipette")->setVisible(index == 0 ? TRUE : FALSE);
+ self->getChild<LLComboBox>("textures_material_combo")->setVisible(index == 0 ? TRUE : FALSE);
self->getChild<LLFilterEditor>("inventory search editor")->setVisible(index == 0 ? TRUE : FALSE);
self->getChild<LLInventoryPanel>("inventory panel")->setVisible(index == 0 ? TRUE : FALSE);
@@ -1136,6 +1141,38 @@ void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string )
mInventoryPanel->setFilterSubString(search_string);
}
+void LLFloaterTexturePicker::onSelectTextureMaterials(LLUICtrl* ctrl, void *userdata)
+{
+ LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)userdata;
+ int index = self->mTextureMaterialsCombo->getValue().asInteger();
+
+ // IMPORTANT: make sure these match the entries in floater_texture_ctrl.xml
+ // for the textures_material_combo combo box
+ const int textures_and_materials = 0;
+ const int textures_only = 1;
+ const int materials_only = 2;
+
+ U32 filter_types = 0x0;
+
+ if (index == textures_and_materials)
+ {
+ filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
+ filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
+ filter_types |= 0x1 << LLInventoryType::IT_MATERIAL;
+ }
+ else if (index == textures_only)
+ {
+ filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
+ filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
+ }
+ else if (index == materials_only)
+ {
+ filter_types |= 0x1 << LLInventoryType::IT_MATERIAL;
+ }
+
+ self->mInventoryPanel->setFilterTypes(filter_types);
+}
+
void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled)
{
mModeSelector->setEnabledByValue(1, enabled);
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index a234124c08..cfd5c4bd29 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -340,6 +340,8 @@ public:
static void onBakeTextureSelect(LLUICtrl* ctrl, void *userdata);
static void onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *userdata);
+ static void onSelectTextureMaterials(LLUICtrl* ctrl, void *userdata);
+
void setLocalTextureEnabled(BOOL enabled);
void setBakeTextureEnabled(BOOL enabled);
@@ -365,6 +367,7 @@ protected:
BOOL mActive;
LLFilterEditor* mFilterEdit;
+ LLComboBox* mTextureMaterialsCombo;
LLInventoryPanel* mInventoryPanel;
PermissionMask mImmediateFilterPermMask;
PermissionMask mDnDFilterPermMask;
diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
index 3a66911389..7d23034a09 100644
--- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
@@ -137,7 +137,29 @@
value="Preview Disabled"
word_wrap="true"
visible="false"
- width="87" />
+ width="87" />
+ <combo_box
+ follows="left|top|right"
+ height="23"
+ label="Choose Textures, Materials or LIFE!"
+ layout="topleft"
+ left="175"
+ name="textures_material_combo"
+ top="20"
+ width="231">
+ <combo_box.item
+ label="Materials &amp; Textures"
+ name="Materials_Textures"
+ value="0" />
+ <combo_box.item
+ label="Textures"
+ name="Textures"
+ value="1" />
+ <combo_box.item
+ label="Materials"
+ name="Materials"
+ value="2" />
+ </combo_box>
<filter_editor
follows="left|top|right"
height="23"
@@ -145,15 +167,15 @@
layout="topleft"
left="175"
name="inventory search editor"
- top="20"
+ top="48"
width="231" />
- <asset_filtered_inv_panel
+ <inventory_panel
allow_multi_select="false"
bg_visible="true"
bg_alpha_color="DkGray2"
border="false"
follows="all"
- height="233"
+ height="195"
layout="topleft"
left_delta="0"
name="inventory panel"