mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-09 19:41:36 +00:00
Merge f441c1dcfd
into 0565403b15
This commit is contained in:
commit
0469479e5b
2 changed files with 11 additions and 4 deletions
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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" );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue