class PlayLibraryAnimationButtonView extends BaseButtonView
{
	protected editable var m_ToHoverAnimationName : CName;
	protected editable var m_ToPressedAnimationName : CName;
	protected editable var m_ToDefaultAnimationName : CName;
	protected editable var m_ToDisabledAnimationName : CName;
	private var m_InputAnimation : inkAnimProxy;

	protected override function ButtonStateChanged( oldState : inkEButtonState, newState : inkEButtonState )
	{
		var animationName : CName;
		switch( newState )
		{
			case inkEButtonState.Hover:
				animationName = m_ToHoverAnimationName;
			break;
			case inkEButtonState.Press:
				animationName = m_ToPressedAnimationName;
			break;
			case inkEButtonState.Disabled:
				animationName = m_ToDisabledAnimationName;
			break;
			default:
				animationName = m_ToDefaultAnimationName;
			break;
		}
		if( IsNameValid( animationName ) )
		{
			if( m_InputAnimation && m_InputAnimation.IsPlaying() )
			{
				m_InputAnimation.Stop();
			}
			m_InputAnimation = PlayLibraryAnimation( animationName );
		}
	}

}

