diff options
| author | Richard Linden <none@none> | 2011-12-13 13:11:55 -0800 | 
|---|---|---|
| committer | Richard Linden <none@none> | 2011-12-13 13:11:55 -0800 | 
| commit | 0c0ff35d19969cc762dce510a4d5ee4649d96a24 (patch) | |
| tree | 4f65b4a82dd065d8bc0ac35481c040dd3876473f | |
| parent | aba090ab9027e5a5c1e9eb114ecca12b9eafa978 (diff) | |
EXP-1551 FIX Ability to toggle button flashing
added "EnableButtonFlashing" setting
| -rw-r--r-- | indra/llui/llbutton.cpp | 18 | ||||
| -rw-r--r-- | indra/llui/lltabcontainer.cpp | 13 | ||||
| -rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | 
3 files changed, 31 insertions, 11 deletions
| diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 93d8282aa7..f0d92d597a 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -589,15 +589,23 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height)  // virtual  void LLButton::draw()  { +	static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true);  	F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency();  	bool flash = FALSE; -	if( mFlashing ) +	if( mFlashing)  	{ -		F32 elapsed = mFlashingTimer.getElapsedTimeF32(); -		S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f); -		// flash on or off? -		flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f); +		if ( sEnableButtonFlashing) +		{ +			F32 elapsed = mFlashingTimer.getElapsedTimeF32(); +			S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f); +			// flash on or off? +			flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f); +		} +		else +		{ // otherwise just highlight button in flash color +			flash = true; +		}  	}  	bool pressed_by_keyboard = FALSE; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index d5f8707381..5fc2cc350d 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -98,24 +98,25 @@ class LLCustomButtonIconCtrl : public LLButton  {  public:  	struct Params -	: public LLInitParam::Block<Params, LLButton::Params> +	:	public LLInitParam::Block<Params, LLButton::Params>  	{  		// LEFT, RIGHT, TOP, BOTTOM paddings of LLIconCtrl in this class has same value  		Optional<S32>					icon_ctrl_pad; -		Params(): -		icon_ctrl_pad("icon_ctrl_pad", 1) +		Params() +		:	icon_ctrl_pad("icon_ctrl_pad", 1)  		{}  	};  protected:  	friend class LLUICtrlFactory; -	LLCustomButtonIconCtrl(const Params& p): -		LLButton(p), + +	LLCustomButtonIconCtrl(const Params& p) +	:	LLButton(p),  		mIcon(NULL),  		mIconAlignment(LLFontGL::HCENTER),  		mIconCtrlPad(p.icon_ctrl_pad) -		{} +	{}  public: diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index aa8ad53a3d..1ea623791d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1150,6 +1150,17 @@        <key>Value</key>        <integer>0</integer>      </map> +    <key>EnableButtonFlashing</key> +    <map> +      <key>Comment</key> +      <string>Allow UI to flash buttons to get your attention</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>1</integer> +    </map>      <key>ButtonHPad</key>      <map>        <key>Comment</key> | 
