class SmartHouseDeviceWidgetController extends DeviceWidgetControllerBase
{
	private var m_interiorManagerSlot : weak< inkWidget >;

	protected event OnInitialize()
	{
		m_interiorManagerSlot = ( ( inkWidget )( GetWidget( 'device_main_panel/actions_canvas/mainActionPanel/interiorManager' ) ) );
	}

	public override function Initialize( gameController : DeviceInkGameControllerBase, widgetData : SDeviceWidgetPackage )
	{
		var i : Int32;
		var actionWidget : inkWidget;
		var widgetPackage : SActionWidgetPackage;
		for( i = widgetData.actionWidgets.Size() - 1; i >= 0; i -= 1 )
		{
			if( ( ( OpenInteriorManager )( widgetData.actionWidgets[ i ].action ) ) )
			{
				widgetPackage = widgetData.actionWidgets[ i ];
				widgetData.actionWidgets.Erase( i );
			}
		}
		super.Initialize( gameController, widgetData );
		if( widgetPackage.action && m_interiorManagerSlot )
		{
			actionWidget = GetActionWidget( widgetPackage, gameController );
			if( actionWidget == NULL )
			{
				CreateActionWidgetAsync( gameController, m_interiorManagerSlot, widgetPackage );
			}
			else
			{
				InitializeActionWidget( gameController, actionWidget, widgetPackage );
			}
		}
	}

}

