SL-20140 Setting shape hand size to 36 won't save
parent
eff5958c11
commit
810a3d24c2
|
|
@ -2021,7 +2021,7 @@
|
|||
value_min="-1"
|
||||
value_max="1">
|
||||
<param_skeleton>
|
||||
|
||||
|
||||
<bone
|
||||
name="mEyeLeft"
|
||||
scale="0 0 0"
|
||||
|
|
@ -2031,9 +2031,8 @@
|
|||
name="mEyeRight"
|
||||
scale="0 0 0"
|
||||
offset="-.005 0 0" />
|
||||
|
||||
|
||||
<bone
|
||||
|
||||
<bone
|
||||
name="mFaceEyeAltLeft"
|
||||
scale="0 0 0"
|
||||
offset="-.005 0 0" />
|
||||
|
|
@ -2042,7 +2041,7 @@
|
|||
name="mFaceEyeAltRight"
|
||||
scale="0 0 0"
|
||||
offset="-.005 0 0" />
|
||||
|
||||
|
||||
<bone
|
||||
name="mFaceEyeLidLowerRight"
|
||||
scale="0 0.3 0.7"
|
||||
|
|
@ -2053,7 +2052,7 @@
|
|||
scale="0 0.3 0.7"
|
||||
offset="0 0 0" />
|
||||
|
||||
<bone
|
||||
<bone
|
||||
name="mFaceEyeLidUpperRight"
|
||||
scale="0 0.3 0.7"
|
||||
offset=" 0 0 0" />
|
||||
|
|
@ -2062,17 +2061,17 @@
|
|||
name="mFaceEyeLidUpperLeft"
|
||||
scale="0 0.3 0.7"
|
||||
offset=" 0 0 0" />
|
||||
|
||||
|
||||
<bone
|
||||
name="mFaceEyecornerInnerLeft"
|
||||
scale="0 0 0"
|
||||
offset="-0.005 -0.008 0.0" />
|
||||
|
||||
|
||||
<bone
|
||||
name="mFaceEyecornerInnerRight"
|
||||
scale="0 0 0"
|
||||
offset="-0.005 0.008 0.0" />
|
||||
|
||||
|
||||
</param_skeleton>
|
||||
</param>
|
||||
|
||||
|
|
|
|||
|
|
@ -259,19 +259,15 @@ void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint )
|
|||
|
||||
// Make sure we're not taking the slider out of bounds
|
||||
// (this is where some simple UI limits are stored)
|
||||
F32 new_percent = weightToPercent(new_weight);
|
||||
LLSliderCtrl* slider = getChild<LLSliderCtrl>("param slider");
|
||||
if (slider)
|
||||
F32 new_percent = weightToSlider(new_weight);
|
||||
if (mSlider->getMinValue() < new_percent
|
||||
&& new_percent < mSlider->getMaxValue())
|
||||
{
|
||||
if (slider->getMinValue() < new_percent
|
||||
&& new_percent < slider->getMaxValue())
|
||||
{
|
||||
mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight);
|
||||
mWearable->writeToAvatar(gAgentAvatarp);
|
||||
gAgentAvatarp->updateVisualParams();
|
||||
mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight);
|
||||
mWearable->writeToAvatar(gAgentAvatarp);
|
||||
gAgentAvatarp->updateVisualParams();
|
||||
|
||||
slider->setValue( weightToPercent( new_weight ) );
|
||||
}
|
||||
mSlider->setValue( weightToSlider( new_weight ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -292,17 +288,13 @@ void LLScrollingPanelParam::onHintMinMouseUp( void* userdata )
|
|||
F32 range = self->mHintMax->getVisualParamWeight() - self->mHintMin->getVisualParamWeight();
|
||||
// step a fraction in the negative directiona
|
||||
F32 new_weight = current_weight - (range / 10.f);
|
||||
F32 new_percent = self->weightToPercent(new_weight);
|
||||
LLSliderCtrl* slider = self->getChild<LLSliderCtrl>("param slider");
|
||||
if (slider)
|
||||
F32 new_percent = self->weightToSlider(new_weight);
|
||||
if (self->mSlider->getMinValue() < new_percent
|
||||
&& new_percent < self->mSlider->getMaxValue())
|
||||
{
|
||||
if (slider->getMinValue() < new_percent
|
||||
&& new_percent < slider->getMaxValue())
|
||||
{
|
||||
self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight);
|
||||
self->mWearable->writeToAvatar(gAgentAvatarp);
|
||||
slider->setValue( self->weightToPercent( new_weight ) );
|
||||
}
|
||||
self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight);
|
||||
self->mWearable->writeToAvatar(gAgentAvatarp);
|
||||
self->mSlider->setValue( self->weightToSlider( new_weight ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -326,33 +318,16 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata )
|
|||
F32 range = self->mHintMax->getVisualParamWeight() - self->mHintMin->getVisualParamWeight();
|
||||
// step a fraction in the negative direction
|
||||
F32 new_weight = current_weight + (range / 10.f);
|
||||
F32 new_percent = self->weightToPercent(new_weight);
|
||||
LLSliderCtrl* slider = self->getChild<LLSliderCtrl>("param slider");
|
||||
if (slider)
|
||||
F32 new_percent = self->weightToSlider(new_weight);
|
||||
if (self->mSlider->getMinValue() < new_percent
|
||||
&& new_percent < self->mSlider->getMaxValue())
|
||||
{
|
||||
if (slider->getMinValue() < new_percent
|
||||
&& new_percent < slider->getMaxValue())
|
||||
{
|
||||
self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight);
|
||||
self->mWearable->writeToAvatar(gAgentAvatarp);
|
||||
slider->setValue( self->weightToPercent( new_weight ) );
|
||||
}
|
||||
self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight);
|
||||
self->mWearable->writeToAvatar(gAgentAvatarp);
|
||||
self->mSlider->setValue( self->weightToSlider( new_weight ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLVisualParamHint::requestHintUpdates( self->mHintMin, self->mHintMax );
|
||||
}
|
||||
|
||||
|
||||
F32 LLScrollingPanelParam::weightToPercent( F32 weight )
|
||||
{
|
||||
LLViewerVisualParam* param = mParam;
|
||||
return (weight - param->getMinWeight()) / (param->getMaxWeight() - param->getMinWeight()) * 100.f;
|
||||
}
|
||||
|
||||
F32 LLScrollingPanelParam::percentToWeight( F32 percent )
|
||||
{
|
||||
LLViewerVisualParam* param = mParam;
|
||||
return percent / 100.f * (param->getMaxWeight() - param->getMinWeight()) + param->getMinWeight();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,9 +61,6 @@ public:
|
|||
void onHintMouseDown( LLVisualParamHint* hint );
|
||||
void onHintHeldDown( LLVisualParamHint* hint );
|
||||
|
||||
F32 weightToPercent( F32 weight );
|
||||
F32 percentToWeight( F32 percent );
|
||||
|
||||
public:
|
||||
// Constants for LLPanelVisualParam
|
||||
const static F32 PARAM_STEP_TIME_THRESHOLD;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ LLScrollingPanelParamBase::LLScrollingPanelParamBase( const LLPanel::Params& pan
|
|||
LLViewerJointMesh* mesh, LLViewerVisualParam* param, BOOL allow_modify, LLWearable* wearable, LLJoint* jointp, BOOL use_hints)
|
||||
: LLScrollingPanel( panel_params ),
|
||||
mParam(param),
|
||||
mSlider(nullptr),
|
||||
mAllowModify(allow_modify),
|
||||
mWearable(wearable)
|
||||
{
|
||||
|
|
@ -50,13 +51,15 @@ LLScrollingPanelParamBase::LLScrollingPanelParamBase( const LLPanel::Params& pan
|
|||
buildFromFile( "panel_scrolling_param.xml");
|
||||
else
|
||||
buildFromFile( "panel_scrolling_param_base.xml");
|
||||
|
||||
getChild<LLUICtrl>("param slider")->setValue(weightToPercent(param->getWeight()));
|
||||
|
||||
mSlider = getChild<LLSliderCtrl>("param slider");
|
||||
mSlider->setMaxValue(100.f * (mParam->getMaxWeight() - mParam->getMinWeight()));
|
||||
mSlider->setValue(weightToSlider(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);
|
||||
mSlider->setLabelArg("[DESC]", display_name);
|
||||
mSlider->setEnabled(mAllowModify);
|
||||
mSlider->setCommitCallback(boost::bind(LLScrollingPanelParamBase::onSliderMoved, mSlider, this));
|
||||
|
||||
setVisible(FALSE);
|
||||
setBorderVisible( FALSE );
|
||||
|
|
@ -77,9 +80,9 @@ void LLScrollingPanelParamBase::updatePanel(BOOL allow_modify)
|
|||
}
|
||||
|
||||
F32 current_weight = mWearable->getVisualParamWeight( param->getID() );
|
||||
getChild<LLUICtrl>("param slider")->setValue(weightToPercent( current_weight ) );
|
||||
mSlider->setValue(weightToSlider( current_weight ) );
|
||||
mAllowModify = allow_modify;
|
||||
getChildView("param slider")->setEnabled(mAllowModify);
|
||||
mSlider->setEnabled(mAllowModify);
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
@ -90,7 +93,7 @@ void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl, void* userdata)
|
|||
LLViewerVisualParam* param = self->mParam;
|
||||
|
||||
F32 current_weight = self->mWearable->getVisualParamWeight( param->getID() );
|
||||
F32 new_weight = self->percentToWeight( (F32)slider->getValue().asReal() );
|
||||
F32 new_weight = self->sliderToWeight( (F32)slider->getValue().asReal() );
|
||||
if (current_weight != new_weight )
|
||||
{
|
||||
self->mWearable->setVisualParamWeight( param->getID(), new_weight);
|
||||
|
|
@ -99,14 +102,12 @@ void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl, void* userdata)
|
|||
}
|
||||
}
|
||||
|
||||
F32 LLScrollingPanelParamBase::weightToPercent( F32 weight )
|
||||
F32 LLScrollingPanelParamBase::weightToSlider(F32 weight)
|
||||
{
|
||||
LLViewerVisualParam* param = mParam;
|
||||
return (weight - param->getMinWeight()) / (param->getMaxWeight() - param->getMinWeight()) * 100.f;
|
||||
return (weight - mParam->getMinWeight()) * 100.f;
|
||||
}
|
||||
|
||||
F32 LLScrollingPanelParamBase::percentToWeight( F32 percent )
|
||||
F32 LLScrollingPanelParamBase::sliderToWeight(F32 slider)
|
||||
{
|
||||
LLViewerVisualParam* param = mParam;
|
||||
return percent / 100.f * (param->getMaxWeight() - param->getMinWeight()) + param->getMinWeight();
|
||||
return slider / 100.f + mParam->getMinWeight();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class LLViewerVisualParam;
|
|||
class LLWearable;
|
||||
class LLVisualParamHint;
|
||||
class LLViewerVisualParam;
|
||||
class LLSliderCtrl;
|
||||
class LLJoint;
|
||||
|
||||
class LLScrollingPanelParamBase : public LLScrollingPanel
|
||||
|
|
@ -49,11 +50,13 @@ public:
|
|||
|
||||
static void onSliderMoved(LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
F32 weightToPercent( F32 weight );
|
||||
F32 percentToWeight( F32 percent );
|
||||
F32 weightToSlider(F32 weight);
|
||||
F32 sliderToWeight(F32 slider);
|
||||
|
||||
public:
|
||||
LLViewerVisualParam* mParam;
|
||||
LLSliderCtrl* mSlider;
|
||||
|
||||
protected:
|
||||
BOOL mAllowModify;
|
||||
LLWearable *mWearable;
|
||||
|
|
|
|||
Loading…
Reference in New Issue