class TerminalMainLayoutWidgetController extends inkLogicController
{
	[ category = "Widget Refs" ]
	private editable var m_thumbnailsListSlot : inkWidgetRef;
	[ category = "Widget Refs" ]
	private editable var m_deviceSlot : inkWidgetRef;
	[ category = "Widget Refs" ]
	private editable var m_returnButton : inkWidgetRef;
	[ category = "Widget Refs" ]
	private editable var m_titleWidget : inkTextRef;
	[ category = "Widget Refs" ]
	private editable var m_backgroundImage : inkImageRef;
	[ category = "Widget Refs" ]
	private editable var m_backgroundImageTrace : inkImageRef;
	protected var m_isInitialized : Bool;
	private var m_main_canvas : weak< inkWidget >;

	protected event OnInitialize()
	{
		m_main_canvas = GetRootWidget();
		inkWidgetRef.SetVisible( m_returnButton, false );
	}

	public virtual function Initialize( gameController : TerminalInkGameControllerBase )
	{
		var title : String;
		if( !( m_isInitialized ) )
		{
			m_main_canvas.SetVisible( true );
		}
		if( inkTextRef.Get( m_titleWidget ) )
		{
			title = gameController.GetTerminalTitle();
			if( IsStringValid( title ) )
			{
				inkTextRef.SetLocalizedTextScript( m_titleWidget, title );
			}
		}
		m_isInitialized = true;
	}

	public function HideBackgroundIcon()
	{
		inkImageRef.SetVisible( m_backgroundImage, false );
		inkImageRef.SetVisible( m_backgroundImageTrace, false );
	}

	public function ShowBackgroundIcon()
	{
		inkImageRef.SetVisible( m_backgroundImage, true );
		inkImageRef.SetVisible( m_backgroundImageTrace, true );
	}

	public const function GetReturnButton() : inkWidget
	{
		return inkWidgetRef.Get( m_returnButton );
	}

	public const function GetDevicesSlot() : inkWidget
	{
		return inkWidgetRef.Get( m_deviceSlot );
	}

	public const function GetThumbnailListSlot() : inkWidget
	{
		return inkWidgetRef.Get( m_thumbnailsListSlot );
	}

	public const function GetMainCanvas() : inkWidget
	{
		return m_main_canvas;
	}

}

