class ElevatorArrowsLogicController extends DeviceInkLogicControllerBase
{
	[ category = "Widget Refs" ]
	private editable var m_arrow1Widget : inkWidgetRef;
	[ category = "Widget Refs" ]
	private editable var m_arrow2Widget : inkWidgetRef;
	[ category = "Widget Refs" ]
	private editable var m_arrow3Widget : inkWidgetRef;
	private var m_animFade1 : inkAnimDef;
	private var m_animFade2 : inkAnimDef;
	private var m_animFade3 : inkAnimDef;
	private var m_animSlow1 : inkAnimDef;
	private var m_animSlow2 : inkAnimDef;
	private var m_animOptions1 : inkAnimOptions;
	private var m_animOptions2 : inkAnimOptions;
	private var m_animOptions3 : inkAnimOptions;

	protected event OnInitialize()
	{
		CreateAnimations();
	}

	private function CreateAnimations()
	{
		var fadeInterp : inkAnimTransparency;
		m_animFade1 = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 1.0 );
		fadeInterp.SetEndTransparency( 0.0 );
		fadeInterp.SetDuration( 0.25 );
		m_animFade1.AddInterpolator( fadeInterp );
		m_animFade2 = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 1.0 );
		fadeInterp.SetEndTransparency( 0.0 );
		fadeInterp.SetDuration( 0.25 );
		m_animFade2.AddInterpolator( fadeInterp );
		m_animFade3 = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 1.0 );
		fadeInterp.SetEndTransparency( 0.0 );
		fadeInterp.SetDuration( 0.25 );
		m_animFade3.AddInterpolator( fadeInterp );
		m_animSlow1 = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 1.0 );
		fadeInterp.SetEndTransparency( 0.25 );
		fadeInterp.SetDuration( 0.25 );
		m_animSlow2.AddInterpolator( fadeInterp );
		m_animSlow2 = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 1.0 );
		fadeInterp.SetEndTransparency( 0.25 );
		fadeInterp.SetDuration( 0.5 );
		m_animSlow2.AddInterpolator( fadeInterp );
		m_animOptions1.loopType = inkanimLoopType.PingPong;
		m_animOptions1.loopCounter = 100;
		m_animOptions2.loopType = inkanimLoopType.PingPong;
		m_animOptions2.loopCounter = 100;
		m_animOptions2.executionDelay = 0.125;
		m_animOptions3.loopType = inkanimLoopType.PingPong;
		m_animOptions3.loopCounter = 100;
		m_animOptions3.executionDelay = 0.25;
	}

	public function PlayAnimationsArrowsDown()
	{
		inkWidgetRef.StopAllAnimations( m_arrow1Widget );
		inkWidgetRef.StopAllAnimations( m_arrow2Widget );
		inkWidgetRef.StopAllAnimations( m_arrow3Widget );
		inkWidgetRef.PlayAnimationWithOptions( m_arrow1Widget, m_animFade1, m_animOptions1 );
		inkWidgetRef.PlayAnimationWithOptions( m_arrow2Widget, m_animFade2, m_animOptions2 );
		inkWidgetRef.PlayAnimationWithOptions( m_arrow3Widget, m_animFade3, m_animOptions3 );
	}

	public function PlayAnimationsArrowsUp()
	{
		inkWidgetRef.StopAllAnimations( m_arrow1Widget );
		inkWidgetRef.StopAllAnimations( m_arrow2Widget );
		inkWidgetRef.StopAllAnimations( m_arrow3Widget );
		inkWidgetRef.PlayAnimationWithOptions( m_arrow1Widget, m_animFade1, m_animOptions3 );
		inkWidgetRef.PlayAnimationWithOptions( m_arrow2Widget, m_animFade2, m_animOptions2 );
		inkWidgetRef.PlayAnimationWithOptions( m_arrow3Widget, m_animFade3, m_animOptions1 );
	}

	public function PlayAltAnimations()
	{
		inkWidgetRef.StopAllAnimations( m_arrow1Widget );
		inkWidgetRef.StopAllAnimations( m_arrow2Widget );
		inkWidgetRef.PlayAnimationWithOptions( m_arrow1Widget, m_animSlow1, m_animOptions1 );
		inkWidgetRef.PlayAnimationWithOptions( m_arrow2Widget, m_animSlow2, m_animOptions1 );
	}

}

