mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-12 00:20:01 +00:00
thirdparty: add support for superwow spell cast
This commit is contained in:
@@ -796,6 +796,49 @@ pfUI:RegisterModule("thirdparty-vanilla", "vanilla", function()
|
||||
end)
|
||||
end)
|
||||
|
||||
-- SuperWoW
|
||||
-- Vanilla: https://github.com/balakethelock/SuperWoW
|
||||
HookAddonOrVariable("SpellInfo", function()
|
||||
if C.thirdparty.superwow.enable == "0" then return end
|
||||
|
||||
-- add UnitGUID based casting info to libcast
|
||||
local unitcast = CreateFrame("Frame")
|
||||
unitcast:RegisterEvent("UNIT_CASTEVENT")
|
||||
unitcast:SetScript("OnEvent", function()
|
||||
if event == "UNIT_CASTEVENT" and arg3 == "START" then
|
||||
-- human readable argument list
|
||||
local guid = arg1
|
||||
local target = arg2
|
||||
local event_type = arg3
|
||||
local spell_id = arg4
|
||||
local timer = arg5
|
||||
local start = GetTime()
|
||||
|
||||
-- get spell info from spell id
|
||||
local spell, icon, _
|
||||
if SpellInfo and SpellInfo(spell_id) then
|
||||
spell, _, icon = SpellInfo(spell_id)
|
||||
end
|
||||
|
||||
-- set fallback values
|
||||
spell = spell or UNKNOWN
|
||||
icon = icon or "Interface\\Icons\\INV_Misc_QuestionMark"
|
||||
|
||||
-- add cast action to the database
|
||||
if not libcast.db[guid] then libcast.db[guid] = {} end
|
||||
libcast.db[guid].cast = spell
|
||||
libcast.db[guid].rank = nil
|
||||
libcast.db[guid].start = GetTime()
|
||||
libcast.db[guid].casttime = timer
|
||||
libcast.db[guid].icon = icon
|
||||
libcast.db[guid].channel = false
|
||||
|
||||
-- write state variable
|
||||
superwow_active = true
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- SortBags
|
||||
-- Vanilla: https://github.com/shirsig/SortBags-vanilla
|
||||
HookAddonOrVariable("SortBags", function()
|
||||
|
||||
Reference in New Issue
Block a user