Callbacks
LibQuixote-2.0 Callback API
LibQuixote-2.0 communicates a lot of data to you by firing callbacks. This is an alternative to the plain-blizzard way of registering QUEST_LOG_UPDATE, storing a copy of the data, and scanning the whole thing whenever it fires to check for changes.
Here's a quick example of how to set up these callbacks:
local quixote = LibStub("LibQuixote-2.0") local myAddon = {} function myAddon:Quest_Lost(event, title, uid, zone) ... end quixote.RegisterCallback(myAddon, "Quest_Lost")
There are some standard arguments to the callbacks, which I'm not going to explain each time:
- name
- the name of the quest, in the current locale.
- uid
- is the numeric unique id of the quest, as extracted from its link
Now here's a full list of the callbacks, and the data they provide:
Standard quest callbacks
- Quest_Gained (name, uid, number of objectives, category, provider, provider is a player?)
- Quest_Complete (name, uid)
- Quest_Failed (name, uid)
- Quest_Lost (name, uid)
- Quest_Abandoned (name, uid)
- Objective_Update (name, uid, objective, number had before, number got now, number needed, type)
- Update : fires whenever any of the above events do
- Ready : fires the first time quixote has data available
Party information
- Party_Quest_Gained (party member, uid, name)
- Party_Quest_Complete (party member, uid, name)
- Party_Quest_Failed (party member, uid, name)
- Party_Quest_Lost (party member, uid, name)
- Party_Objective_Update (party member, uid, name, objective, number got now, number needed, is reputation?)
- Party_Update (party member) : fires whenever any of the above events do
- Sync_Finished (party member) : fires when data has finished being synced with a player
Comments