LibTasks-1.0

Warning: This project is experimental. Its files will not synchronize across the CurseForge network.

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.

Task sources

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.

Task displays

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

taskData table

The taskData table specification is still open for extension/changes.


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files