Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

ItemMixin

From Wowpedia
Jump to: navigation, search

Methods

The ItemMixin interface is defined in ObjectAPI/Item.lua.

item = Item:CreateFromItemLocation(itemLocation)
item = Item:CreateFromBagAndSlot(bagID, slotIndex)
item = Item:CreateFromEquipmentSlot(equipmentSlotIndex)
item = Item:CreateFromItemLink(itemLink)
item = Item:CreateFromItemID(itemID)
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())
	--local _, itemLink = GetItemInfo(itemID)
	--print(itemLink)
end)

Patch changes

See also