diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-01-13 17:18:15 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-01-13 17:18:15 -0500 |
commit | d5ab47b1bc9eac98c1f443fa965a91a8f2cf0af7 (patch) | |
tree | bc50c7b6a71bb9b5a800bdb7c9ffea6f47c4483f /indra/newview/llfloaterhoverheight.cpp | |
parent | ee63c30ea748857f68ac352a9751816644322ec3 (diff) |
SL-92 WIP - added signal for simulator features received. Use to keep hover floater UI synced with region support for hover.
Diffstat (limited to 'indra/newview/llfloaterhoverheight.cpp')
-rwxr-xr-x | indra/newview/llfloaterhoverheight.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp index 2ac61efc0c..69b58b3af5 100755 --- a/indra/newview/llfloaterhoverheight.cpp +++ b/indra/newview/llfloaterhoverheight.cpp @@ -77,6 +77,13 @@ BOOL LLFloaterHoverHeight::postBuild() LL_WARNS() << "Control not found for AvatarHoverOffsetZ" << LL_ENDL; } + updateEditEnabled(); + + if (!mRegionBoundarySlot.connected()) + { + mRegionBoundarySlot = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterHoverHeight::onRegionChanged,this)); + } + return TRUE; } @@ -98,4 +105,37 @@ void LLFloaterHoverHeight::onFinalCommit() gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ",value); } +void LLFloaterHoverHeight::onRegionChanged() +{ + LLViewerRegion *region = gAgent.getRegion(); + if (region && region->simulatorFeaturesReceived()) + { + updateEditEnabled(); + } + else if (region) + { + region->setSimulatorFeaturesReceivedCallback(boost::bind(&LLFloaterHoverHeight::onSimulatorFeaturesReceived,this,_1)); + } +} + +void LLFloaterHoverHeight::onSimulatorFeaturesReceived(const LLUUID ®ion_id) +{ + LLViewerRegion *region = gAgent.getRegion(); + if (region && (region->getRegionID()==region_id)) + { + updateEditEnabled(); + } +} + +void LLFloaterHoverHeight::updateEditEnabled() +{ + bool enabled = gAgent.getRegion() && gAgent.getRegion()->avatarHoverHeightEnabled(); + LLSliderCtrl* sldrCtrl = getChild<LLSliderCtrl>("HoverHeightSlider"); + sldrCtrl->setEnabled(enabled); + if (enabled) + { + syncFromPreferenceSetting(this); + } +} + |