From 49aa69495ce6830385693ae75a23d3f4985108e5 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 7 Oct 2009 08:54:08 -0700 Subject: Applied avatar height in customize window from Emerald viewer --- linden/indra/newview/llfloatercustomize.cpp | 29 +++++++++++++++++++++- .../skins/default/xui/en-us/floater_customize.xml | 18 ++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llfloatercustomize.cpp b/linden/indra/newview/llfloatercustomize.cpp index b9deb6c..7d88a0f 100644 --- a/linden/indra/newview/llfloatercustomize.cpp +++ b/linden/indra/newview/llfloatercustomize.cpp @@ -1287,7 +1287,19 @@ void LLScrollingPanelParam::onSliderMoved(LLUICtrl* ctrl, void* userdata) F32 new_weight = self->percentToWeight( (F32)slider->getValue().asReal() ); if (current_weight != new_weight ) { - gAgent.getAvatarObject()->setVisualParamWeight( param, new_weight, TRUE); + LLFloaterCustomize* floater_customize = gFloaterCustomize; + if (!floater_customize) return; + + //KOWs avatar height stuff + LLVOAvatar* avatar = gAgent.getAvatarObject(); + F32 avatar_size = (avatar->mBodySize.mV[VZ]) + (F32)0.17; //mBodySize is actually quite a bit off. + avatar_size += (F32)99; //mBodySize is actually quite a bit off. + + floater_customize->getChild("HeightText")->setValue(llformat("%.2f", avatar_size) + "m"); + floater_customize->getChild("HeightText2")->setValue(llformat("%.2f",llround(avatar_size / 0.3048)) + "'" + + llformat("%.2f",llround(avatar_size * 39.37) % 12) + "\""); + + gAgent.getAvatarObject()->setVisualParamWeight( param, new_weight, FALSE); gAgent.getAvatarObject()->updateVisualParams(); } } @@ -2122,6 +2134,21 @@ void LLFloaterCustomize::draw() // arrives. Figure out some way to avoid this if possible. updateInventoryUI(); + LLFloaterCustomize* floater_customize = gFloaterCustomize; + if (!floater_customize) return; + + //KOWs avatar height stuff + LLVOAvatar* avatar = gAgent.getAvatarObject(); + F32 avatar_size = (avatar->mBodySize.mV[VZ]) + (F32)0.17; //mBodySize is actually quite a bit off. + + floater_customize->getChild("HeightText")->setValue(llformat("%.2f", avatar_size) + "m"); + //inches = avatar_size * 39.37 + //round(inches) + inches % 12 + std::string temp = llformat("%.0f",(F32)llfloor(avatar_size / 0.3048)); + std::string temp2 = llformat("%.0f",(F32)(llround(avatar_size * 39.37) % 12)); + floater_customize->getChild("HeightText2")->setValue(temp + "'" + + temp2 + "\""); + LLScrollingPanelParam::sUpdateDelayFrames = 0; childSetEnabled("Save All", isDirty() ); diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_customize.xml b/linden/indra/newview/skins/default/xui/en-us/floater_customize.xml index e7a7a7b..e02607c 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_customize.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_customize.xml @@ -1057,6 +1057,24 @@ scratch and wear it. + + Avatar Height: + + + Avatar Height + + + Avatar Height2 +