MAINT-8332 Handle hover height adjusting via debug setting

Mon, 26 Feb 2018 18:03:59 +0200

author
maxim_productengine<mnikolenko@productengine.com>
date
Mon, 26 Feb 2018 18:03:59 +0200
changeset 55304
f0a2a79633cf
parent 55303
56683b7a4ee6
child 55305
03931e7da6bc
child 55309
19a13b5829e8

MAINT-8332 Handle hover height adjusting via debug setting

indra/newview/llfloaterhoverheight.cpp file | annotate | diff | revisions
indra/newview/llfloaterhoverheight.h file | annotate | diff | revisions
indra/newview/llviewercontrol.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llfloaterhoverheight.cpp	Fri Feb 23 16:02:24 2018 +0200
     1.2 +++ b/indra/newview/llfloaterhoverheight.cpp	Mon Feb 26 18:03:59 2018 +0200
     1.3 @@ -39,7 +39,7 @@
     1.4  {
     1.5  }
     1.6  
     1.7 -void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data)
     1.8 +void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data, bool update_offset)
     1.9  {
    1.10  	F32 value = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ");
    1.11  
    1.12 @@ -47,7 +47,7 @@
    1.13  	LLSliderCtrl* sldrCtrl = self->getChild<LLSliderCtrl>("HoverHeightSlider");
    1.14  	sldrCtrl->setValue(value,FALSE);
    1.15  
    1.16 -	if (isAgentAvatarValid())
    1.17 +	if (isAgentAvatarValid() && update_offset)
    1.18  	{
    1.19  		LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
    1.20  		LL_INFOS("Avatar") << "setting hover from preference setting " << offset[2] << LL_ENDL;
    1.21 @@ -70,7 +70,7 @@
    1.22  	// Update slider on future pref changes.
    1.23  	if (gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ"))
    1.24  	{
    1.25 -		gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getCommitSignal()->connect(boost::bind(&syncFromPreferenceSetting, this));
    1.26 +		gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getCommitSignal()->connect(boost::bind(&syncFromPreferenceSetting, this, false));
    1.27  	}
    1.28  	else
    1.29  	{
    1.30 @@ -114,10 +114,6 @@
    1.31  	LLSliderCtrl* sldrCtrl = getChild<LLSliderCtrl>("HoverHeightSlider");
    1.32  	F32 value = sldrCtrl->getValueF32();
    1.33  	gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ",value);
    1.34 -
    1.35 -	LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
    1.36 -	LL_INFOS("Avatar") << "setting hover from slider final commit " << offset[2] << LL_ENDL;
    1.37 -	gAgentAvatarp->setHoverOffset(offset, true); // will send update this time.
    1.38  }
    1.39  
    1.40  void LLFloaterHoverHeight::onRegionChanged()
     2.1 --- a/indra/newview/llfloaterhoverheight.h	Fri Feb 23 16:02:24 2018 +0200
     2.2 +++ b/indra/newview/llfloaterhoverheight.h	Mon Feb 26 18:03:59 2018 +0200
     2.3 @@ -39,7 +39,7 @@
     2.4  
     2.5  	void onFinalCommit();
     2.6  
     2.7 -	static void syncFromPreferenceSetting(void *user_data);
     2.8 +	static void syncFromPreferenceSetting(void *user_data, bool update_offset = true);
     2.9  
    2.10  	void onRegionChanged();
    2.11  	void onSimulatorFeaturesReceived(const LLUUID &region_id);
     3.1 --- a/indra/newview/llviewercontrol.cpp	Fri Feb 23 16:02:24 2018 +0200
     3.2 +++ b/indra/newview/llviewercontrol.cpp	Mon Feb 26 18:03:59 2018 +0200
     3.3 @@ -126,6 +126,16 @@
     3.4      return true;
     3.5  }
     3.6  
     3.7 +static bool handleAvatarHoverOffsetChanged(const LLSD& newvalue)
     3.8 +{
     3.9 +	if (isAgentAvatarValid())
    3.10 +	{
    3.11 +		gAgentAvatarp->setHoverIfRegionEnabled();
    3.12 +	}
    3.13 +	return true;
    3.14 +}
    3.15 +
    3.16 +
    3.17  static bool handleSetShaderChanged(const LLSD& newvalue)
    3.18  {
    3.19  	// changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache
    3.20 @@ -734,7 +744,8 @@
    3.21  	gSavedSettings.getControl("SpellCheck")->getSignal()->connect(boost::bind(&handleSpellCheckChanged));
    3.22  	gSavedSettings.getControl("SpellCheckDictionary")->getSignal()->connect(boost::bind(&handleSpellCheckChanged));
    3.23  	gSavedSettings.getControl("LoginLocation")->getSignal()->connect(boost::bind(&handleLoginLocationChanged));
    3.24 -    gSavedSettings.getControl("DebugAvatarJoints")->getCommitSignal()->connect(boost::bind(&handleDebugAvatarJointsChanged, _2));
    3.25 +	gSavedSettings.getControl("DebugAvatarJoints")->getCommitSignal()->connect(boost::bind(&handleDebugAvatarJointsChanged, _2));
    3.26 +	gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getCommitSignal()->connect(boost::bind(&handleAvatarHoverOffsetChanged, _2));
    3.27  }
    3.28  
    3.29  #if TEST_CACHED_CONTROL

mercurial