class MoneyLabelController extends inkTextValueProgressController
{
	private var m_animation : inkAnimProxy;
	private var m_currentMoney : Float;
	private var m_pulse : PulseAnimation;

	protected event OnInitialize()
	{
		m_pulse = new PulseAnimation;
		m_pulse.Configure( GetRootWidget(), 1.0, 0.5, 0.30000001 );
	}

	public function SetMoney( newValue : Int32, optional delay : Float, optional duration : Float )
	{
		if( m_animation != NULL )
		{
			m_animation.Stop();
		}
		if( duration <= 0.0 )
		{
			duration = 0.01;
		}
		m_pulse.Start( false );
		SetDelay( delay );
		SetDuration( duration );
		SetBaseValue( m_currentMoney );
		m_currentMoney = ( ( Float )( newValue ) );
		SetTargetValue( m_currentMoney );
		m_animation = PlaySetAnimation();
		m_animation.RegisterToCallback( inkanimEventType.OnFinish, this, 'OnMainAnimationOver' );
	}

	protected event OnMainAnimationOver( e : inkAnimProxy )
	{
		m_pulse.Stop();
	}

}

