summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-07-26 13:24:40 +0300
committerGitHub <noreply@github.com>2024-07-26 13:24:40 +0300
commit42b1cedc85b52571f411af3e896e005bdf92657a (patch)
tree3efd198cb59cc98e4c428cccf46cd13b1ba78954 /indra
parent604cb4cb4dd71c0f90633e50d5b0108e3901c4ad (diff)
parenta5d68b3801be0ea77259b387f3c86cca54fc59cc (diff)
Merge pull request #2116 from RyeMutt/fix-findchild-part2
Fix more findChild calls during draw and frequent data callbacks
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterconversationlog.cpp5
-rw-r--r--indra/newview/llfloaterconversationlog.h2
-rw-r--r--indra/newview/lloutfitgallery.cpp40
-rw-r--r--indra/newview/lloutfitgallery.h1
-rw-r--r--indra/newview/llpaneleditwearable.cpp76
-rw-r--r--indra/newview/llpaneleditwearable.h13
-rw-r--r--indra/newview/llpanelface.cpp413
-rw-r--r--indra/newview/llpanelface.h27
-rw-r--r--indra/newview/llpanelmaininventory.cpp63
-rw-r--r--indra/newview/llpanelmaininventory.h4
-rw-r--r--indra/newview/llpaneloutfitedit.cpp38
-rw-r--r--indra/newview/llpaneloutfitedit.h8
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp11
-rw-r--r--indra/newview/llpaneloutfitsinventory.h1
-rw-r--r--indra/newview/llpanelpeople.cpp77
-rw-r--r--indra/newview/llpanelpeople.h13
-rw-r--r--indra/newview/llscrollingpanelparambase.cpp13
-rw-r--r--indra/newview/llscrollingpanelparambase.h1
-rw-r--r--indra/newview/llsidepanelappearance.cpp7
-rw-r--r--indra/newview/llsidepanelappearance.h4
-rw-r--r--indra/newview/llwearableitemslist.cpp18
-rw-r--r--indra/newview/llwearableitemslist.h2
-rw-r--r--indra/newview/skins/default/xui/en/panel_edit_alpha.xml5
23 files changed, 441 insertions, 401 deletions
diff --git a/indra/newview/llfloaterconversationlog.cpp b/indra/newview/llfloaterconversationlog.cpp
index 648d3af5a5..97399c9cf7 100644
--- a/indra/newview/llfloaterconversationlog.cpp
+++ b/indra/newview/llfloaterconversationlog.cpp
@@ -55,10 +55,11 @@ bool LLFloaterConversationLog::postBuild()
}
// Use the context menu of the Conversation list for the Conversation tab gear menu.
+ mConversationsGearBtn = getChild<LLMenuButton>("conversations_gear_btn");
LLToggleableMenu* conversations_gear_menu = mConversationLogList->getContextMenu();
if (conversations_gear_menu)
{
- getChild<LLMenuButton>("conversations_gear_btn")->setMenu(conversations_gear_menu, LLMenuButton::MP_BOTTOM_LEFT);
+ mConversationsGearBtn->setMenu(conversations_gear_menu, LLMenuButton::MP_BOTTOM_LEFT);
}
getChild<LLFilterEditor>("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterConversationLog::onFilterEdit, this, _2));
@@ -68,7 +69,7 @@ bool LLFloaterConversationLog::postBuild()
void LLFloaterConversationLog::draw()
{
- getChild<LLMenuButton>("conversations_gear_btn")->setEnabled(mConversationLogList->getSelectedItem() != NULL);
+ mConversationsGearBtn->setEnabled(mConversationLogList->getSelectedItem() != NULL);
LLFloater::draw();
}
diff --git a/indra/newview/llfloaterconversationlog.h b/indra/newview/llfloaterconversationlog.h
index 85ca37c530..c82237c108 100644
--- a/indra/newview/llfloaterconversationlog.h
+++ b/indra/newview/llfloaterconversationlog.h
@@ -29,6 +29,7 @@
#include "llfloater.h"
class LLConversationLogList;
+class LLMenuButton;
class LLFloaterConversationLog : public LLFloater
{
@@ -50,6 +51,7 @@ private:
bool isActionChecked(const LLSD& userdata);
LLConversationLogList* mConversationLogList;
+ LLMenuButton* mConversationsGearBtn = nullptr;
};
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index b1b9f69f4f..7482890d1e 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -739,13 +739,16 @@ void LLOutfitGallery::onFilterSubStringChanged(const std::string& new_string, co
void LLOutfitGallery::onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id)
{
- if (mOutfitMap[base_id])
+ auto base_it = mOutfitMap.find(base_id);
+ if (base_it != mOutfitMap.end())
{
- mOutfitMap[base_id]->setOutfitWorn(true);
+ base_it->second->setOutfitWorn(true);
}
- if (mOutfitMap[prev_id])
+
+ auto prev_it = mOutfitMap.find(prev_id);
+ if (prev_it != mOutfitMap.end())
{
- mOutfitMap[prev_id]->setOutfitWorn(false);
+ prev_it->second->setOutfitWorn(false);
}
}
@@ -859,13 +862,16 @@ void LLOutfitGallery::onChangeOutfitSelection(LLWearableItemsList* list, const L
{
if (mSelectedOutfitUUID == category_id)
return;
- if (mOutfitMap[mSelectedOutfitUUID])
+
+ auto selected_it = mOutfitMap.find(mSelectedOutfitUUID);
+ if (selected_it != mOutfitMap.end())
{
- mOutfitMap[mSelectedOutfitUUID]->setSelected(false);
+ selected_it->second->setSelected(false);
}
- if (mOutfitMap[category_id])
+ auto category_it = mOutfitMap.find(category_id);
+ if (category_it != mOutfitMap.end())
{
- mOutfitMap[category_id]->setSelected(true);
+ category_it->second->setSelected(true);
}
// mSelectedOutfitUUID will be set in LLOutfitListBase::ChangeOutfitSelection
}
@@ -887,9 +893,10 @@ bool LLOutfitGallery::canWearSelected()
bool LLOutfitGallery::hasDefaultImage(const LLUUID& outfit_cat_id)
{
- if (mOutfitMap[outfit_cat_id])
+ auto outfit_it = mOutfitMap.find(outfit_cat_id);
+ if (outfit_it != mOutfitMap.end())
{
- return mOutfitMap[outfit_cat_id]->isDefaultImage();
+ return outfit_it->second->isDefaultImage();
}
return false;
}
@@ -937,6 +944,7 @@ LLOutfitGalleryItem::~LLOutfitGalleryItem()
bool LLOutfitGalleryItem::postBuild()
{
+ mPreviewIcon = getChild<LLIconCtrl>("preview_outfit");
setDefaultImage();
mOutfitNameText = getChild<LLTextBox>("outfit_name");
@@ -952,10 +960,12 @@ void LLOutfitGalleryItem::draw()
LLPanel::draw();
// Draw border
- LLUIColor border_color = LLUIColorTable::instance().getColor(mSelected ? "OutfitGalleryItemSelected" : "OutfitGalleryItemUnselected", LLColor4::white);
- LLRect border = getChildView("preview_outfit")->getRect();
+ static LLUIColor selected_color = LLUIColorTable::instance().getColor("OutfitGalleryItemSelected", LLColor4::white);
+ static LLUIColor unselected_color = LLUIColorTable::instance().getColor("OutfitGalleryItemUnselected", LLColor4::white);
+ const LLColor4& border_color = mSelected ? selected_color : unselected_color;
+ LLRect border = mPreviewIcon->getRect();
border.mRight = border.mRight + 1;
- gl_rect_2d(border, border_color.get(), false);
+ gl_rect_2d(border, border_color, false);
// If the floater is focused, don't apply its alpha to the texture (STORM-677).
const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
@@ -1111,7 +1121,7 @@ bool LLOutfitGalleryItem::setImageAssetId(LLUUID image_asset_id)
{
mImageAssetId = image_asset_id;
mTexturep = texture;
- getChildView("preview_outfit")->setVisible(false);
+ mPreviewIcon->setVisible(false);
mDefaultImage = false;
mImageUpdatePending = (texture->getDiscardLevel() == -1);
return true;
@@ -1128,7 +1138,7 @@ void LLOutfitGalleryItem::setDefaultImage()
{
mTexturep = NULL;
mImageAssetId.setNull();
- getChildView("preview_outfit")->setVisible(true);
+ mPreviewIcon->setVisible(true);
mDefaultImage = true;
mImageUpdatePending = false;
}
diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h
index d921a7fe72..5b2a33d0ca 100644
--- a/indra/newview/lloutfitgallery.h
+++ b/indra/newview/lloutfitgallery.h
@@ -261,6 +261,7 @@ private:
LLTextBox* mOutfitNameText;
LLTextBox* mOutfitWornText;
LLPanel* mTextBgPanel;
+ LLIconCtrl* mPreviewIcon = nullptr;
bool mSelected;
bool mWorn;
bool mDefaultImage;
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index e88f6c0470..282b6d4a0a 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -48,6 +48,7 @@
#include "llscrollingpanelparam.h"
#include "llradiogroup.h"
#include "llnotificationsutil.h"
+#include "lliconctrl.h"
#include "llcolorswatch.h"
#include "lltexturectrl.h"
@@ -307,8 +308,8 @@ LLEditWearableDictionary::Subparts::Subparts()
addEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, "mTorso", "physics_breasts_updown", "physics_breasts_updown_param_list", "physics_breasts_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f), SEX_FEMALE));
addEntry(SUBPART_PHYSICS_BREASTS_INOUT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_INOUT, "mTorso", "physics_breasts_inout", "physics_breasts_inout_param_list", "physics_breasts_inout_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE));
addEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, "mTorso", "physics_breasts_leftright", "physics_breasts_leftright_param_list", "physics_breasts_leftright_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE));
- addEntry(SUBPART_PHYSICS_BELLY_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BELLY_UPDOWN, "mTorso", "physics_belly_updown", "physics_belly_updown_param_list", "physics_belly_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_BOTH));
- addEntry(SUBPART_PHYSICS_BUTT_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BUTT_UPDOWN, "mTorso", "physics_butt_updown", "physics_butt_updown_param_list", "physics_butt_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_BOTH));
+ addEntry(SUBPART_PHYSICS_BELLY_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BELLY_UPDOWN, "mTorso", "physics_belly_updown", "physics_belly_updown_param_list", "physics_belly_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_BOTH));
+ addEntry(SUBPART_PHYSICS_BUTT_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BUTT_UPDOWN, "mTorso", "physics_butt_updown", "physics_butt_updown_param_list", "physics_butt_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_BOTH));
addEntry(SUBPART_PHYSICS_BUTT_LEFTRIGHT, new SubpartEntry(SUBPART_PHYSICS_BUTT_LEFTRIGHT, "mTorso", "physics_butt_leftright", "physics_butt_leftright_param_list", "physics_butt_leftright_tab", LLVector3d(0.f, 0.f, 0.f), LLVector3d(0.f, 0.f, 0.f),SEX_BOTH));
addEntry(SUBPART_PHYSICS_ADVANCED, new SubpartEntry(SUBPART_PHYSICS_ADVANCED, "mTorso", "physics_advanced", "physics_advanced_param_list", "physics_advanced_tab", LLVector3d(0.f, 0.f, 0.f), LLVector3d(0.f, 0.f, 0.f),SEX_BOTH));
}
@@ -727,8 +728,14 @@ bool LLPanelEditWearable::postBuild()
mPanelTitle = getChild<LLTextBox>("edit_wearable_title");
mDescTitle = getChild<LLTextBox>("description_text");
- getChild<LLRadioGroup>("sex_radio")->setCommitCallback(boost::bind(&LLPanelEditWearable::onCommitSexChange, this));
- getChild<LLButton>("save_as_button")->setCommitCallback(boost::bind(&LLPanelEditWearable::onSaveAsButtonClicked, this));
+ mSexRadio = getChild<LLRadioGroup>("sex_radio");
+ mSexRadio->setCommitCallback(boost::bind(&LLPanelEditWearable::onCommitSexChange, this));
+
+ mMaleIcon = getChild<LLIconCtrl>("male_icon");
+ mFemaleIcon = getChild<LLIconCtrl>("female_icon");
+
+ mBtnSaveAs = getChild<LLButton>("save_as_button");
+ mBtnSaveAs->setCommitCallback(boost::bind(&LLPanelEditWearable::onSaveAsButtonClicked, this));
// The following panels will be shown/hidden based on what wearable we're editing
// body parts
@@ -806,8 +813,20 @@ bool LLPanelEditWearable::postBuild()
continue;
}
+ mAccordionTabs.emplace(accordion_tab, tab);
+
// initialize callback to ensure camera view changes appropriately.
tab->setDropDownStateChangedCallback(boost::bind(&LLPanelEditWearable::onTabExpandedCollapsed,this,_2,index));
+
+ const std::string& scrolling_panel = subpart_entry->mParamList;
+ if (!scrolling_panel.empty())
+ {
+ LLScrollingPanelList* panel_list = tab->findChild<LLScrollingPanelList>(scrolling_panel);
+ if (panel_list)
+ {
+ mParamPanels.emplace(scrolling_panel, panel_list);
+ }
+ }
}
// initialize texture and color picker controls
@@ -1211,19 +1230,21 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, bool show, bo
continue;
}
- LLScrollingPanelList *panel_list = findChild<LLScrollingPanelList>(scrolling_panel);
- LLAccordionCtrlTab *tab = findChild<LLAccordionCtrlTab>(accordion_tab);
- if (!panel_list)
+ auto accord_it = mAccordionTabs.find(accordion_tab);
+ if (accord_it == mAccordionTabs.end())
{
- LL_WARNS() << "could not get scrolling panel list: " << scrolling_panel << LL_ENDL;
- continue;
+ LL_WARNS() << "could not get llaccordionctrltab from UI with name: " << accordion_tab << LL_ENDL;
+ continue;
}
+ LLAccordionCtrlTab* tab = accord_it->second;
- if (!tab)
+ auto panel_it = mParamPanels.find(scrolling_panel);
+ if (panel_it == mParamPanels.end())
{
- LL_WARNS() << "could not get llaccordionctrltab from UI with name: " << accordion_tab << LL_ENDL;
- continue;
+ LL_WARNS() << "could not get scrolling panel list: " << scrolling_panel << LL_ENDL;
+ continue;
}
+ LLScrollingPanelList *panel_list = panel_it->second;
// Don't show female subparts if you're not female, etc.
if (!(gAgentAvatarp->getSex() & subpart_entry->mSex))
@@ -1237,7 +1258,7 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, bool show, bo
}
// what edit group do we want to extract params for?
- const std::string edit_group = subpart_entry->mEditGroup;
+ const std::string& edit_group = subpart_entry->mEditGroup;
// storage for ordered list of visual params
value_map_t sorted_params;
@@ -1337,9 +1358,9 @@ void LLPanelEditWearable::toggleTypeSpecificControls(LLWearableType::EType type)
// Toggle controls specific to shape editing panel.
{
bool is_shape = (type == LLWearableType::WT_SHAPE);
- getChildView("sex_radio")->setVisible( is_shape);
- getChildView("female_icon")->setVisible( is_shape);
- getChildView("male_icon")->setVisible( is_shape);
+ mSexRadio->setVisible(is_shape);
+ mFemaleIcon->setVisible(is_shape);
+ mMaleIcon->setVisible(is_shape);
}
}
@@ -1400,15 +1421,15 @@ void LLPanelEditWearable::updateScrollingPanelUI()
ESubpart subpart_e = wearable_entry->mSubparts[index];
const LLEditWearableDictionary::SubpartEntry *subpart_entry = LLEditWearableDictionary::getInstance()->getSubpart(subpart_e);
- const std::string scrolling_panel = subpart_entry->mParamList;
-
- LLScrollingPanelList *panel_list = getChild<LLScrollingPanelList>(scrolling_panel);
+ const std::string& scrolling_panel = subpart_entry->mParamList;
- if (!panel_list)
+ auto panel_it = mParamPanels.find(scrolling_panel);
+ if (panel_it == mParamPanels.end())
{
- LL_WARNS() << "could not get scrolling panel list: " << scrolling_panel << LL_ENDL;
- continue;
+ LL_WARNS() << "could not get scrolling panel list: " << scrolling_panel << LL_ENDL;
+ continue;
}
+ LLScrollingPanelList* panel_list = panel_it->second;
panel_list->updatePanels(true);
}
@@ -1542,7 +1563,7 @@ void LLPanelEditWearable::updateVerbs()
bool is_dirty = isDirty();
mBtnRevert->setEnabled(is_dirty);
- getChildView("save_as_button")->setEnabled(is_dirty && can_copy);
+ mBtnSaveAs->setEnabled(is_dirty && can_copy);
if (isAgentAvatarValid())
{
@@ -1580,7 +1601,7 @@ void LLPanelEditWearable::configureAlphaCheckbox(LLAvatarAppearanceDefines::ETex
LLCheckBoxCtrl* checkbox = mPanelAlpha->getChild<LLCheckBoxCtrl>(name);
checkbox->setCommitCallback(boost::bind(&LLPanelEditWearable::onInvisibilityCommit, this, checkbox, te));
- mAlphaCheckbox2Index[name] = te;
+ mAlphaCheckbox2Index.push_back(std::make_pair(checkbox,te));
}
void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LLAvatarAppearanceDefines::ETextureIndex te)
@@ -1637,11 +1658,10 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL
void LLPanelEditWearable::updateAlphaCheckboxes()
{
- for (string_texture_index_map_t::iterator iter = mAlphaCheckbox2Index.begin();
- iter != mAlphaCheckbox2Index.end(); ++iter )
+ for (const auto& check_pair : mAlphaCheckbox2Index)
{
- LLAvatarAppearanceDefines::ETextureIndex te = (LLAvatarAppearanceDefines::ETextureIndex)iter->second;
- LLCheckBoxCtrl* ctrl = mPanelAlpha->getChild<LLCheckBoxCtrl>(iter->first);
+ LLAvatarAppearanceDefines::ETextureIndex te = (LLAvatarAppearanceDefines::ETextureIndex)check_pair.second;
+ LLCheckBoxCtrl* ctrl = check_pair.first;
if (ctrl)
{
ctrl->set(!gAgentAvatarp->isTextureVisible(te, mWearablePtr));
diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h
index aa4ac915c7..443b52b8fc 100644
--- a/indra/newview/llpaneleditwearable.h
+++ b/indra/newview/llpaneleditwearable.h
@@ -44,6 +44,8 @@ class LLViewerJointMesh;
class LLAccordionCtrlTab;
class LLJoint;
class LLLineEditor;
+class LLRadioGroup;
+class LLIconCtrl;
class LLPanelEditWearable : public LLPanel
{
@@ -123,6 +125,7 @@ private:
LLViewerInventoryItem* mWearableItem;
// these are constant no matter what wearable we're editing
+ LLButton* mBtnSaveAs;
LLButton *mBtnRevert;
LLButton *mBtnBack;
std::string mBackBtnLabel;
@@ -131,6 +134,9 @@ private:
LLTextBox *mDescTitle;
LLTextBox *mTxtAvatarHeight;
+ LLRadioGroup* mSexRadio = nullptr;
+ LLIconCtrl* mMaleIcon = nullptr;
+ LLIconCtrl* mFemaleIcon = nullptr;
// localized and parameterized strings that used to build avatar_height_label
std::string mMeters;
@@ -170,8 +176,11 @@ private:
LLPanel *mPanelUniversal;
LLPanel *mPanelPhysics;
- typedef std::map<std::string, LLAvatarAppearanceDefines::ETextureIndex> string_texture_index_map_t;
- string_texture_index_map_t mAlphaCheckbox2Index;
+ std::unordered_map<std::string, LLAccordionCtrlTab*> mAccordionTabs;
+ std::unordered_map<std::string, LLScrollingPanelList*> mParamPanels;
+
+ typedef std::vector<std::pair<LLCheckBoxCtrl*, LLAvatarAppearanceDefines::ETextureIndex>> checkbox_texture_index_vec_t;
+ checkbox_texture_index_vec_t mAlphaCheckbox2Index;
typedef std::map<LLAvatarAppearanceDefines::ETextureIndex, LLUUID> s32_uuid_map_t;
s32_uuid_map_t mPreviousAlphaTexture;
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 00338d3125..0afe967839 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -201,13 +201,11 @@ LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit()
U32 matmedia_selection = mComboMatMedia->getCurrentIndex();
if (matmedia_selection == MATMEDIA_MATERIAL)
{
- LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type");
- channel_to_edit = (LLRender::eTexIndex)radio_mat_type->getSelectedIndex();
+ channel_to_edit = (LLRender::eTexIndex)mRadioMaterialType->getSelectedIndex();
}
if (matmedia_selection == MATMEDIA_PBR)
{
- LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_pbr_type");
- channel_to_edit = (LLRender::eTexIndex)radio_mat_type->getSelectedIndex();
+ channel_to_edit = (LLRender::eTexIndex)mRadioPbrType->getSelectedIndex();
}
}
@@ -220,8 +218,7 @@ LLRender::eTexIndex LLPanelFace::getTextureDropChannel()
{
if (mComboMatMedia && mComboMatMedia->getCurrentIndex() == MATMEDIA_MATERIAL)
{
- LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type");
- return LLRender::eTexIndex(radio_mat_type->getSelectedIndex());
+ return LLRender::eTexIndex(mRadioMaterialType->getSelectedIndex());
}
return LLRender::eTexIndex(MATTYPE_DIFFUSE);
@@ -231,8 +228,7 @@ LLGLTFMaterial::TextureInfo LLPanelFace::getPBRDropChannel()
{
if (mComboMatMedia && mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR)
{
- LLRadioGroup* radio_pbr_type = getChild<LLRadioGroup>("radio_pbr_type");
- return texture_info_from_pbrtype(radio_pbr_type->getSelectedIndex());
+ return texture_info_from_pbrtype(mRadioPbrType->getSelectedIndex());
}
return texture_info_from_pbrtype(PBRTYPE_BASE_COLOR);
@@ -240,8 +236,8 @@ LLGLTFMaterial::TextureInfo LLPanelFace::getPBRDropChannel()
// Things the UI provides...
//
-LLUUID LLPanelFace::getCurrentNormalMap() { return getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID(); }
-LLUUID LLPanelFace::getCurrentSpecularMap() { return getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID(); }
+LLUUID LLPanelFace::getCurrentNormalMap() { return mBumpyTextureCtrl->getImageAssetID(); }
+LLUUID LLPanelFace::getCurrentSpecularMap() { return mShinyTextureCtrl->getImageAssetID(); }
U32 LLPanelFace::getCurrentShininess() { return getChild<LLComboBox>("combobox shininess")->getCurrentIndex(); }
U32 LLPanelFace::getCurrentBumpiness() { return getChild<LLComboBox>("combobox bumpiness")->getCurrentIndex(); }
U8 LLPanelFace::getCurrentDiffuseAlphaMode() { return (U8)getChild<LLComboBox>("combobox alphamode")->getCurrentIndex(); }
@@ -307,41 +303,26 @@ bool LLPanelFace::postBuild()
childSetAction("edit_selected_pbr", &LLPanelFace::onClickBtnEditPBR, this);
childSetAction("save_selected_pbr", &LLPanelFace::onClickBtnSavePBR, this);
- LLTextureCtrl* mTextureCtrl;
- LLTextureCtrl* mShinyTextureCtrl;
- LLTextureCtrl* mBumpyTextureCtrl;
- LLColorSwatchCtrl* mColorSwatch;
- LLColorSwatchCtrl* mShinyColorSwatch;
-
- LLComboBox* mComboTexGen;
-
- LLCheckBoxCtrl *mCheckFullbright;
-
- LLTextBox* mLabelColorTransp;
- LLSpinCtrl* mCtrlColorTransp; // transparency = 1 - alpha
-
- LLSpinCtrl* mCtrlGlow;
-
setMouseOpaque(false);
- LLTextureCtrl* pbr_ctrl = findChild<LLTextureCtrl>("pbr_control");
- if (pbr_ctrl)
+ mPBRTextureCtrl = getChild<LLTextureCtrl>("pbr_control");
+ if (mPBRTextureCtrl)
{
- pbr_ctrl->setDefaultImageAssetID(LLUUID::null);
- pbr_ctrl->setBlankImageAssetID(BLANK_MATERIAL_ASSET_ID);
- pbr_ctrl->setCommitCallback(boost::bind(&LLPanelFace::onCommitPbr, this, _2));
- pbr_ctrl->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelPbr, this, _2));
- pbr_ctrl->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectPbr, this, _2));
- pbr_ctrl->setDragCallback(boost::bind(&LLPanelFace::onDragPbr, this, _2));
- pbr_ctrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onPbrSelectionChanged, this, _1));
- pbr_ctrl->setOnCloseCallback(boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2));
+ mPBRTextureCtrl->setDefaultImageAssetID(LLUUID::null);
+ mPBRTextureCtrl->setBlankImageAssetID(BLANK_MATERIAL_ASSET_ID);
+ mPBRTextureCtrl->setCommitCallback(boost::bind(&LLPanelFace::onCommitPbr, this, _2));
+ mPBRTextureCtrl->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelPbr, this, _2));
+ mPBRTextureCtrl->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectPbr, this, _2));
+ mPBRTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragPbr, this, _2));
+ mPBRTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onPbrSelectionChanged, this, _1));
+ mPBRTextureCtrl->setOnCloseCallback(boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2));
- pbr_ctrl->setFollowsTop();
- pbr_ctrl->setFollowsLeft();
- pbr_ctrl->setImmediateFilterPermMask(PERM_NONE);
- pbr_ctrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
- pbr_ctrl->setBakeTextureEnabled(false);
- pbr_ctrl->setInventoryPickType(PICK_MATERIAL);
+ mPBRTextureCtrl->setFollowsTop();
+ mPBRTextureCtrl->setFollowsLeft();
+ mPBRTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
+ mPBRTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
+ mPBRTextureCtrl->setBakeTextureEnabled(false);
+ mPBRTextureCtrl->setInventoryPickType(PICK_MATERIAL);
}
mTextureCtrl = getChild<LLTextureCtrl>("texture control");
@@ -454,18 +435,18 @@ bool LLPanelFace::postBuild()
mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL);
}
- LLRadioGroup* radio_mat_type = findChild<LLRadioGroup>("radio_material_type");
- if(radio_mat_type)
+ mRadioMaterialType = getChild<LLRadioGroup>("radio_material_type");
+ if(mRadioMaterialType)
{
- radio_mat_type->setCommitCallback(LLPanelFace::onCommitMaterialType, this);
- radio_mat_type->selectNthItem(MATTYPE_DIFFUSE);
+ mRadioMaterialType->setCommitCallback(LLPanelFace::onCommitMaterialType, this);
+ mRadioMaterialType->selectNthItem(MATTYPE_DIFFUSE);
}
- LLRadioGroup* radio_pbr_type = findChild<LLRadioGroup>("radio_pbr_type");
- if (radio_pbr_type)
+ mRadioPbrType = getChild<LLRadioGroup>("radio_pbr_type");
+ if (mRadioPbrType)
{
- radio_pbr_type->setCommitCallback(LLPanelFace::onCommitPbrType, this);
- radio_pbr_type->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID);
+ mRadioPbrType->setCommitCallback(LLPanelFace::onCommitPbrType, this);
+ mRadioPbrType->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID);
}
mCtrlGlow = getChild<LLSpinCtrl>("glow");
@@ -532,7 +513,6 @@ void LLPanelFace::draw()
void LLPanelFace::sendTexture()
{
- LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("texture control");
if(!mTextureCtrl) return;
if( !mTextureCtrl->getTentative() )
{
@@ -553,17 +533,16 @@ void LLPanelFace::sendTexture()
void LLPanelFace::sendBump(U32 bumpiness)
{
- LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
if (bumpiness < BUMPY_TEXTURE)
{
LL_DEBUGS("Materials") << "clearing bumptexture control" << LL_ENDL;
- bumpytexture_ctrl->clear();
- bumpytexture_ctrl->setImageAssetID(LLUUID());
+ mBumpyTextureCtrl->clear();
+ mBumpyTextureCtrl->setImageAssetID(LLUUID());
}
updateBumpyControls(bumpiness == BUMPY_TEXTURE, true);
- LLUUID current_normal_map = bumpytexture_ctrl->getImageAssetID();
+ LLUUID current_normal_map = mBumpyTextureCtrl->getImageAssetID();
U8 bump = (U8) bumpiness & TEM_BUMP_MASK;
@@ -576,25 +555,21 @@ void LLPanelFace::sendBump(U32 bumpiness)
//
LLSelectedTEMaterial::setNormalID(this, current_normal_map);
- LLSelectMgr::getInstance()->selectionSetBumpmap( bump, bumpytexture_ctrl->getImageItemID() );
+ LLSelectMgr::getInstance()->selectionSetBumpmap( bump, mBumpyTextureCtrl->getImageItemID() );
}
void LLPanelFace::sendTexGen()
{
- LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen");
- if(!mComboTexGen)return;
U8 tex_gen = (U8) mComboTexGen->getCurrentIndex() << TEM_TEX_GEN_SHIFT;
LLSelectMgr::getInstance()->selectionSetTexGen( tex_gen );
}
void LLPanelFace::sendShiny(U32 shininess)
{
- LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("shinytexture control");
-
if (shininess < SHINY_TEXTURE)
{
- texture_ctrl->clear();
- texture_ctrl->setImageAssetID(LLUUID());
+ mShinyTextureCtrl->clear();
+ mShinyTextureCtrl->setImageAssetID(LLUUID());
}
LLUUID specmap = getCurrentSpecularMap();
@@ -605,7 +580,7 @@ void LLPanelFace::sendShiny(U32 shininess)
LLSelectedTEMaterial::setSpecularID(this, specmap);
- LLSelectMgr::getInstance()->selectionSetShiny( shiny, texture_ctrl->getImageItemID() );
+ LLSelectMgr::getInstance()->selectionSetShiny( shiny, mShinyTextureCtrl->getImageItemID() );
updateShinyControls(!specmap.isNull(), true);
@@ -613,7 +588,6 @@ void LLPanelFace::sendShiny(U32 shininess)
void LLPanelFace::sendFullbright()
{
- LLCheckBoxCtrl* mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright");
if(!mCheckFullbright)return;
U8 fullbright = mCheckFullbright->get() ? TEM_FULLBRIGHT_MASK : 0;
LLSelectMgr::getInstance()->selectionSetFullbright( fullbright );
@@ -621,8 +595,6 @@ void LLPanelFace::sendFullbright()
void LLPanelFace::sendColor()
{
-
- LLColorSwatchCtrl* mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(!mColorSwatch)return;
LLColor4 color = mColorSwatch->get();
@@ -631,7 +603,6 @@ void LLPanelFace::sendColor()
void LLPanelFace::sendAlpha()
{
- LLSpinCtrl* mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans");
if(!mCtrlColorTransp)return;
F32 alpha = (100.f - mCtrlColorTransp->get()) / 100.f;
@@ -641,8 +612,6 @@ void LLPanelFace::sendAlpha()
void LLPanelFace::sendGlow()
{
- LLSpinCtrl* mCtrlGlow = getChild<LLSpinCtrl>("glow");
- llassert(mCtrlGlow);
if (mCtrlGlow)
{
F32 glow = mCtrlGlow->get();
@@ -996,14 +965,13 @@ void LLPanelFace::sendTextureInfo()
LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc);
}
-void LLPanelFace::alignTestureLayer()
+void LLPanelFace::alignTextureLayer()
{
LLFace* last_face = NULL;
bool identical_face = false;
LLSelectedTE::getFace(last_face, identical_face);
- LLRadioGroup * radio_mat_type = getChild<LLRadioGroup>("radio_material_type");
- LLPanelFaceSetAlignedConcreteTEFunctor setfunc(this, last_face, static_cast<LLRender::eTexIndex>(radio_mat_type->getSelectedIndex()));
+ LLPanelFaceSetAlignedConcreteTEFunctor setfunc(this, last_face, static_cast<LLRender::eTexIndex>(mRadioMaterialType->getSelectedIndex()));
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc);
}
@@ -1055,10 +1023,6 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
bool identical_norm = false;
bool identical_spec = false;
- LLTextureCtrl *texture_ctrl = getChild<LLTextureCtrl>("texture control");
- LLTextureCtrl *shinytexture_ctrl = getChild<LLTextureCtrl>("shinytexture control");
- LLTextureCtrl *bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
-
LLUUID id;
LLUUID normmap_id;
LLUUID specmap_id;
@@ -1122,21 +1086,19 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
}
mComboMatMedia->setEnabled(editable);
- LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type");
- if (radio_mat_type->getSelectedIndex() < MATTYPE_DIFFUSE)
+ if (mRadioMaterialType->getSelectedIndex() < MATTYPE_DIFFUSE)
{
- radio_mat_type->selectNthItem(MATTYPE_DIFFUSE);
+ mRadioMaterialType->selectNthItem(MATTYPE_DIFFUSE);
}
- radio_mat_type->setEnabled(editable);
+ mRadioMaterialType->setEnabled(editable);
- LLRadioGroup* radio_pbr_type = getChild<LLRadioGroup>("radio_pbr_type");
- if (radio_pbr_type->getSelectedIndex() < PBRTYPE_RENDER_MATERIAL_ID)
+ if (mRadioPbrType->getSelectedIndex() < PBRTYPE_RENDER_MATERIAL_ID)
{
- radio_pbr_type->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID);
+ mRadioPbrType->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID);
}
- radio_pbr_type->setEnabled(editable);
+ mRadioPbrType->setEnabled(editable);
const bool pbr_selected = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR;
- const bool texture_info_selected = pbr_selected && radio_pbr_type->getSelectedIndex() != PBRTYPE_RENDER_MATERIAL_ID;
+ const bool texture_info_selected = pbr_selected && mRadioPbrType->getSelectedIndex() != PBRTYPE_RENDER_MATERIAL_ID;
getChildView("checkbox_sync_settings")->setEnabled(editable);
childSetValue("checkbox_sync_settings", gSavedSettings.getBOOL("SyncMaterialSettings"));
@@ -1147,30 +1109,28 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
{
getChildView("color label")->setEnabled(editable);
}
- LLColorSwatchCtrl* color_swatch = findChild<LLColorSwatchCtrl>("colorswatch");
LLColor4 color = LLColor4::white;
bool identical_color = false;
- if (color_swatch)
{
LLSelectedTE::getColor(color, identical_color);
- LLColor4 prev_color = color_swatch->get();
+ LLColor4 prev_color = mColorSwatch->get();
- color_swatch->setOriginal(color);
- color_swatch->set(color, force_set_values || (prev_color != color) || !editable);
+ mColorSwatch->setOriginal(color);
+ mColorSwatch->set(color, force_set_values || (prev_color != color) || !editable);
- color_swatch->setValid(editable && !has_pbr_material);
- color_swatch->setEnabled( editable && !has_pbr_material);
- color_swatch->setCanApplyImmediately( editable && !has_pbr_material);
+ mColorSwatch->setValid(editable && !has_pbr_material);
+ mColorSwatch->setEnabled( editable && !has_pbr_material);
+ mColorSwatch->setCanApplyImmediately( editable && !has_pbr_material);
}
// Color transparency
- getChildView("color trans")->setEnabled(editable);
+ mLabelColorTransp->setEnabled(editable);
F32 transparency = (1.f - color.mV[VALPHA]) * 100.f;
- getChild<LLUICtrl>("ColorTrans")->setValue(editable ? transparency : 0);
- getChildView("ColorTrans")->setEnabled(editable && has_material);
+ mCtrlColorTransp->setValue(editable ? transparency : 0);
+ mCtrlColorTransp->setEnabled(editable && has_material);
U8 shiny = 0;
bool identical_shiny = false;
@@ -1200,10 +1160,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
getChild<LLUICtrl>("combobox shininess")->setTentative(!identical_spec);
getChild<LLUICtrl>("glossiness")->setTentative(!identical_spec);
getChild<LLUICtrl>("environment")->setTentative(!identical_spec);
- getChild<LLUICtrl>("shinycolorswatch")->setTentative(!identical_spec);
+ mShinyColorSwatch->setTentative(!identical_spec);
- LLColorSwatchCtrl* mShinyColorSwatch = getChild<LLColorSwatchCtrl>("shinycolorswatch");
- if (mShinyColorSwatch)
{
mShinyColorSwatch->setValid(editable);
mShinyColorSwatch->setEnabled( editable );
@@ -1304,13 +1262,13 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
updateAlphaControls();
- if (texture_ctrl)
+ if (mTextureCtrl)
{
if (identical_diffuse)
{
- texture_ctrl->setTentative(false);
- texture_ctrl->setEnabled(editable && !has_pbr_material);
- texture_ctrl->setImageAssetID(id);
+ mTextureCtrl->setTentative(false);
+ mTextureCtrl->setEnabled(editable && !has_pbr_material);
+ mTextureCtrl->setImageAssetID(id);
bool can_change_alpha = editable && mIsAlpha && !missing_asset && !has_pbr_material;
getChildView("combobox alphamode")->setEnabled(can_change_alpha && transparency <= 0.f);
@@ -1318,27 +1276,27 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
getChildView("maskcutoff")->setEnabled(can_change_alpha);
getChildView("label maskcutoff")->setEnabled(can_change_alpha);
- texture_ctrl->setBakeTextureEnabled(true);
+ mTextureCtrl->setBakeTextureEnabled(true);
}
else if (id.isNull())
{
// None selected
- texture_ctrl->setTentative(false);
- texture_ctrl->setEnabled(false);
- texture_ctrl->setImageAssetID(LLUUID::null);
+ mTextureCtrl->setTentative(false);
+ mTextureCtrl->setEnabled(false);
+ mTextureCtrl->setImageAssetID(LLUUID::null);
getChildView("combobox alphamode")->setEnabled(false);
getChildView("label alphamode")->setEnabled(false);
getChildView("maskcutoff")->setEnabled(false);
getChildView("label maskcutoff")->setEnabled(false);
- texture_ctrl->setBakeTextureEnabled(false);
+ mTextureCtrl->setBakeTextureEnabled(false);
}
else
{
// Tentative: multiple selected with different textures
- texture_ctrl->setTentative(true);
- texture_ctrl->setEnabled(editable && !has_pbr_material);
- texture_ctrl->setImageAssetID(id);
+ mTextureCtrl->setTentative(true);
+ mTextureCtrl->setEnabled(editable && !has_pbr_material);
+ mTextureCtrl->setImageAssetID(id);
bool can_change_alpha = editable && mIsAlpha && !missing_asset && !has_pbr_material;
getChildView("combobox alphamode")->setEnabled(can_change_alpha && transparency <= 0.f);
@@ -1346,7 +1304,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
getChildView("maskcutoff")->setEnabled(can_change_alpha);
getChildView("label maskcutoff")->setEnabled(can_change_alpha);
- texture_ctrl->setBakeTextureEnabled(true);
+ mTextureCtrl->setBakeTextureEnabled(true);
}
if (attachment)
@@ -1354,43 +1312,43 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
// attachments are in world and in inventory,
// server doesn't support changing permissions
// in such case
- texture_ctrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
+ mTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
}
else
{
- texture_ctrl->setImmediateFilterPermMask(PERM_NONE);
+ mTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
}
}
- if (shinytexture_ctrl)
+ if (mShinyTextureCtrl)
{
- shinytexture_ctrl->setTentative( !identical_spec );
- shinytexture_ctrl->setEnabled( editable && !has_pbr_material);
- shinytexture_ctrl->setImageAssetID( specmap_id );
+ mShinyTextureCtrl->setTentative( !identical_spec );
+ mShinyTextureCtrl->setEnabled( editable && !has_pbr_material);
+ mShinyTextureCtrl->setImageAssetID( specmap_id );
if (attachment)
{
- shinytexture_ctrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
+ mShinyTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
}
else
{
- shinytexture_ctrl->setImmediateFilterPermMask(PERM_NONE);
+ mShinyTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
}
}
- if (bumpytexture_ctrl)
+ if (mBumpyTextureCtrl)
{
- bumpytexture_ctrl->setTentative( !identical_norm );
- bumpytexture_ctrl->setEnabled( editable && !has_pbr_material);
- bumpytexture_ctrl->setImageAssetID( normmap_id );
+ mBumpyTextureCtrl->setTentative( !identical_norm );
+ mBumpyTextureCtrl->setEnabled( editable && !has_pbr_material);
+ mBumpyTextureCtrl->setImageAssetID( normmap_id );
if (attachment)
{
- bumpytexture_ctrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
+ mBumpyTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
}
else
{
- bumpytexture_ctrl->setImmediateFilterPermMask(PERM_NONE);
+ mBumpyTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
}
}
}
@@ -1621,26 +1579,18 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
F32 glow = 0.f;
bool identical_glow = false;
LLSelectedTE::getGlow(glow,identical_glow);
- getChild<LLUICtrl>("glow")->setValue(glow);
- getChild<LLUICtrl>("glow")->setTentative(!identical_glow);
- getChildView("glow")->setEnabled(editable);
+ mCtrlGlow->setValue(glow);
+ mCtrlGlow->setTentative(!identical_glow);
+ mCtrlGlow->setEnabled(editable);
getChildView("glow label")->setEnabled(editable);
}
{
- LLCtrlSelectionInterface* combobox_texgen = childGetSelectionInterface("combobox texgen");
- if (combobox_texgen)
- {
- // Maps from enum to combobox entry index
- combobox_texgen->selectNthItem(((S32)selected_texgen) >> 1);
- }
- else
- {
- LL_WARNS() << "failed childGetSelectionInterface for 'combobox texgen'" << LL_ENDL;
- }
+ // Maps from enum to combobox entry index
+ mComboTexGen->selectNthItem(((S32)selected_texgen) >> 1);
- getChildView("combobox texgen")->setEnabled(editable);
- getChild<LLUICtrl>("combobox texgen")->setTentative(!identical);
+ mComboTexGen->setEnabled(editable);
+ mComboTexGen->setTentative(!identical);
getChildView("tex gen")->setEnabled(editable);
}
@@ -1650,9 +1600,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
LLSelectedTE::getFullbright(fullbright_flag,identical_fullbright);
- getChild<LLUICtrl>("checkbox fullbright")->setValue((S32)(fullbright_flag != 0));
- getChildView("checkbox fullbright")->setEnabled(editable && !has_pbr_material);
- getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical_fullbright);
+ mCheckFullbright->setValue((S32)(fullbright_flag != 0));
+ mCheckFullbright->setEnabled(editable && !has_pbr_material);
+ mCheckFullbright->setTentative(!identical_fullbright);
mComboMatMedia->setEnabledByValue("Materials", !has_pbr_material);
}
@@ -1670,8 +1620,6 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
LLSelectedTEMaterial::getMaxNormalRepeats(repeats_norm, identical_norm_repeats);
LLSelectedTEMaterial::getMaxSpecularRepeats(repeats_spec, identical_spec_repeats);
- LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen");
- if (mComboTexGen)
{
S32 index = mComboTexGen ? mComboTexGen->getCurrentIndex() : 0;
bool enabled = editable && (index != 1);
@@ -1682,12 +1630,12 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
U32 material_type = MATTYPE_DIFFUSE;
if (material_selection == MATMEDIA_MATERIAL)
{
- material_type = radio_mat_type->getSelectedIndex();
+ material_type = mRadioMaterialType->getSelectedIndex();
}
else if (material_selection == MATMEDIA_PBR)
{
enabled = editable && has_pbr_material;
- material_type = radio_pbr_type->getSelectedIndex();
+ material_type = mRadioPbrType->getSelectedIndex();
}
switch (material_type)
@@ -1783,8 +1731,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
// Shiny (specular)
F32 offset_x, offset_y, repeat_x, repeat_y, rot;
- LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("shinytexture control");
- texture_ctrl->setImageAssetID(material->getSpecularID());
+ mShinyTextureCtrl->setImageAssetID(material->getSpecularID());
if (!material->getSpecularID().isNull() && (shiny == SHINY_TEXTURE))
{
@@ -1814,17 +1761,15 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
//
if (!material->getSpecularID().isNull())
{
- LLColorSwatchCtrl* shiny_swatch = getChild<LLColorSwatchCtrl>("shinycolorswatch");
LLColor4 new_color = material->getSpecularLightColor();
- LLColor4 old_color = shiny_swatch->get();
+ LLColor4 old_color = mShinyColorSwatch->get();
- shiny_swatch->setOriginal(new_color);
- shiny_swatch->set(new_color, force_set_values || old_color != new_color || !editable);
+ mShinyColorSwatch->setOriginal(new_color);
+ mShinyColorSwatch->set(new_color, force_set_values || old_color != new_color || !editable);
}
// Bumpy (normal)
- texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
- texture_ctrl->setImageAssetID(material->getNormalID());
+ mBumpyTextureCtrl->setImageAssetID(material->getNormalID());
if (!material->getNormalID().isNull())
{
@@ -1859,8 +1804,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
calcp->setVar(LLCalc::TEX_U_OFFSET, (F32)childGetValue("TexOffsetU").asReal());
calcp->setVar(LLCalc::TEX_V_OFFSET, (F32)childGetValue("TexOffsetV").asReal());
calcp->setVar(LLCalc::TEX_ROTATION, (F32)childGetValue("TexRot").asReal());
- calcp->setVar(LLCalc::TEX_TRANSPARENCY, (F32)childGetValue("ColorTrans").asReal());
- calcp->setVar(LLCalc::TEX_GLOW, (F32)childGetValue("glow").asReal());
+ calcp->setVar(LLCalc::TEX_TRANSPARENCY, (F32)mCtrlColorTransp->getValue().asReal());
+ calcp->setVar(LLCalc::TEX_GLOW, (F32)mCtrlGlow->getValue().asReal());
}
else
{
@@ -1868,32 +1813,31 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
clearCtrls();
// Disable non-UICtrls
- LLTextureCtrl* pbr_ctrl = findChild<LLTextureCtrl>("pbr_control");
- if (pbr_ctrl)
+ if (mPBRTextureCtrl)
{
- pbr_ctrl->setImageAssetID(LLUUID::null);
- pbr_ctrl->setEnabled(false);
+ mPBRTextureCtrl->setImageAssetID(LLUUID::null);
+ mPBRTextureCtrl->setEnabled(false);
}
- LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
- if (texture_ctrl)
+
+ if (mTextureCtrl)
{
- texture_ctrl->setImageAssetID( LLUUID::null );
- texture_ctrl->setEnabled( false ); // this is a LLUICtrl, but we don't want it to have keyboard focus so we add it as a child, not a ctrl.
-// texture_ctrl->setValid(false);
+ mTextureCtrl->setImageAssetID( LLUUID::null );
+ mTextureCtrl->setEnabled( false ); // this is a LLUICtrl, but we don't want it to have keyboard focus so we add it as a child, not a ctrl.
+// mTextureCtrl->setValid(false);
}
- LLColorSwatchCtrl* mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
+
if (mColorSwatch)
{
mColorSwatch->setEnabled( false );
mColorSwatch->setFallbackImage(LLUI::getUIImage("locked_image.j2c") );
mColorSwatch->setValid(false);
}
- LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type");
- if (radio_mat_type)
+
+ if (mRadioMaterialType)
{
- radio_mat_type->setSelectedIndex(0);
+ mRadioMaterialType->setSelectedIndex(0);
}
- getChildView("color trans")->setEnabled(false);
+ mLabelColorTransp->setEnabled(false);
getChildView("rptctrl")->setEnabled(false);
getChildView("tex gen")->setEnabled(false);
getChildView("label shininess")->setEnabled(false);
@@ -2005,23 +1949,22 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
const bool saveable = LLMaterialEditor::canSaveObjectsMaterial();
// pbr material
- LLTextureCtrl* pbr_ctrl = findChild<LLTextureCtrl>("pbr_control");
LLUUID pbr_id;
- if (pbr_ctrl)
+ if (mPBRTextureCtrl)
{
LLSelectedTE::getPbrMaterialId(pbr_id, identical_pbr, has_pbr_material, has_faces_without_pbr);
- pbr_ctrl->setTentative(!identical_pbr);
- pbr_ctrl->setEnabled(settable);
- pbr_ctrl->setImageAssetID(pbr_id);
+ mPBRTextureCtrl->setTentative(!identical_pbr);
+ mPBRTextureCtrl->setEnabled(settable);
+ mPBRTextureCtrl->setImageAssetID(pbr_id);
if (objectp->isAttachment())
{
- pbr_ctrl->setFilterPermissionMasks(PERM_COPY | PERM_TRANSFER | PERM_MODIFY);
+ mPBRTextureCtrl->setFilterPermissionMasks(PERM_COPY | PERM_TRANSFER | PERM_MODIFY);
}
else
{
- pbr_ctrl->setImmediateFilterPermMask(PERM_NONE);
+ mPBRTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
}
}
@@ -2080,13 +2023,12 @@ void LLPanelFace::updateVisibilityGLTF(LLViewerObject* objectp /*= nullptr */)
const bool show_pbr = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR && mComboMatMedia->getEnabled();
const bool inventory_pending = objectp && objectp->isInventoryPending();
- LLRadioGroup* radio_pbr_type = findChild<LLRadioGroup>("radio_pbr_type");
- radio_pbr_type->setVisible(show_pbr);
+ mRadioPbrType->setVisible(show_pbr);
- const U32 pbr_type = radio_pbr_type->getSelectedIndex();
+ const U32 pbr_type = mRadioPbrType->getSelectedIndex();
const bool show_pbr_render_material_id = show_pbr && (pbr_type == PBRTYPE_RENDER_MATERIAL_ID);
- getChildView("pbr_control")->setVisible(show_pbr_render_material_id);
+ mPBRTextureCtrl->setVisible(show_pbr_render_material_id);
getChildView("pbr_from_inventory")->setVisible(show_pbr_render_material_id);
getChildView("edit_selected_pbr")->setVisible(show_pbr_render_material_id && !inventory_pending);
@@ -2890,7 +2832,7 @@ void LLPanelFace::onCommitColor(const LLSD& data)
void LLPanelFace::onCommitShinyColor(const LLSD& data)
{
- LLSelectedTEMaterial::setSpecularLightColor(this, getChild<LLColorSwatchCtrl>("shinycolorswatch")->get());
+ LLSelectedTEMaterial::setSpecularLightColor(this, mShinyColorSwatch->get());
}
void LLPanelFace::onCommitAlpha(const LLSD& data)
@@ -2916,7 +2858,7 @@ void LLPanelFace::onSelectColor(const LLSD& data)
void LLPanelFace::onSelectShinyColor(const LLSD& data)
{
- LLSelectedTEMaterial::setSpecularLightColor(this, getChild<LLColorSwatchCtrl>("shinycolorswatch")->get());
+ LLSelectedTEMaterial::setSpecularLightColor(this, mShinyColorSwatch->get());
LLSelectMgr::getInstance()->saveSelectedShinyColors();
}
@@ -2935,33 +2877,31 @@ void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata)
void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */)
{
- LLRadioGroup* radio_mat_type = findChild<LLRadioGroup>("radio_material_type");
- LLRadioGroup* radio_pbr_type = findChild<LLRadioGroup>("radio_pbr_type");
LLComboBox* combo_shininess = findChild<LLComboBox>("combobox shininess");
LLComboBox* combo_bumpiness = findChild<LLComboBox>("combobox bumpiness");
- if (!radio_mat_type || !radio_pbr_type || !mComboMatMedia || !combo_shininess || !combo_bumpiness)
+ if (!mRadioMaterialType || !mRadioPbrType || !mComboMatMedia || !combo_shininess || !combo_bumpiness)
{
LL_WARNS("Materials") << "Combo box not found...exiting." << LL_ENDL;
return;
}
U32 materials_media = mComboMatMedia->getCurrentIndex();
- U32 material_type = radio_mat_type->getSelectedIndex();
+ U32 material_type = mRadioMaterialType->getSelectedIndex();
bool show_media = (materials_media == MATMEDIA_MEDIA) && mComboMatMedia->getEnabled();
bool show_material = materials_media == MATMEDIA_MATERIAL;
bool show_texture = (show_media || (show_material && (material_type == MATTYPE_DIFFUSE) && mComboMatMedia->getEnabled()));
bool show_bumpiness = show_material && (material_type == MATTYPE_NORMAL) && mComboMatMedia->getEnabled();
bool show_shininess = show_material && (material_type == MATTYPE_SPECULAR) && mComboMatMedia->getEnabled();
const bool show_pbr = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR && mComboMatMedia->getEnabled();
- const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ const U32 pbr_type = mRadioPbrType->getSelectedIndex();
const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type);
const bool show_pbr_asset = show_pbr && texture_info == LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT;
- radio_mat_type->setVisible(show_material);
+ mRadioMaterialType->setVisible(show_material);
// Shared material controls
getChildView("checkbox_sync_settings")->setVisible(show_material || show_media);
getChildView("tex gen")->setVisible(show_material || show_media || show_pbr_asset);
- getChildView("combobox texgen")->setVisible(show_material || show_media || show_pbr_asset);
+ mComboTexGen->setVisible(show_material || show_media || show_pbr_asset);
getChildView("button align textures")->setVisible(show_material || show_media);
// Media controls
@@ -2971,7 +2911,7 @@ void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */)
getChildView("button align")->setVisible(show_media);
// Diffuse texture controls
- getChildView("texture control")->setVisible(show_texture && show_material);
+ mTextureCtrl->setVisible(show_texture && show_material);
getChildView("label alphamode")->setVisible(show_texture && show_material);
getChildView("combobox alphamode")->setVisible(show_texture && show_material);
getChildView("label maskcutoff")->setVisible(false);
@@ -2988,7 +2928,7 @@ void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */)
getChildView("TexOffsetV")->setVisible(show_texture);
// Specular map controls
- getChildView("shinytexture control")->setVisible(show_shininess);
+ mShinyTextureCtrl->setVisible(show_shininess);
getChildView("combobox shininess")->setVisible(show_shininess);
getChildView("label shininess")->setVisible(show_shininess);
getChildView("label glossiness")->setVisible(false);
@@ -2996,7 +2936,7 @@ void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */)
getChildView("label environment")->setVisible(false);
getChildView("environment")->setVisible(false);
getChildView("label shinycolor")->setVisible(false);
- getChildView("shinycolorswatch")->setVisible(false);
+ mShinyColorSwatch->setVisible(false);
if (show_shininess)
{
updateShinyControls();
@@ -3012,7 +2952,7 @@ void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */)
{
updateBumpyControls();
}
- getChildView("bumpytexture control")->setVisible(show_bumpiness);
+ mBumpyTextureCtrl->setVisible(show_bumpiness);
getChildView("combobox bumpiness")->setVisible(show_bumpiness);
getChildView("label bumpiness")->setVisible(show_bumpiness);
getChildView("bumpyScaleU")->setVisible(show_bumpiness);
@@ -3073,8 +3013,7 @@ void LLPanelFace::onCommitTexGen(LLUICtrl* ctrl, void* userdata)
// static
void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_shiny_combobox)
{
- LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("shinytexture control");
- LLUUID shiny_texture_ID = texture_ctrl->getImageAssetID();
+ LLUUID shiny_texture_ID = mShinyTextureCtrl->getImageAssetID();
LL_DEBUGS("Materials") << "Shiny texture selected: " << shiny_texture_ID << LL_ENDL;
LLComboBox* comboShiny = getChild<LLComboBox>("combobox shininess");
@@ -3110,10 +3049,8 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh
}
}
-
- LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type");
U32 materials_media = mComboMatMedia->getCurrentIndex();
- U32 material_type = radio_mat_type->getSelectedIndex();
+ U32 material_type = mRadioMaterialType->getSelectedIndex();
bool show_material = (materials_media == MATMEDIA_MATERIAL);
bool show_shininess = show_material && (material_type == MATTYPE_SPECULAR) && mComboMatMedia->getEnabled();
U32 shiny_value = comboShiny->getCurrentIndex();
@@ -3123,14 +3060,13 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh
getChildView("label environment")->setVisible(show_shinyctrls);
getChildView("environment")->setVisible(show_shinyctrls);
getChildView("label shinycolor")->setVisible(show_shinyctrls);
- getChildView("shinycolorswatch")->setVisible(show_shinyctrls);
+ mShinyColorSwatch->setVisible(show_shinyctrls);
}
// static
void LLPanelFace::updateBumpyControls(bool is_setting_texture, bool mess_with_combobox)
{
- LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
- LLUUID bumpy_texture_ID = texture_ctrl->getImageAssetID();
+ LLUUID bumpy_texture_ID = mBumpyTextureCtrl->getImageAssetID();
LL_DEBUGS("Materials") << "texture: " << bumpy_texture_ID << (mess_with_combobox ? "" : " do not") << " update combobox" << LL_ENDL;
LLComboBox* comboBumpy = getChild<LLComboBox>("combobox bumpiness");
if (!comboBumpy)
@@ -3140,10 +3076,6 @@ void LLPanelFace::updateBumpyControls(bool is_setting_texture, bool mess_with_co
if (mess_with_combobox)
{
- LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
- LLUUID bumpy_texture_ID = texture_ctrl->getImageAssetID();
- LL_DEBUGS("Materials") << "texture: " << bumpy_texture_ID << (mess_with_combobox ? "" : " do not") << " update combobox" << LL_ENDL;
-
if (!bumpy_texture_ID.isNull() && is_setting_texture)
{
if (!comboBumpy->itemExists(USE_TEXTURE))
@@ -3196,10 +3128,9 @@ void LLPanelFace::updateAlphaControls()
}
U32 mat_type = MATTYPE_DIFFUSE;
- LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type");
- if(radio_mat_type)
+ if(mRadioMaterialType)
{
- mat_type = radio_mat_type->getSelectedIndex();
+ mat_type = mRadioMaterialType->getSelectedIndex();
}
show_alphactrls = show_alphactrls && (mat_media == MATMEDIA_MATERIAL);
@@ -3251,20 +3182,19 @@ bool LLPanelFace::onDragPbr(LLUICtrl*, LLInventoryItem* item)
void LLPanelFace::onCommitPbr(const LLSD& data)
{
- LLTextureCtrl* pbr_ctrl = findChild<LLTextureCtrl>("pbr_control");
- if (!pbr_ctrl) return;
- if (!pbr_ctrl->getTentative())
+ if (!mPBRTextureCtrl) return;
+ if (!mPBRTextureCtrl->getTentative())
{
// we grab the item id first, because we want to do a
// permissions check in the selection manager. ARGH!
- LLUUID id = pbr_ctrl->getImageItemID();
+ LLUUID id = mPBRTextureCtrl->getImageItemID();
if (id.isNull())
{
- id = pbr_ctrl->getImageAssetID();
+ id = mPBRTextureCtrl->getImageAssetID();
}
if (!LLSelectMgr::getInstance()->selectionSetGLTFMaterial(id))
{
- // If failed to set material, refresh pbr_ctrl's value
+ // If failed to set material, refresh mPBRTextureCtrl's value
refresh();
}
}
@@ -3279,16 +3209,15 @@ void LLPanelFace::onSelectPbr(const LLSD& data)
{
LLSelectMgr::getInstance()->saveSelectedObjectTextures();
- LLTextureCtrl* pbr_ctrl = findChild<LLTextureCtrl>("pbr_control");
- if (!pbr_ctrl) return;
- if (!pbr_ctrl->getTentative())
+ if (!mPBRTextureCtrl) return;
+ if (!mPBRTextureCtrl->getTentative())
{
// we grab the item id first, because we want to do a
// permissions check in the selection manager. ARGH!
- LLUUID id = pbr_ctrl->getImageItemID();
+ LLUUID id = mPBRTextureCtrl->getImageItemID();
if (id.isNull())
{
- id = pbr_ctrl->getImageAssetID();
+ id = mPBRTextureCtrl->getImageAssetID();
}
if (!LLSelectMgr::getInstance()->selectionSetGLTFMaterial(id))
{
@@ -3388,7 +3317,7 @@ void LLPanelFace::onCancelSpecularTexture(const LLSD& data)
U8 shiny = 0;
bool identical_shiny = false;
LLSelectedTE::getShiny(shiny, identical_shiny);
- LLUUID spec_map_id = getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID();
+ LLUUID spec_map_id = mShinyTextureCtrl->getImageAssetID();
shiny = spec_map_id.isNull() ? shiny : SHINY_TEXTURE;
sendShiny(shiny);
}
@@ -3398,7 +3327,7 @@ void LLPanelFace::onCancelNormalTexture(const LLSD& data)
U8 bumpy = 0;
bool identical_bumpy = false;
LLSelectedTE::getBumpmap(bumpy, identical_bumpy);
- LLUUID spec_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID();
+ LLUUID spec_map_id = mBumpyTextureCtrl->getImageAssetID();
bumpy = spec_map_id.isNull() ? bumpy : BUMPY_TEXTURE;
sendBump(bumpy);
}
@@ -3869,13 +3798,11 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata)
U32 material_type = 0;
if (materials_media == MATMEDIA_PBR)
{
- LLRadioGroup *radio_mat_type = self->getChild<LLRadioGroup>("radio_pbr_type");
- material_type = radio_mat_type->getSelectedIndex();
+ material_type = self->mRadioPbrType->getSelectedIndex();
}
if (materials_media == MATMEDIA_MATERIAL)
{
- LLRadioGroup *radio_mat_type = self->getChild<LLRadioGroup>("radio_material_type");
- material_type = radio_mat_type->getSelectedIndex();
+ material_type = self->mRadioMaterialType->getSelectedIndex();
}
F32 repeats_per_meter = (F32) repeats_ctrl->getValue().asReal();
@@ -4003,15 +3930,14 @@ void LLPanelFace::onClickAutoFix(void* userdata)
void LLPanelFace::onAlignTexture(void* userdata)
{
LLPanelFace* self = (LLPanelFace*)userdata;
- self->alignTestureLayer();
+ self->alignTextureLayer();
}
void LLPanelFace::onClickBtnLoadInvPBR(void* userdata)
{
// Shouldn't this be "save to inventory?"
LLPanelFace* self = (LLPanelFace*)userdata;
- LLTextureCtrl* pbr_ctrl = self->findChild<LLTextureCtrl>("pbr_control");
- pbr_ctrl->showPicker(true);
+ self->mPBRTextureCtrl->showPicker(true);
}
void LLPanelFace::onClickBtnEditPBR(void* userdata)
@@ -4916,7 +4842,7 @@ void LLPanelFace::updateGLTFTextureTransform(float value, U32 pbr_type, std::fun
void LLPanelFace::setMaterialOverridesFromSelection()
{
- const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ const U32 pbr_type = mRadioPbrType->getSelectedIndex();
const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type);
U32 texture_info_start;
U32 texture_info_end;
@@ -5086,7 +5012,7 @@ bool LLPanelFace::Selection::compareSelection()
void LLPanelFace::onCommitGLTFTextureScaleU(LLUICtrl* ctrl)
{
const float value = (F32)ctrl->getValue().asReal();
- const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ const U32 pbr_type = mRadioPbrType->getSelectedIndex();
updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
{
new_transform->mScale.mV[VX] = value;
@@ -5096,7 +5022,7 @@ void LLPanelFace::onCommitGLTFTextureScaleU(LLUICtrl* ctrl)
void LLPanelFace::onCommitGLTFTextureScaleV(LLUICtrl* ctrl)
{
const float value = (F32)ctrl->getValue().asReal();
- const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ const U32 pbr_type = mRadioPbrType->getSelectedIndex();
updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
{
new_transform->mScale.mV[VY] = value;
@@ -5106,7 +5032,7 @@ void LLPanelFace::onCommitGLTFTextureScaleV(LLUICtrl* ctrl)
void LLPanelFace::onCommitGLTFRotation(LLUICtrl* ctrl)
{
const float value = (F32)ctrl->getValue().asReal() * DEG_TO_RAD;
- const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ const U32 pbr_type = mRadioPbrType->getSelectedIndex();
updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
{
new_transform->mRotation = value;
@@ -5116,7 +5042,7 @@ void LLPanelFace::onCommitGLTFRotation(LLUICtrl* ctrl)
void LLPanelFace::onCommitGLTFTextureOffsetU(LLUICtrl* ctrl)
{
const float value = (F32)ctrl->getValue().asReal();
- const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ const U32 pbr_type = mRadioPbrType->getSelectedIndex();
updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
{
new_transform->mOffset.mV[VX] = value;
@@ -5126,7 +5052,7 @@ void LLPanelFace::onCommitGLTFTextureOffsetU(LLUICtrl* ctrl)
void LLPanelFace::onCommitGLTFTextureOffsetV(LLUICtrl* ctrl)
{
const float value = (F32)ctrl->getValue().asReal();
- const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ const U32 pbr_type = mRadioPbrType->getSelectedIndex();
updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
{
new_transform->mOffset.mV[VY] = value;
@@ -5136,12 +5062,8 @@ void LLPanelFace::onCommitGLTFTextureOffsetV(LLUICtrl* ctrl)
void LLPanelFace::onTextureSelectionChanged(LLInventoryItem* itemp)
{
LL_DEBUGS("Materials") << "item asset " << itemp->getAssetUUID() << LL_ENDL;
- LLRadioGroup* radio_mat_type = findChild<LLRadioGroup>("radio_material_type");
- if(!radio_mat_type)
- {
- return;
- }
- U32 mattype = radio_mat_type->getSelectedIndex();
+
+ U32 mattype = mRadioMaterialType->getSelectedIndex();
std::string which_control="texture control";
switch (mattype)
{
@@ -5187,8 +5109,7 @@ void LLPanelFace::onTextureSelectionChanged(LLInventoryItem* itemp)
void LLPanelFace::onPbrSelectionChanged(LLInventoryItem* itemp)
{
- LLTextureCtrl* pbr_ctrl = findChild<LLTextureCtrl>("pbr_control");
- if (pbr_ctrl)
+ if (mPBRTextureCtrl)
{
LLUUID obj_owner_id;
std::string obj_owner_name;
@@ -5206,12 +5127,12 @@ void LLPanelFace::onPbrSelectionChanged(LLInventoryItem* itemp)
if ((can_copy && can_transfer && can_modify) || from_library)
{
- pbr_ctrl->setCanApply(true, true);
+ mPBRTextureCtrl->setCanApply(true, true);
return;
}
// if material has (no-transfer) attribute it can be applied only for object which we own and is not for sale
- pbr_ctrl->setCanApply(false, can_transfer ? true : is_object_owner && not_for_sale);
+ mPBRTextureCtrl->setCanApply(false, can_transfer ? true : is_object_owner && not_for_sale);
if (gSavedSettings.getBOOL("TextureLivePreview"))
{
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 7e1553c80a..6e88116a2d 100644
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -52,6 +52,7 @@ class LLFloater;
class LLMaterialID;
class LLMediaCtrl;
class LLMenuButton;
+class LLRadioGroup;
class PBRPickerAgentListener;
class PBRPickerObjectListener;
@@ -147,7 +148,7 @@ protected:
void sendFullbright(); // applies and sends full bright
void sendGlow();
- void alignTestureLayer();
+ void alignTextureLayer();
void updateCopyTexButton();
@@ -291,9 +292,27 @@ private:
F32 getCurrentShinyOffsetU();
F32 getCurrentShinyOffsetV();
- LLComboBox *mComboMatMedia;
- LLMediaCtrl *mTitleMedia;
- LLTextBox *mTitleMediaText;
+ LLTextureCtrl* mPBRTextureCtrl = nullptr;
+ LLTextureCtrl* mTextureCtrl = nullptr;
+ LLTextureCtrl* mShinyTextureCtrl = nullptr;
+ LLTextureCtrl* mBumpyTextureCtrl = nullptr;
+ LLColorSwatchCtrl* mColorSwatch = nullptr;
+ LLColorSwatchCtrl* mShinyColorSwatch = nullptr;
+
+ LLComboBox* mComboTexGen = nullptr;
+
+ LLRadioGroup* mRadioMaterialType = nullptr;
+ LLRadioGroup* mRadioPbrType = nullptr;
+
+ LLCheckBoxCtrl* mCheckFullbright = nullptr;
+
+ LLTextBox* mLabelColorTransp = nullptr;
+ LLSpinCtrl* mCtrlColorTransp = nullptr; // transparency = 1 - alpha
+
+ LLSpinCtrl* mCtrlGlow = nullptr;
+ LLComboBox *mComboMatMedia = nullptr;
+ LLMediaCtrl *mTitleMedia = nullptr;
+ LLTextBox *mTitleMediaText = nullptr;
// Update visibility of controls to match current UI mode
// (e.g. materials vs media editing)
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index bbf533b694..fd7085c452 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -154,28 +154,30 @@ bool LLPanelMainInventory::postBuild()
//panel->getFilter().markDefault();
// Set up the default inv. panel/filter settings.
- mActivePanel = getChild<LLInventoryPanel>(ALL_ITEMS);
- if (mActivePanel)
+ mAllItemsPanel = getChild<LLInventoryPanel>(ALL_ITEMS);
+ if (mAllItemsPanel)
{
// "All Items" is the previous only view, so it gets the InventorySortOrder
- mActivePanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
- mActivePanel->getFilter().markDefault();
- mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
- mActivePanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mActivePanel, _1, _2));
+ mAllItemsPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
+ mAllItemsPanel->getFilter().markDefault();
+ mAllItemsPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
+ mAllItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mAllItemsPanel, _1, _2));
mResortActivePanel = true;
}
- LLInventoryPanel* recent_items_panel = getChild<LLInventoryPanel>(RECENT_ITEMS);
- if (recent_items_panel)
+ mActivePanel = mAllItemsPanel;
+
+ mRecentPanel = getChild<LLInventoryPanel>(RECENT_ITEMS);
+ if (mRecentPanel)
{
// assign default values until we will be sure that we have setting to restore
- recent_items_panel->setSinceLogoff(true);
- recent_items_panel->setSortOrder(LLInventoryFilter::SO_DATE);
- recent_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
- LLInventoryFilter& recent_filter = recent_items_panel->getFilter();
+ mRecentPanel->setSinceLogoff(true);
+ mRecentPanel->setSortOrder(LLInventoryFilter::SO_DATE);
+ mRecentPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
+ LLInventoryFilter& recent_filter = mRecentPanel->getFilter();
recent_filter.setFilterObjectTypes(recent_filter.getFilterObjectTypes() & ~(0x1 << LLInventoryType::IT_CATEGORY));
recent_filter.setEmptyLookupMessage("InventoryNoMatchingRecentItems");
recent_filter.markDefault();
- recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2));
+ mRecentPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mRecentPanel, _1, _2));
}
mWornItemsPanel = getChild<LLInventoryPanel>(WORN_ITEMS);
@@ -211,17 +213,17 @@ bool LLPanelMainInventory::postBuild()
// Load the persistent "Recent Items" settings.
// Note that the "All Items" settings do not persist.
- if(recent_items_panel)
+ if(mRecentPanel)
{
- if(savedFilterState.has(recent_items_panel->getFilter().getName()))
+ if(savedFilterState.has(mRecentPanel->getFilter().getName()))
{
LLSD recent_items = savedFilterState.get(
- recent_items_panel->getFilter().getName());
+ mRecentPanel->getFilter().getName());
LLInventoryFilter::Params p;
LLParamSDParser parser;
parser.readSD(recent_items, p);
- recent_items_panel->getFilter().fromParams(p);
- recent_items_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::RECENTITEMS_SORT_ORDER));
+ mRecentPanel->getFilter().fromParams(p);
+ mRecentPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::RECENTITEMS_SORT_ORDER));
}
}
if(mActivePanel)
@@ -362,7 +364,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel()
{
- return getChild<LLInventoryPanel>(ALL_ITEMS);
+ return mAllItemsPanel;
}
void LLPanelMainInventory::selectAllItemsPanel()
@@ -372,7 +374,7 @@ void LLPanelMainInventory::selectAllItemsPanel()
bool LLPanelMainInventory::isRecentItemsPanelSelected()
{
- return (RECENT_ITEMS == getActivePanel()->getName());
+ return (mRecentPanel == getActivePanel());
}
void LLPanelMainInventory::startSearch()
@@ -1077,8 +1079,8 @@ void LLPanelMainInventory::toggleFindOptions()
void LLPanelMainInventory::setSelectCallback(const LLFolderView::signal_t::slot_type& cb)
{
- getChild<LLInventoryPanel>(ALL_ITEMS)->setSelectCallback(cb);
- getChild<LLInventoryPanel>(RECENT_ITEMS)->setSelectCallback(cb);
+ mAllItemsPanel->setSelectCallback(cb);
+ mRecentPanel->setSelectCallback(cb);
}
void LLPanelMainInventory::onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, bool user_action)
@@ -1482,10 +1484,10 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data)
void LLPanelMainInventory::initListCommandsHandlers()
{
childSetAction("add_btn", boost::bind(&LLPanelMainInventory::onAddButtonClick, this));
- childSetAction("view_mode_btn", boost::bind(&LLPanelMainInventory::onViewModeClick, this));
- childSetAction("up_btn", boost::bind(&LLPanelMainInventory::onUpFolderClicked, this));
- childSetAction("back_btn", boost::bind(&LLPanelMainInventory::onBackFolderClicked, this));
- childSetAction("forward_btn", boost::bind(&LLPanelMainInventory::onForwardFolderClicked, this));
+ mViewModeBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onViewModeClick, this));
+ mUpBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onUpFolderClicked, this));
+ mBackBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onBackFolderClicked, this));
+ mForwardBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onForwardFolderClicked, this));
mCommitCallbackRegistrar.add("Inventory.GearDefault.Custom.Action", boost::bind(&LLPanelMainInventory::onCustomAction, this, _2));
mEnableCallbackRegistrar.add("Inventory.GearDefault.Check", boost::bind(&LLPanelMainInventory::isActionChecked, this, _2));
@@ -1550,12 +1552,9 @@ void LLPanelMainInventory::initSingleFolderRoot(const LLUUID& start_folder_id)
void LLPanelMainInventory::initInventoryViews()
{
- LLInventoryPanel* all_item = getChild<LLInventoryPanel>(ALL_ITEMS);
- all_item->initializeViewBuilding();
- LLInventoryPanel* recent_item = getChild<LLInventoryPanel>(RECENT_ITEMS);
- recent_item->initializeViewBuilding();
- LLInventoryPanel* worn_item = getChild<LLInventoryPanel>(WORN_ITEMS);
- worn_item->initializeViewBuilding();
+ mAllItemsPanel->initializeViewBuilding();
+ mRecentPanel->initializeViewBuilding();
+ mWornItemsPanel->initializeViewBuilding();
}
void LLPanelMainInventory::toggleViewMode()
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index cad2501645..68ac3410d8 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -184,7 +184,9 @@ private:
LLUICtrl* mCounterCtrl;
LLHandle<LLFloater> mFinderHandle;
LLInventoryPanel* mActivePanel;
- LLInventoryPanel* mWornItemsPanel;
+ LLInventoryPanel* mAllItemsPanel = nullptr;
+ LLInventoryPanel* mRecentPanel = nullptr;
+ LLInventoryPanel* mWornItemsPanel = nullptr;
bool mResortActivePanel;
LLSaveFolderState* mSavedFolderState;
std::string mFilterText;
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index ce545ae21d..4cd4afaa5a 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -434,6 +434,8 @@ LLPanelOutfitEdit::~LLPanelOutfitEdit()
delete mCOFDragAndDropObserver;
+ delete mWearableListViewItemsComparator;
+
while (!mListViewItemTypes.empty()) {
delete mListViewItemTypes.back();
mListViewItemTypes.pop_back();
@@ -476,8 +478,10 @@ bool LLPanelOutfitEdit::postBuild()
mFolderViewBtn = getChild<LLButton>("folder_view_btn");
mListViewBtn = getChild<LLButton>("list_view_btn");
+ mFilterPanel = getChild<LLView>("filter_panel");
+ mFilterBtn = getChild<LLButton>("filter_button");
+ mFilterBtn->setCommitCallback(boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this));
- childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL);
childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesFolderView, this), NULL);
childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL);
childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL);
@@ -530,13 +534,17 @@ bool LLPanelOutfitEdit::postBuild()
mSearchFilter = getChild<LLFilterEditor>("look_item_filter");
mSearchFilter->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onSearchEdit, this, _2));
- childSetAction("show_add_wearables_btn", boost::bind(&LLPanelOutfitEdit::onAddMoreButtonClicked, this));
+ mShowAddWearablesBtn = getChild<LLButton>("show_add_wearables_btn");
+ mShowAddWearablesBtn->setClickedCallback(boost::bind(&LLPanelOutfitEdit::onAddMoreButtonClicked, this));
mPlusBtn = getChild<LLButton>("plus_btn");
mPlusBtn->setClickedCallback(boost::bind(&LLPanelOutfitEdit::onPlusBtnClicked, this));
childSetAction(REVERT_BTN, boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance()));
+ mNoAddWearablesButtonBar = getChild<LLUICtrl>("no_add_wearables_button_bar");
+ mAddWearablesButtonBar = getChild<LLUICtrl>("add_wearables_button_bar");
+
/*
* By default AT_CLOTHING are sorted by (in in MY OUTFITS):
* - by type (types order determined in LLWearableType::EType)
@@ -567,7 +575,11 @@ bool LLPanelOutfitEdit::postBuild()
getChild<LLButton>(SAVE_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitEdit::saveOutfit, this, false));
getChild<LLButton>(SAVE_AS_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitEdit::saveOutfit, this, true));
+ mLoadingIndicator = getChild<LLLoadingIndicator>("edit_outfit_loading_indicator");
+ mOutfitNameStatusPanel = getChild<LLPanel>("outfit_name_and_status");
+
onOutfitChanging(gAgentWearables.isCOFChangeInProgress());
+
return true;
}
@@ -603,15 +615,15 @@ void LLPanelOutfitEdit::showAddWearablesPanel(bool show_add_wearables)
{
mAddWearablesPanel->setVisible(show_add_wearables);
- getChild<LLUICtrl>("show_add_wearables_btn")->setValue(show_add_wearables);
+ mShowAddWearablesBtn->setValue(show_add_wearables);
updateFiltersVisibility();
- getChildView("filter_button")->setVisible( show_add_wearables);
+ mFilterBtn->setVisible( show_add_wearables);
//search filter should be disabled
if (!show_add_wearables)
{
- getChild<LLUICtrl>("filter_button")->setValue(false);
+ mFilterBtn->setValue(false);
mFolderViewFilterCmbBox->setVisible(false);
mListViewFilterCmbBox->setVisible(false);
@@ -638,15 +650,15 @@ void LLPanelOutfitEdit::showAddWearablesPanel(bool show_add_wearables)
}
//switching button bars
- getChildView("no_add_wearables_button_bar")->setVisible( !show_add_wearables);
- getChildView("add_wearables_button_bar")->setVisible( show_add_wearables);
+ mNoAddWearablesButtonBar->setVisible( !show_add_wearables);
+ mAddWearablesButtonBar->setVisible( show_add_wearables);
}
void LLPanelOutfitEdit::showWearablesFilter()
{
- bool filter_visible = getChild<LLUICtrl>("filter_button")->getValue();
+ bool filter_visible = mFilterBtn->getValue();
- getChildView("filter_panel")->setVisible( filter_visible);
+ mFilterPanel->setVisible(filter_visible);
if(!filter_visible)
{
@@ -1309,19 +1321,17 @@ static void update_status_widget_rect(LLView * widget, S32 right_border)
void LLPanelOutfitEdit::onOutfitChanging(bool started)
{
- static LLLoadingIndicator* indicator = getChild<LLLoadingIndicator>("edit_outfit_loading_indicator");
- static LLView* status_panel = getChild<LLView>("outfit_name_and_status");
- static S32 indicator_delta = status_panel->getRect().getWidth() - indicator->getRect().mLeft;
+ S32 indicator_delta = mOutfitNameStatusPanel->getRect().getWidth() - mLoadingIndicator->getRect().mLeft;
S32 delta = started ? indicator_delta : 0;
- S32 right_border = status_panel->getRect().getWidth() - delta;
+ S32 right_border = mOutfitNameStatusPanel->getRect().getWidth() - delta;
if (mCurrentOutfitName)
update_status_widget_rect(mCurrentOutfitName, right_border);
if (mStatus)
update_status_widget_rect(mStatus, right_border);
- indicator->setVisible(started);
+ mLoadingIndicator->setVisible(started);
}
void LLPanelOutfitEdit::getCurrentItemUUID(LLUUID& selected_id)
diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h
index 384b7faee4..a989d93d9e 100644
--- a/indra/newview/llpaneloutfitedit.h
+++ b/indra/newview/llpaneloutfitedit.h
@@ -59,6 +59,7 @@ class LLMenuGL;
class LLFindNonLinksByMask;
class LLFindWearablesOfType;
class LLWearableItemTypeNameComparator;
+class LLLoadingIndicator;
class LLPanelOutfitEdit : public LLPanel
{
@@ -218,7 +219,14 @@ private:
LLButton* mFolderViewBtn;
LLButton* mListViewBtn;
LLButton* mPlusBtn;
+ LLButton* mShowAddWearablesBtn = nullptr;
+ LLButton* mFilterBtn = nullptr;
LLPanel* mAddWearablesPanel;
+ LLPanel* mOutfitNameStatusPanel = nullptr;
+ LLLoadingIndicator* mLoadingIndicator = nullptr;
+ LLView* mFilterPanel = nullptr;
+ LLUICtrl* mNoAddWearablesButtonBar = nullptr;
+ LLUICtrl* mAddWearablesButtonBar = nullptr;
LLComboBox* mFolderViewFilterCmbBox;
LLComboBox* mListViewFilterCmbBox;
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 5b595a48b7..47c02793a3 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -252,7 +252,8 @@ void LLPanelOutfitsInventory::openApearanceTab(const std::string& tab_name)
void LLPanelOutfitsInventory::initListCommandsHandlers()
{
mListCommands = getChild<LLPanel>("bottom_panel");
- mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this));
+ mWearBtn = mListCommands->getChild<LLButton>("wear_btn");
+ mWearBtn->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this));
mMyOutfitsPanel->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this));
mOutfitGalleryPanel->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this));
}
@@ -263,14 +264,12 @@ void LLPanelOutfitsInventory::updateListCommands()
bool wear_enabled = isActionEnabled("wear");
bool wear_visible = !isCOFPanelActive();
bool make_outfit_enabled = isActionEnabled("save_outfit");
-
- LLButton* wear_btn = mListCommands->getChild<LLButton>("wear_btn");
mMyOutfitsPanel->childSetEnabled("trash_btn", trash_enabled);
mOutfitGalleryPanel->childSetEnabled("trash_btn", trash_enabled);
- wear_btn->setEnabled(wear_enabled);
- wear_btn->setVisible(wear_visible);
+ mWearBtn->setEnabled(wear_enabled);
+ mWearBtn->setVisible(wear_visible);
getChild<LLButton>(SAVE_BTN)->setEnabled(make_outfit_enabled);
- wear_btn->setToolTip(getString((!isOutfitsGalleryPanelActive() && mMyOutfitsPanel->hasItemSelected()) ? "wear_items_tooltip" : "wear_outfit_tooltip"));
+ mWearBtn->setToolTip(getString((!isOutfitsGalleryPanelActive() && mMyOutfitsPanel->hasItemSelected()) ? "wear_items_tooltip" : "wear_outfit_tooltip"));
}
void LLPanelOutfitsInventory::onTrashButtonClick()
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index 0c501d5c71..e046681e95 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -101,6 +101,7 @@ protected:
private:
LLPanel* mListCommands;
LLMenuGL* mMenuAdd;
+ LLButton* mWearBtn = nullptr;
// List Commands //
//////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 7f64cfca08..2f0a8f7656 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -153,8 +153,6 @@ public:
id_it = uuids.begin(),
id_end = uuids.end();
- LLAvatarItemDistanceComparator::id_to_pos_map_t pos_map;
-
mAvatarsPositions.clear();
for (;pos_it != pos_end && id_it != id_end; ++pos_it, ++id_it )
@@ -618,15 +616,13 @@ bool LLPanelPeople::postBuild()
{
S32 max_premium = LLAgentBenefitsMgr::get("Premium").getGroupMembershipLimit();
- mNearbyFilterCommitConnection = getChild<LLFilterEditor>("nearby_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
- mFriedsFilterCommitConnection = getChild<LLFilterEditor>("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
- mGroupsFilterCommitConnection = getChild<LLFilterEditor>("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
- mRecentFilterCommitConnection = getChild<LLFilterEditor>("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
-
+ LLPanel* group_tab = getChild<LLPanel>(GROUP_TAB_NAME);
+ mGroupDelBtn = group_tab->getChild<LLButton>("minus_btn");
+ mGroupCountText = group_tab->getChild<LLTextBox>("groupcount");
if(LLAgentBenefitsMgr::current().getGroupMembershipLimit() < max_premium)
{
- getChild<LLTextBox>("groupcount")->setText(getString("GroupCountWithInfo"));
- getChild<LLTextBox>("groupcount")->setURLClickedCallback(boost::bind(&LLPanelPeople::onGroupLimitInfo, this));
+ mGroupCountText->setText(getString("GroupCountWithInfo"));
+ mGroupCountText->setURLClickedCallback(boost::bind(&LLPanelPeople::onGroupLimitInfo, this));
}
mTabContainer = getChild<LLTabContainer>("tabs");
@@ -639,40 +635,56 @@ bool LLPanelPeople::postBuild()
friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2));
friends_tab->setVisibleCallback(boost::bind(&LLPanelPeople::removePicker, this));
+ mFriendsGearBtn = friends_tab->getChild<LLButton>("gear_btn");
+ mFriendsDelFriendBtn = friends_tab->getChild<LLUICtrl>("friends_del_btn");
+
mOnlineFriendList = friends_tab->getChild<LLAvatarList>("avatars_online");
mAllFriendList = friends_tab->getChild<LLAvatarList>("avatars_all");
mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online"));
mOnlineFriendList->setShowIcons("FriendsListShowIcons");
- mOnlineFriendList->showPermissions("FriendsListShowPermissions");
+ mOnlineFriendList->showPermissions(gSavedSettings.getBOOL("FriendsListShowPermissions"));
mOnlineFriendList->setShowCompleteName(!gSavedSettings.getBOOL("FriendsListHideUsernames"));
mAllFriendList->setNoItemsCommentText(getString("no_friends"));
mAllFriendList->setShowIcons("FriendsListShowIcons");
- mAllFriendList->showPermissions("FriendsListShowPermissions");
+ mAllFriendList->showPermissions(gSavedSettings.getBOOL("FriendsListShowPermissions"));
mAllFriendList->setShowCompleteName(!gSavedSettings.getBOOL("FriendsListHideUsernames"));
LLPanel* nearby_tab = getChild<LLPanel>(NEARBY_TAB_NAME);
nearby_tab->setVisibleCallback(boost::bind(&Updater::setActive, mNearbyListUpdater, _2));
+
mNearbyList = nearby_tab->getChild<LLAvatarList>("avatar_list");
mNearbyList->setNoItemsCommentText(getString("no_one_near"));
mNearbyList->setNoItemsMsg(getString("no_one_near"));
mNearbyList->setNoFilteredItemsMsg(getString("no_one_filtered_near"));
mNearbyList->setShowIcons("NearbyListShowIcons");
mNearbyList->setShowCompleteName(!gSavedSettings.getBOOL("NearbyListHideUsernames"));
- mMiniMap = (LLNetMap*)getChildView("Net Map",true);
+ mMiniMap = nearby_tab->getChild<LLNetMap>("Net Map", true);
mMiniMap->setToolTipMsg(gSavedSettings.getBOOL("DoubleClickTeleport") ?
getString("AltMiniMapToolTipMsg") : getString("MiniMapToolTipMsg"));
- mRecentList = getChild<LLPanel>(RECENT_TAB_NAME)->getChild<LLAvatarList>("avatar_list");
+ mNearbyGearBtn = nearby_tab->getChild<LLButton>("gear_btn");
+ mNearbyAddFriendBtn = nearby_tab->getChild<LLButton>("add_friend_btn");
+
+ LLPanel* recent_tab = getChild<LLPanel>(RECENT_TAB_NAME);
+ mRecentList = recent_tab->getChild<LLAvatarList>("avatar_list");
mRecentList->setNoItemsCommentText(getString("no_recent_people"));
mRecentList->setNoItemsMsg(getString("no_recent_people"));
mRecentList->setNoFilteredItemsMsg(getString("no_filtered_recent_people"));
mRecentList->setShowIcons("RecentListShowIcons");
- mGroupList = getChild<LLGroupList>("group_list");
+ mRecentGearBtn = recent_tab->getChild<LLButton>("gear_btn");
+ mRecentAddFriendBtn = recent_tab->getChild<LLButton>("add_friend_btn");
+
+ mGroupList = group_tab->getChild<LLGroupList>("group_list");
mGroupList->setNoItemsCommentText(getString("no_groups_msg"));
mGroupList->setNoItemsMsg(getString("no_groups_msg"));
mGroupList->setNoFilteredItemsMsg(getString("no_filtered_groups_msg"));
+ mNearbyFilterCommitConnection = nearby_tab->getChild<LLFilterEditor>("nearby_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mFriedsFilterCommitConnection = friends_tab->getChild<LLFilterEditor>("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mRecentFilterCommitConnection = recent_tab->getChild<LLFilterEditor>("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mGroupsFilterCommitConnection = group_tab->getChild<LLFilterEditor>("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+
mNearbyList->setContextMenu(&LLPanelPeopleMenus::gNearbyPeopleContextMenu);
mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
@@ -850,10 +862,11 @@ void LLPanelPeople::updateRecentList()
void LLPanelPeople::updateButtons()
{
- std::string cur_tab = getActiveTabName();
+ const std::string& cur_tab = getActiveTabName();
+ bool nearby_tab_active = (cur_tab == NEARBY_TAB_NAME);
bool friends_tab_active = (cur_tab == FRIENDS_TAB_NAME);
bool group_tab_active = (cur_tab == GROUP_TAB_NAME);
- //bool recent_tab_active = (cur_tab == RECENT_TAB_NAME);
+ bool recent_tab_active = (cur_tab == RECENT_TAB_NAME);
LLUUID selected_id;
uuid_vec_t selected_uuids;
@@ -868,14 +881,13 @@ void LLPanelPeople::updateButtons()
selected_id = mGroupList->getSelectedUUID();
}
- LLPanel* groups_panel = mTabContainer->getCurrentPanel();
- groups_panel->getChildView("minus_btn")->setEnabled(item_selected && selected_id.notNull()); // a real group selected
+ mGroupDelBtn->setEnabled(item_selected && selected_id.notNull()); // a real group selected
U32 groups_count = static_cast<U32>(gAgent.mGroups.size());
U32 max_groups = LLAgentBenefitsMgr::current().getGroupMembershipLimit();
U32 groups_remaining = max_groups > groups_count ? max_groups - groups_count : 0;
- groups_panel->getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d", groups_count));
- groups_panel->getChild<LLUICtrl>("groupcount")->setTextArg("[REMAINING]", llformat("%d", groups_remaining));
+ mGroupCountText->setTextArg("[COUNT]", llformat("%d", groups_count));
+ mGroupCountText->setTextArg("[REMAINING]", llformat("%d", groups_remaining));
}
else
{
@@ -889,33 +901,36 @@ void LLPanelPeople::updateButtons()
is_self = gAgent.getID() == selected_id;
}
- LLPanel* cur_panel = mTabContainer->getCurrentPanel();
- if (cur_panel)
{
- if (cur_panel->hasChild("add_friend_btn", true))
- cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self);
+ if(nearby_tab_active)
+ {
+ mNearbyAddFriendBtn->setEnabled(item_selected && !is_friend && !is_self);
+ mNearbyGearBtn->setEnabled(multiple_selected);
+ }
if (friends_tab_active)
{
- cur_panel->getChildView("friends_del_btn")->setEnabled(multiple_selected);
+ mFriendsDelFriendBtn->setEnabled(multiple_selected);
+ mFriendsGearBtn->setEnabled(multiple_selected);
}
- if (!group_tab_active)
+ if (recent_tab_active)
{
- cur_panel->getChildView("gear_btn")->setEnabled(multiple_selected);
+ mRecentAddFriendBtn->setEnabled(item_selected && !is_friend && !is_self);
+ mRecentGearBtn->setEnabled(multiple_selected);
}
}
}
}
-std::string LLPanelPeople::getActiveTabName() const
+const std::string& LLPanelPeople::getActiveTabName() const
{
return mTabContainer->getCurrentPanel()->getName();
}
LLUUID LLPanelPeople::getCurrentItemID() const
{
- std::string cur_tab = getActiveTabName();
+ const std::string& cur_tab = getActiveTabName();
if (cur_tab == FRIENDS_TAB_NAME) // this tab has two lists
{
@@ -945,7 +960,7 @@ LLUUID LLPanelPeople::getCurrentItemID() const
void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const
{
- std::string cur_tab = getActiveTabName();
+ const std::string& cur_tab = getActiveTabName();
if (cur_tab == FRIENDS_TAB_NAME)
{
@@ -1033,7 +1048,7 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string)
saved_filter = search_upper;
// Apply new filter to the current tab.
- const std::string cur_tab = getActiveTabName();
+ const std::string& cur_tab = getActiveTabName();
if (cur_tab == NEARBY_TAB_NAME)
{
mNearbyList->setNameFilter(filter);
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 768ba1ef49..445bc4c081 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -84,7 +84,7 @@ private:
bool isItemsFreeOfFriends(const uuid_vec_t& uuids);
void updateButtons();
- std::string getActiveTabName() const;
+ const std::string& getActiveTabName() const;
LLUUID getCurrentItemID() const;
void getCurrentItemIDs(uuid_vec_t& selected_uuids) const;
void setSortOrder(LLAvatarList* list, ESortOrder order, bool save = true);
@@ -139,6 +139,17 @@ private:
LLGroupList* mGroupList;
LLNetMap* mMiniMap;
+ LLButton* mNearbyGearBtn = nullptr;
+ LLButton* mFriendsGearBtn = nullptr;
+ LLButton* mRecentGearBtn = nullptr;
+ LLButton* mGroupDelBtn = nullptr;
+
+ LLButton* mNearbyAddFriendBtn = nullptr;
+ LLButton* mRecentAddFriendBtn = nullptr;
+ LLUICtrl* mFriendsDelFriendBtn = nullptr;
+
+ LLTextBox* mGroupCountText = nullptr;
+
std::vector<std::string> mSavedOriginalFilters;
std::vector<std::string> mSavedFilters;
diff --git a/indra/newview/llscrollingpanelparambase.cpp b/indra/newview/llscrollingpanelparambase.cpp
index 247639aa48..d6b5434fa4 100644
--- a/indra/newview/llscrollingpanelparambase.cpp
+++ b/indra/newview/llscrollingpanelparambase.cpp
@@ -51,12 +51,13 @@ LLScrollingPanelParamBase::LLScrollingPanelParamBase( const LLPanel::Params& pan
else
buildFromFile( "panel_scrolling_param_base.xml");
- getChild<LLUICtrl>("param slider")->setValue(weightToPercent(param->getWeight()));
+ mParamSlider = getChild<LLUICtrl>("param slider");
+ mParamSlider->setValue(weightToPercent(param->getWeight()));
std::string display_name = LLTrans::getString(param->getDisplayName());
- getChild<LLUICtrl>("param slider")->setLabelArg("[DESC]", display_name);
- getChildView("param slider")->setEnabled(mAllowModify);
- childSetCommitCallback("param slider", LLScrollingPanelParamBase::onSliderMoved, this);
+ mParamSlider->setLabelArg("[DESC]", display_name);
+ mParamSlider->setEnabled(mAllowModify);
+ mParamSlider->setCommitCallback(LLScrollingPanelParamBase::onSliderMoved, this);
setVisible(false);
setBorderVisible( false );
@@ -77,9 +78,9 @@ void LLScrollingPanelParamBase::updatePanel(bool allow_modify)
}
F32 current_weight = mWearable->getVisualParamWeight( param->getID() );
- getChild<LLUICtrl>("param slider")->setValue(weightToPercent( current_weight ) );
+ mParamSlider->setValue(weightToPercent( current_weight ) );
mAllowModify = allow_modify;
- getChildView("param slider")->setEnabled(mAllowModify);
+ mParamSlider->setEnabled(mAllowModify);
}
// static
diff --git a/indra/newview/llscrollingpanelparambase.h b/indra/newview/llscrollingpanelparambase.h
index 9deafcc81a..d5477a8397 100644
--- a/indra/newview/llscrollingpanelparambase.h
+++ b/indra/newview/llscrollingpanelparambase.h
@@ -55,6 +55,7 @@ public:
public:
LLViewerVisualParam* mParam;
protected:
+ LLUICtrl* mParamSlider = nullptr;
bool mAllowModify;
LLWearable *mWearable;
};
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index 35d07d1ac8..c618483fc4 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -39,6 +39,7 @@
#include "llfloaterreg.h"
#include "llfloaterworldmap.h"
#include "llfolderviewmodel.h"
+#include "llloadingindicator.h"
#include "lloutfitobserver.h"
#include "llpaneleditwearable.h"
#include "llpaneloutfitsinventory.h"
@@ -137,6 +138,8 @@ bool LLSidepanelAppearance::postBuild()
mCurrOutfitPanel = getChild<LLPanel>("panel_currentlook");
+ mWearableLoadingIndicator = getChild<LLLoadingIndicator>("wearables_loading_indicator");
+ mEditOutfitBtn = getChild<LLButton>("edit_outfit_btn");
setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChanged,this,_2));
@@ -541,8 +544,8 @@ void LLSidepanelAppearance::inventoryFetched()
void LLSidepanelAppearance::setWearablesLoading(bool val)
{
- getChildView("wearables_loading_indicator")->setVisible( val);
- getChildView("edit_outfit_btn")->setVisible( !val);
+ mWearableLoadingIndicator->setVisible(val);
+ mEditOutfitBtn->setVisible(!val);
if (!val)
{
diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h
index f3d34a857c..1c1de99795 100644
--- a/indra/newview/llsidepanelappearance.h
+++ b/indra/newview/llsidepanelappearance.h
@@ -38,6 +38,7 @@ class LLCurrentlyWornFetchObserver;
class LLPanelEditWearable;
class LLViewerWearable;
class LLPanelOutfitsInventory;
+class LLLoadingIndicator;
class LLSidepanelAppearance : public LLPanel
{
@@ -86,8 +87,11 @@ private:
LLButton* mOpenOutfitBtn;
LLButton* mEditAppearanceBtn;
+ LLButton* mEditOutfitBtn = nullptr;
LLPanel* mCurrOutfitPanel;
+ LLLoadingIndicator* mWearableLoadingIndicator = nullptr;
+
LLTextBox* mCurrentLookName;
LLTextBox* mOutfitStatus;
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 5ee6aec9f9..8ce1a745c3 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -102,15 +102,21 @@ LLPanelWearableOutfitItem::Params::Params()
bool LLPanelWearableOutfitItem::postBuild()
{
+ if (mShowWidgets)
+ {
+ mAddWearableBtn = getChild<LLButton>("add_wearable");
+ mRemoveWearableBtn = getChild<LLButton>("remove_wearable");
+ }
+
LLPanelWearableListItem::postBuild();
if(mShowWidgets)
{
- addWidgetToRightSide("add_wearable");
- addWidgetToRightSide("remove_wearable");
+ addWidgetToRightSide(mAddWearableBtn);
+ addWidgetToRightSide(mRemoveWearableBtn);
- childSetAction("add_wearable", boost::bind(&LLPanelWearableOutfitItem::onAddWearable, this));
- childSetAction("remove_wearable", boost::bind(&LLPanelWearableOutfitItem::onRemoveWearable, this));
+ mAddWearableBtn->setClickedCallback(boost::bind(&LLPanelWearableOutfitItem::onAddWearable, this));
+ mRemoveWearableBtn->setClickedCallback(boost::bind(&LLPanelWearableOutfitItem::onRemoveWearable, this));
setWidgetsVisible(false);
reshapeWidgets();
@@ -205,12 +211,12 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name,
}
if(mShowWidgets)
{
- setShowWidget("add_wearable", !is_worn);
+ setShowWidget(mAddWearableBtn, !is_worn);
// Body parts can't be removed, only replaced
LLViewerInventoryItem* inv_item = getItem();
bool show_remove = is_worn && inv_item && (inv_item->getType() != LLAssetType::AT_BODYPART);
- setShowWidget("remove_wearable", show_remove);
+ setShowWidget(mRemoveWearableBtn, show_remove);
if(mHovered)
{
diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h
index 7b69711154..3fe1059176 100644
--- a/indra/newview/llwearableitemslist.h
+++ b/indra/newview/llwearableitemslist.h
@@ -104,6 +104,8 @@ protected:
bool worn_indication_enabled, const Params& params, bool show_widgets = false);
private:
+ LLButton* mAddWearableBtn = nullptr;
+ LLButton* mRemoveWearableBtn = nullptr;
bool mWornIndicationEnabled;
bool mShowWidgets;
};
diff --git a/indra/newview/skins/default/xui/en/panel_edit_alpha.xml b/indra/newview/skins/default/xui/en/panel_edit_alpha.xml
index 30fee7361f..ab0e447028 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_alpha.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_alpha.xml
@@ -33,7 +33,6 @@
top="0"
width="313" >
<check_box
- control_name="LowerAlphaTextureInvisible"
follows="left|top"
height="16"
layout="topleft"
@@ -58,7 +57,6 @@
</texture_picker>
<check_box
- control_name="UpperAlphaTextureInvisible"
follows="left|top"
height="16"
layout="topleft"
@@ -83,7 +81,6 @@
</texture_picker>
<check_box
- control_name="HeadAlphaTextureInvisible"
follows="left|top"
height="16"
layout="topleft"
@@ -108,7 +105,6 @@
</texture_picker>
<check_box
- control_name="Eye AlphaTextureInvisible"
follows="left|top"
height="16"
layout="topleft"
@@ -133,7 +129,6 @@
</texture_picker>
<check_box
- control_name="HairAlphaTextureInvisible"
follows="left|top"
height="16"
layout="topleft"