Join The Fan Lab, a private Fandom research community for users in the US and UK where you will be asked to share your opinions on all things gaming and entertainment! Click here to see if you qualify

ItemMixin

From Wowpedia
Jump to: navigation, search

ItemMixin is a polymoprhic reference to any item -- whether in your posession or not.

This mixin is defined in FrameXML/ObjectAPI/ItemLocation.lua

Construction

item = Item:CreateFromItemLocation(itemLocation)
item = Item:CreateFromBagAndSlot(bagID, slotIndex)
item = Item:CreateFromEquipmentSlot(equipmentSlotIndex)
item = Item:CreateFromItemLink(itemLink)
item = Item:CreateFromItemID(itemID)

Methods

ItemMixin:SetItemLocation(itemLocation)
ItemMixin:SetItemLink(itemLink)
ItemMixin:SetItemID(itemID)
itemLocation = ItemMixin:GetItemLocation()
hasItemLocation = ItemMixin:HasItemLocation()
ItemMixin:Clear()
isEmpty = ItemMixin:IsItemEmpty()
staticBackingItem = ItemMixin:GetStaticBackingItem()
inPlayersControl = ItemMixin:IsItemInPlayersControl()
itemID = ItemMixin:GetItemID()
itemLocked = ItemMixin:IsItemLocked()
ItemMixin:LockItem()
ItemMixin:UnlockItem()
itemIcon = ItemMixin:GetItemIcon()
itemName = ItemMixin:GetItemName()
itemLink = ItemMixin:GetItemLink()
itemQuality = ItemMixin:GetItemQuality()
itemLevel = ItemMixin:GetCurrentItemLevel()
itemQualityColor = ItemMixin:GetItemQualityColor()
inventoryType = ItemMixin:GetInventoryType()
itemGUID = ItemMixin:GetItemGUID()
inventoryTypeName = ItemMixin:GetInventoryTypeName()
dataCached = ItemMixin:IsItemDataCached()
dateEvictable = ItemMixin:IsDataEvictable()

ItemMixin:ContinueOnItemLoad(callbackFunction)
ItemMixin:ContinueWithCancelOnItemLoad(callbackFunction)

ItemMixin:ContinueOnItemLoad

Some item data may not have been cached from the server yet. You can use ItemMixin:ContinueOnItemLoad to delay a call until the data is available.

local item = Item:CreateFromItemID(itemID)
item:ContinueOnItemLoad(function()
	print(item:GetItemLink())
end)

Usage

ItemLocation is used as a function argument or event payload by some members of the following API systems:

Patch changes

See also