class IceMachineInkGameController extends DeviceInkGameControllerBase
{
	[ category = "Widget Refs" ]
	private editable var m_buttonContainer : inkWidgetRef;
	[ category = "Widget Refs" ]
	private editable var m_soldOutText : inkTextRef;

	public override function UpdateActionWidgets( const widgetsData : ref< array< SActionWidgetPackage > > )
	{
		var i : Int32;
		var widget : inkWidget;
		HideActionWidgets();
		inkWidgetRef.SetVisible( m_buttonContainer, true );
		inkTextRef.SetVisible( m_soldOutText, false );
		if( widgetsData.Size() > 0 )
		{
			for( i = 0; i < widgetsData.Size(); i += 1 )
			{
				widget = GetActionWidget( widgetsData[ i ] );
				if( widget == NULL )
				{
					CreateActionWidgetAsync( inkWidgetRef.Get( m_buttonContainer ), widgetsData[ i ] );
				}
				else
				{
					InitializeActionWidget( widget, widgetsData[ i ] );
				}
			}
		}
		else
		{
			inkTextRef.SetVisible( m_soldOutText, true );
		}
	}

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

	protected override function Refresh( state : EDeviceStatus )
	{
		SetupWidgets();
		super.Refresh( state );
		HideActionWidgets();
		RequestActionWidgetsUpdate();
	}

}

