mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-09 11:31:23 +00:00
Correction to make progress bar's flash color changeable
This commit is contained in:
parent
9928499d43
commit
f441c1dcfd
2 changed files with 7 additions and 6 deletions
|
@ -391,6 +391,7 @@ 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 )
|
||||
|
@ -548,12 +549,11 @@ 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 amount = 0.8;
|
||||
int red = ( m_ProgressBar_FgColor.r() * amount) + color_offset;
|
||||
int green = ( m_ProgressBar_FgColor.g() * amount) + color_offset;
|
||||
int blue = ( m_ProgressBar_FgColor.b() * amount) + color_offset;
|
||||
m_vecProgressBars[i]->SetFgColor( Color(red, green, blue, m_ProgressBar_FgColor.a()) );
|
||||
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
|
||||
{
|
||||
|
|
|
@ -113,6 +113,7 @@ protected:
|
|||
|
||||
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