SpellMixin

From Wowpedia
Jump to: navigation, search

Methods

The SpellMixin interface is defined in ObjectAPI/Spell.lua [1]

spell = Spell:CreateFromSpellID(spellID)
SpellMixin:SetSpellID(spellID)
spellID = SpellMixin:GetSpellID()
SpellMixin:Clear()
isEmpty = SpellMixin:IsSpellEmpty()
isCached = SpellMixin:IsSpellDataCached()
spellName = SpellMixin:GetSpellName()
subText = SpellMixin:GetSpellSubtext()
desc = SpellMixin:GetSpellDescription()

SpellMixin:ContinueOnSpellLoad(callbackFunction)
SpellMixin:ContinueWithCancelOnSpellLoad(callbackFunction)

SpellMixin:ContinueOnSpellLoad

Some spell data may not be readily available at the time of a function call. You can use SpellMixin:ContinueOnSpellLoad to delay a call until the data is available.

local spell = Spell:CreateFromSpellID(spellID)
spell:ContinueOnSpellLoad(function()
	print(spell:GetSpellDescription())
	--print(GetSpellDescription(spellID))
end)

Patch changes

See also

References