summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneleditwearable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
-rw-r--r--indra/newview/llpaneleditwearable.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 6f2e7c0b20..5aeb3ffc82 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -635,6 +635,8 @@ BOOL LLPanelEditWearable::postBuild()
mPanelAlpha = getChild<LLPanel>("edit_alpha_panel");
mPanelTattoo = getChild<LLPanel>("edit_tattoo_panel");
+ mTxtAvatarHeight = mPanelShape->getChild<LLTextBox>("avatar_height");
+
mWearablePtr = NULL;
return TRUE;
@@ -661,7 +663,9 @@ void LLPanelEditWearable::draw()
updateVerbs();
if (getWearable())
{
- updatePanelPickerControls(getWearable()->getType());
+ EWearableType type = getWearable()->getType();
+ updatePanelPickerControls(type);
+ updateTypeSpecificControls(type);
}
LLPanel::draw();
@@ -864,6 +868,9 @@ void LLPanelEditWearable::initializePanel()
// set name
mTextEditor->setText(mWearablePtr->getName());
+ // toggle wearable type-specific controls
+ toggleTypeSpecificControls(type);
+
// clear and rebuild visual param list
const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(type);
if (!wearable_entry)
@@ -922,6 +929,28 @@ void LLPanelEditWearable::initializePanel()
updateVerbs();
}
+void LLPanelEditWearable::toggleTypeSpecificControls(EWearableType type)
+{
+ // Toggle controls specific to shape editing panel.
+ {
+ bool is_shape = (type == WT_SHAPE);
+ childSetVisible("sex_radio", is_shape);
+ childSetVisible("female_icon", is_shape);
+ childSetVisible("male_icon", is_shape);
+ }
+}
+
+void LLPanelEditWearable::updateTypeSpecificControls(EWearableType type)
+{
+ // Update controls specific to shape editing panel.
+ if (type == WT_SHAPE)
+ {
+ // Update avatar height
+ std::string avatar_height_str = llformat("%.2f", gAgentAvatarp->mBodySize.mV[VZ]);
+ mTxtAvatarHeight->setTextArg("[HEIGHT]", avatar_height_str);
+ }
+}
+
void LLPanelEditWearable::updateScrollingPanelUI()
{
// do nothing if we don't have a valid wearable we're editing