This commit is contained in:
Igor 2025-04-04 03:35:38 -04:00 committed by GitHub
commit 0469479e5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -390,6 +390,9 @@ void CHudItemEffectMeter::ApplySchemeSettings( IScheme *pScheme )
SetLabelText();
m_ProgressBar_FgColor = GetSchemeColor("ProgressBar.FgColor", pScheme);
m_ProgressBar_FlashColor = GetSchemeColor("ProgressBar.FlashColor", Color(160, 0, 0, 255), pScheme);
m_pItemEffectIcon = dynamic_cast< CTFImagePanel* >( FindChildByName( "ItemEffectIcon" ) );
if ( m_pItemEffectIcon )
{
@ -546,13 +549,15 @@ void CHudItemEffectMeter::Update( C_TFPlayer* pPlayer )
// Flash the bar if this class implementation requires it.
if ( ShouldFlash() )
{
int color_offset = ( ( int )( gpGlobals->realtime * 10 ) ) % 10;
int red = 160 + ( color_offset * 10 );
m_vecProgressBars[i]->SetFgColor( Color( red, 0, 0, 255 ) );
int color_offset = ( ( int ) ( gpGlobals->realtime * 10 ) ) % 10;
int red = m_ProgressBar_FlashColor.r() + ( color_offset * 5 );
int green = m_ProgressBar_FlashColor.g() + ( color_offset * 5 );
int blue = m_ProgressBar_FlashColor.b() + ( color_offset * 5 );
m_vecProgressBars[i]->SetFgColor( Color( red, green, blue, m_ProgressBar_FlashColor.a() ) );
}
else
{
m_vecProgressBars[i]->SetFgColor( GetProgressBarColor() );
m_vecProgressBars[i]->SetFgColor( m_ProgressBar_FgColor );
}
}

View file

@ -112,6 +112,8 @@ protected:
CTFImagePanel *m_pItemEffectIcon;
int m_nState;
Color m_ProgressBar_FgColor;
Color m_ProgressBar_FlashColor;
CPanelAnimationVarAliasType( float, m_iXOffset, "x_offset", "0", "proportional_float" );
};