diff options
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); + } +} + |