Index: indra/newview/app_settings/colors_base.xml =================================================================== --- indra/newview/app_settings/colors_base.xml (revision 669) +++ indra/newview/app_settings/colors_base.xml (working copy) @@ -37,6 +37,8 @@ + + Index: indra/newview/app_settings/settings.xml =================================================================== --- indra/newview/app_settings/settings.xml (revision 669) +++ indra/newview/app_settings/settings.xml (working copy) @@ -888,7 +888,7 @@ Type S32 Value - 3 + 8 ButtonFlashRate @@ -899,7 +899,7 @@ Type F32 Value - 2.0 + 1.25 ButtonHPad Index: indra/llui/llbutton.cpp =================================================================== --- indra/llui/llbutton.cpp (revision 669) +++ indra/llui/llbutton.cpp (working copy) @@ -211,6 +211,8 @@ mHighlightColor = ( LLUI::sColorsGroup->getColor( "ButtonUnselectedFgColor" ) ); mUnselectedBgColor = ( LLUI::sColorsGroup->getColor( "ButtonUnselectedBgColor" ) ); mSelectedBgColor = ( LLUI::sColorsGroup->getColor( "ButtonSelectedBgColor" ) ); + mFlashBgColor = ( LLUI::sColorsGroup->getColor( "ButtonFlashBgColor" ) ); + mFlashingBgColor = ( LLUI::sColorsGroup->getColor( "ButtonFlashingBgColor" ) ); mImageOverlayAlignment = LLFontGL::HCENTER; mImageOverlayColor = LLColor4::white; @@ -406,10 +408,10 @@ void LLButton::draw() { BOOL flash = FALSE; + F32 elapsed = mFlashingTimer.getElapsedTimeF32(); + S32 flash_count = S32(elapsed * LLUI::sConfigGroup->getF32("ButtonFlashRate") * 2.f); if( mFlashing ) { - F32 elapsed = mFlashingTimer.getElapsedTimeF32(); - S32 flash_count = S32(elapsed * LLUI::sConfigGroup->getF32("ButtonFlashRate") * 2.f); // flash on or off? flash = (flash_count % 2 == 0) || flash_count > S32((F32)LLUI::sConfigGroup->getS32("ButtonFlashCount") * 2.f); } @@ -436,7 +438,9 @@ || mToggleState; BOOL use_glow_effect = FALSE; - if ( mNeedsHighlight || flash ) + LLColor4 glow_color = LLColor4::white; + LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA; + if ( mNeedsHighlight ) { if (pressed) { @@ -472,6 +476,21 @@ mImagep = mImageUnselected; } + if (mFlashing) + { + use_glow_effect = TRUE; + glow_type = LLRender::BT_ALPHA; // blend the glow + if (mNeedsHighlight) // highlighted AND flashing + glow_color = (glow_color*0.5f + mFlashBgColor*0.5f) % 2.0f; // average between flash and highlight colour, with sum of the opacity + else + { + if (flash_count < S32((F32)LLUI::sConfigGroup->getS32("ButtonFlashCount") * 2.f)) + glow_color = mFlashingBgColor; + else + glow_color = mFlashBgColor; + } + } + // Override if more data is available // HACK: Use gray checked state to mean either: // enabled and tentative @@ -558,7 +577,10 @@ if (use_glow_effect) { - mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); + mCurGlowStrength = lerp(mCurGlowStrength, + mFlashing ? (flash? 1.0 : 0.0) + : mHoverGlowStrength, + LLCriticalDamp::getInterpolant(0.05f)); } else { @@ -574,8 +596,8 @@ mImagep->draw(getLocalRect(), getEnabled() ? mImageColor : mDisabledImageColor ); if (mCurGlowStrength > 0.01f) { - gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); - mImagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); + gGL.setSceneBlendType(glow_type); + mImagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), glow_color % mCurGlowStrength); gGL.setSceneBlendType(LLRender::BT_ALPHA); } } @@ -584,8 +606,8 @@ mImagep->draw(0, 0, getEnabled() ? mImageColor : mDisabledImageColor ); if (mCurGlowStrength > 0.01f) { - gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); - mImagep->drawSolid(0, 0, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); + gGL.setSceneBlendType(glow_type); + mImagep->drawSolid(0, 0, glow_color % mCurGlowStrength); gGL.setSceneBlendType(LLRender::BT_ALPHA); } } Index: indra/llui/llbutton.h =================================================================== --- indra/llui/llbutton.h (revision 669) +++ indra/llui/llbutton.h (working copy) @@ -267,6 +267,8 @@ LLColor4 mHighlightColor; LLColor4 mUnselectedBgColor; LLColor4 mSelectedBgColor; + LLColor4 mFlashBgColor; + LLColor4 mFlashingBgColor; LLColor4 mImageColor; LLColor4 mDisabledImageColor;