class InputProgressView extends inkLogicController
{
	private var m_TargetImage : weak< inkImage >;
	private var m_ProgressPercent : Int32;
	private editable var m_PartName : String;
	default m_PartName = "icon_circle_anim_";

	protected event OnInitialize()
	{
		m_TargetImage = ( ( inkImage )( GetRootWidget() ) );
		if( !( m_TargetImage ) )
		{
		}
		m_ProgressPercent = -1;
		Reset();
	}

	public function SetProgress( progress : Float )
	{
		SetProgress( ( ( Int32 )( progress * 100.0 ) ) );
	}

	public function SetProgress( percentProgress : Int32 )
	{
		percentProgress = Clamp( percentProgress, 0, 99 );
		if( m_ProgressPercent != percentProgress )
		{
			m_ProgressPercent = percentProgress;
			if( m_TargetImage )
			{
				m_TargetImage.SetTexturePart( StringToName( m_PartName + IntToString( percentProgress ) ) );
			}
		}
	}

	public function Reset()
	{
		SetProgress( 0 );
	}

}

