class InteractiveSignCustomData extends WidgetCustomData
{
	private var m_messege : String;
	private var m_signShape : SignShape;

	public function SetMessege( const text : ref< String > )
	{
		m_messege = text;
	}

	public function GetMessege() : String
	{
		return m_messege;
	}

	public function SetShape( shape : SignShape )
	{
		m_signShape = shape;
	}

	public function GetShape() : SignShape
	{
		return m_signShape;
	}

}

class InteractiveSignInkGameController extends DeviceInkGameControllerBase
{

	public override function UpdateDeviceWidgets( const widgetsData : ref< array< SDeviceWidgetPackage > > )
	{
		var i : Int32;
		var widget : inkWidget;
		super.UpdateDeviceWidgets( widgetsData );
		for( i = 0; i < widgetsData.Size(); i += 1 )
		{
			widget = GetDeviceWidget( widgetsData[ i ] );
			if( widget == NULL )
			{
				CreateDeviceWidgetAsync( GetRootWidget(), widgetsData[ i ] );
			}
			else
			{
				InitializeDeviceWidget( widget, widgetsData[ i ] );
			}
		}
	}

	protected override function GetOwner() : InteractiveSign
	{
		return ( ( InteractiveSign )( GetOwnerEntity() ) );
	}

	public override function Refresh( state : EDeviceStatus )
	{
		if( state == m_cashedState )
		{
			return;
		}
		if( state == EDeviceStatus.ON )
		{
			TurnON();
		}
		else
		{
			TurnOFF();
		}
		super.Refresh( state );
	}

	private function TurnON()
	{
		RequestDeviceWidgetsUpdate();
		GetRootWidget().SetVisible( true );
	}

	private function TurnOFF()
	{
		GetRootWidget().SetVisible( false );
	}

}

class InteractiveSignDeviceWidgetController extends DeviceWidgetControllerBase
{
	editable var m_messageWidgetPath : CName;
	editable var m_backgroundWidgetPath : CName;
	var m_messageWidget : weak< inkText >;
	var m_backgroundWidget : weak< inkWidget >;
}

