A library for tasks
Tasks can be various things, for example "kill Nalak this week" or "use your tradeskill cooldown today". The library does only store (not between sessions) tasks and propagate changes to interested listeners, it does not create tasks on its own nor does it display them.
For creating a task you should see the AddOrUpdateTask method, you can also remove tasks using the RemoveTask method. When ever a task is changed you should call the AddOrUpdateTask method again.
An example maybe explaines this best, you will need to add code for displaying the tasks somewhere in the callback methods. Example:
local libTasks = LibStub:GetLibrary('LibTasks-1.0') function addon:OnEnable() libTasks.RegisterCallback(self, 'LibTasks_NewTask') libTasks.RegisterCallback(self, 'LibTasks_ChangedTask') libTasks.RegisterCallback(self, 'LibTasks_RemovedTask') end function addon:OnDisable() libTasks:UnregisterAllCallbacks() end function addon:LibTasks_NewTask(event, taskData) -- do something end function addon:LibTask_ChangedTask(event, taskData) -- do something end function addon:LibTasks_RemovedTask(event, taskData) -- do something end
The taskData table specification is still open for extension/changes.
- Date created
- Apr 25, 2013
- Last update
- May 03, 2013
- Development stage
- GNU Lesser General Public License version 3 (LGPLv3)
- Recent files