diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-01-15 16:45:24 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-01-15 16:45:24 -0500 |
commit | d2de97ad8e84eedd42f4a0fe5b258617a96f154b (patch) | |
tree | 21a60e9d713c5f0cc49bb157772af233ebe8faa9 /indra/newview/llfloaterhoverheight.cpp | |
parent | be83e48fc12fbaf225f9f3e6ad5042320595ce26 (diff) |
SL-92 WIP - more on hover management
Diffstat (limited to 'indra/newview/llfloaterhoverheight.cpp')
-rwxr-xr-x | indra/newview/llfloaterhoverheight.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp index 7d0c011b74..8908626de6 100755 --- a/indra/newview/llfloaterhoverheight.cpp +++ b/indra/newview/llfloaterhoverheight.cpp @@ -51,9 +51,9 @@ void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data) if (isAgentAvatarValid()) { LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z)); - gAgentAvatarp->mHoverOffset = offset; - LL_INFOS("Avatar") << "set hover from preference setting" << offset[2] << LL_ENDL; - gAgentAvatarp->sendHoverHeight(); + LL_INFOS("Avatar") << "setting hover from preference setting " << offset[2] << LL_ENDL; + gAgentAvatarp->setHoverOffset(offset); + //gAgentAvatarp->sendHoverHeight(); } } @@ -84,18 +84,28 @@ BOOL LLFloaterHoverHeight::postBuild() { mRegionChangedSlot = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterHoverHeight::onRegionChanged,this)); } + // Set up based on initial region. + onRegionChanged(); return TRUE; } +void LLFloaterHoverHeight::onClose(bool app_quitting) +{ + if (mRegionChangedSlot.connected()) + { + mRegionChangedSlot.disconnect(); + } +} + // static void LLFloaterHoverHeight::onSliderMoved(LLUICtrl* ctrl, void* userData) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); F32 value = sldrCtrl->getValueF32(); LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z)); - LL_INFOS("Avatar") << "set hover from slider moved" << offset[2] << LL_ENDL; - gAgentAvatarp->mHoverOffset = offset; + LL_INFOS("Avatar") << "setting hover from slider moved" << offset[2] << LL_ENDL; + gAgentAvatarp->setHoverOffset(offset, false); } // Do send-to-the-server work when slider drag completes, or new @@ -105,6 +115,10 @@ void LLFloaterHoverHeight::onFinalCommit() LLSliderCtrl* sldrCtrl = getChild<LLSliderCtrl>("HoverHeightSlider"); F32 value = sldrCtrl->getValueF32(); gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ",value); + + LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z)); + LL_INFOS("Avatar") << "setting hover from slider final commit " << offset[2] << LL_ENDL; + gAgentAvatarp->setHoverOffset(offset, true); // will send update this time. } void LLFloaterHoverHeight::onRegionChanged() |