class VisualDisplayController extends InventoryItemDisplayController
{
	private var m_equipped : Bool;

	public override function BindVisualSlot( equipmentArea : gamedataEquipmentArea, itemsAmount : Int32, optional inventoryItemData : InventoryItemData, optional slotIndex : Int32, optional displayContext : ItemDisplayContext )
	{
		m_equipmentArea = equipmentArea;
		m_slotIndex = slotIndex;
		SetDisplayContext( displayContext, NULL );
		OnVisualUpdate( inventoryItemData, itemsAmount, false );
		RefreshUI();
	}

	public override function InvalidateVisualContent( const inventoryItemData : ref< InventoryItemData >, itemsAmount : Int32, equipped : Bool )
	{
		OnVisualUpdate( inventoryItemData, itemsAmount, equipped );
	}

	private function OnVisualUpdate( const inventoryItemData : ref< InventoryItemData >, itemsAmount : Int32, equipped : Bool )
	{
		m_itemID = InventoryItemData.GetID( inventoryItemData );
		m_itemData = inventoryItemData;
		inkTextRef.SetText( m_slotItemsCount, IntToString( itemsAmount ) );
		inkWidgetRef.SetVisible( m_slotItemsCountWrapper, itemsAmount > 0 );
		m_equipped = equipped;
		RefreshUI();
	}

	protected override function RefreshUI()
	{
		UpdateIcon();
		UpdateQuantity();
		UpdateEquipped();
		UpdateIndicators();
		UpdateIsNewIndicator();
		UpdateLoot();
	}

	protected override function ShouldShowEquipped() : Bool
	{
		return m_equipped;
	}

	public function SetIconsVisible( visible : Bool )
	{
		inkImageRef.SetVisible( m_itemImage, visible && !( InventoryItemData.IsEmpty( m_itemData ) ) );
		inkImageRef.SetVisible( m_itemEmptyImage, visible && InventoryItemData.IsEmpty( m_itemData ) );
	}

}

