class InventoryFilterButton extends BaseButtonView
{
	private editable var m_Label : inkTextRef;
	private editable var m_InputIcon : inkImageRef;
	private var m_IntroPlayed : Bool;
	default m_IntroPlayed = false;

	public function Setup( const text : ref< String >, input : CName, framesDelay : Int32 )
	{
		Setup( text, input );
		if( !( m_IntroPlayed ) )
		{
			m_IntroPlayed = true;
			PlayIntroAnimation( framesDelay );
		}
	}

	public function Setup( const text : ref< String >, input : CName )
	{
		inkTextRef.SetLetterCase( m_Label, textLetterCase.UpperCase );
		inkTextRef.SetText( m_Label, text );
		inkImageRef.SetTexturePart( m_InputIcon, input );
	}

	private function PlayIntroAnimation( framesDelay : Int32 )
	{
		var animaionDef : inkAnimDef;
		var scaleInterp : inkAnimScale;
		animaionDef = new inkAnimDef;
		scaleInterp = new inkAnimScale;
		scaleInterp.SetStartScale( Vector2( 0.0, 0.0 ) );
		scaleInterp.SetEndScale( Vector2( 1.0, 1.0 ) );
		scaleInterp.SetMode( inkanimInterpolationMode.EasyInOut );
		scaleInterp.SetType( inkanimInterpolationType.Sinusoidal );
		scaleInterp.SetDirection( inkanimInterpolationDirection.FromTo );
		scaleInterp.SetDuration( 0.25 );
		scaleInterp.SetStartDelay( 0.03 * ( ( Float )( framesDelay ) ) );
		animaionDef.AddInterpolator( scaleInterp );
		GetRootWidget().PlayAnimation( animaionDef );
	}

}

