ItemMixin

From Warcraft Wiki
Jump to navigation Jump to search

Source: FrameXML\ObjectAPI\Item.lua

API

Methods

ContinueOnItemLoad

local item = Item:CreateFromItemID(21524)

item:ContinueOnItemLoad(function()
	local name = item:GetItemName() 
	local icon = item:GetItemIcon()
	print(name, icon) -- "Red Winter Hat", 133169
end)


Warning Warning: Certain items no longer return information from the server. For example itemID 17 still returns true for C_Item.DoesItemExistByID but ITEM_DATA_LOAD_RESULT will have success:false and GetItemInfo will never return information.
This will make :ContinueOnItemLoad never fire the callback. One workaround is to use :ContinueWithCancelOnItemLoad with a timeout or directly listen to ITEM_DATA_LOAD_RESULT.

Patch changes

Battle for Azeroth Patch 8.0.1 (2018-07-17): Added.

See also