Files
coa-details/functions/hooks.lua
T
tercio dcf1453a9d - Added Raid Tools bracket on Options Panel.
- Added Interrupt, cooldown usage and death announcers for raid tools.

- New API: _detalhes:SendMsgToChannel (msg, channel, towho) seng a message to a chat channel.
- New API: _detalhes:CreateEventListener() creates a table which accept Details Event Registration with RegisterEvent and receive events through OnDetailsEvent().
- New API: _detalhes:GetCooldownList (class) return a table with spellids of defensive cooldowns of the requested class.
- New Hook: DETAILS_HOOK_INTERRUPT call when a interrupt happens during a combat.
- Framework: Added CreateImage (parent, texture, w, h, layer, coords, member, name)
- Framework: Added CreateSwitch (parent, on_switch, default_value, w, h, ltext, rtext, member, name, color_inverted, switch_func, return_func)
2014-08-30 18:23:35 -03:00

61 lines
1.7 KiB
Lua

--File Revision: 1
--Last Modification: 06/12/2013
-- Change Log:
-- 06/12/2013: file added.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--[[global]] DETAILS_HOOK_COOLDOWN = "HOOK_COOLDOWN"
--[[global]] DETAILS_HOOK_DEATH = "HOOK_DEATH"
--[[global]] DETAILS_HOOK_BATTLERESS = "HOOK_BATTLERESS"
--[[global]] DETAILS_HOOK_INTERRUPT = "HOOK_INTERRUPT"
--[[global]] DETAILS_HOOK_BUFF = "HOOK_BUFF" --[[REMOVED--]]
local _detalhes = _G._detalhes
local _
_detalhes.hooks ["HOOK_COOLDOWN"] = {}
_detalhes.hooks ["HOOK_DEATH"] = {}
_detalhes.hooks ["HOOK_BATTLERESS"] = {}
_detalhes.hooks ["HOOK_INTERRUPT"] = {}
_detalhes.hooks ["HOOK_BUFF"] = {} --[[REMOVED--]]
function _detalhes:InstallHook (hook_type, func)
if (not _detalhes.hooks [hook_type]) then
return false, "Invalid hook type."
end
_detalhes.hooks [hook_type] [#_detalhes.hooks [hook_type] + 1] = func
_detalhes.hooks [hook_type].enabled = true
_detalhes:UpdateParserGears()
return true
end
function _detalhes:UnInstallHook (hook_type, func)
if (not _detalhes.hooks [hook_type]) then
return false, "Invalid hook type."
end
for index, this_func in ipairs (_detalhes.hooks [hook_type]) do
if (this_func == func) then
table.remove (_detalhes.hooks [hook_type], index)
if (#_detalhes.hooks [hook_type] == 0) then
_detalhes.hooks [hook_type].enabled = false
end
_detalhes:UpdateParserGears()
return true
end
end
end