diff options
-rwxr-xr-x | indra/newview/app_settings/settings_per_account.xml | 6 | ||||
-rwxr-xr-x | indra/newview/llfloaterhoverheight.cpp | 15 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 3 | ||||
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/floater_edit_hover_height.xml | 2 |
6 files changed, 17 insertions, 15 deletions
diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 7975fe9e3a..97d81153a7 100755 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -7,13 +7,9 @@ <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Vector3</string> + <string>F32</string> <key>Value</key> - <array> <real>0.0</real> - <real>0.0</real> - <real>0.0</real> - </array> </map> <key>DoNotDisturbResponseChanged</key> <map> diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp index 9efb168b55..dc8a3d6fb8 100755 --- a/indra/newview/llfloaterhoverheight.cpp +++ b/indra/newview/llfloaterhoverheight.cpp @@ -42,12 +42,14 @@ LLFloaterHoverHeight::LLFloaterHoverHeight(const LLSD& key) : LLFloater(key) void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data) { - LLVector3 offset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); - F32 value = offset[2]; + F32 value = gSavedPerAccountSettings.getF32("AvatarPosFinalOffset"); LLFloaterHoverHeight *self = static_cast<LLFloaterHoverHeight*>(user_data); LLSliderCtrl* sldrCtrl = self->getChild<LLSliderCtrl>("HoverHeightSlider"); sldrCtrl->setValue(value,FALSE); + + //value = sldrCtrl->getValueF32(); + //gAgentAvatarp->mHoverOffset = LLVector3(0.0, 0.0, value); if (isAgentAvatarValid()) { gAgentAvatarp->sendHoverHeight(); @@ -57,6 +59,8 @@ void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data) BOOL LLFloaterHoverHeight::postBuild() { LLSliderCtrl* sldrCtrl = getChild<LLSliderCtrl>("HoverHeightSlider"); + sldrCtrl->setMinValue(MIN_HOVER_Z); + sldrCtrl->setMaxValue(MAX_HOVER_Z); sldrCtrl->setSliderMouseUpCallback(boost::bind(&LLFloaterHoverHeight::onFinalCommit,this)); sldrCtrl->setSliderEditorCommitCallback(boost::bind(&LLFloaterHoverHeight::onFinalCommit,this)); childSetCommitCallback("HoverHeightSlider", &LLFloaterHoverHeight::onSliderMoved, NULL); @@ -81,8 +85,7 @@ void LLFloaterHoverHeight::onSliderMoved(LLUICtrl* ctrl, void* userData) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); F32 value = sldrCtrl->getValueF32(); - LLVector3 offset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); - offset[2] = value; + LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z)); gAgentAvatarp->mHoverOffset = offset; } @@ -92,9 +95,7 @@ void LLFloaterHoverHeight::onFinalCommit() { LLSliderCtrl* sldrCtrl = getChild<LLSliderCtrl>("HoverHeightSlider"); F32 value = sldrCtrl->getValueF32(); - LLVector3 offset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); - offset[2] = value; - gSavedPerAccountSettings.setVector3("AvatarPosFinalOffset",offset); + gSavedPerAccountSettings.setF32("AvatarPosFinalOffset",value); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a6d006f13b..fd741e7e5f 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -111,6 +111,9 @@ extern F32 ANIM_SPEED_MAX; extern F32 ANIM_SPEED_MIN; extern U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG; +const F32 MAX_HOVER_Z = 2.0; +const F32 MIN_HOVER_Z = -2.0; + // #define OUTPUT_BREAST_DATA using namespace LLAvatarAppearanceDefines; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index a3f599e2d7..a12e688087 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -1021,6 +1021,9 @@ protected: // Shared with LLVOAvatarSelf extern const F32 SELF_ADDITIONAL_PRI; extern const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL; +extern const F32 MAX_HOVER_Z; +extern const F32 MIN_HOVER_Z; + std::string get_sequential_numbered_file_name(const std::string& prefix, const std::string& suffix); void dump_sequential_xml(const std::string outprefix, const LLSD& content); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 6e0c9cb68c..1b5901e581 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -239,7 +239,8 @@ void LLVOAvatarSelf::initInstance() return; } - mHoverOffset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); + F32 hover_z = gSavedPerAccountSettings.getF32("AvatarPosFinalOffset"); + mHoverOffset = LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z)); LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << mHoverOffset[2] << LL_ENDL; //doPeriodically(output_self_av_texture_diagnostics, 30.0); diff --git a/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml b/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml index 29d06b9b4e..8fc20d28fb 100755 --- a/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml @@ -23,8 +23,6 @@ follows="top|left" height="15" increment="0.001" - max_val="2" - min_val="-2" initial_value="0.0" label="Height" label_width="60" |