4b284d9521
modules/Interrupt.lua: the COMBAT_LOG_EVENT_UNFILTERED handler had destFlags at
arg position 9 (pre-RaidFlags layout); on 3.3.5 the signature is
(event, ts, subevent, hideCaster, srcGUID, srcName, srcFlags, srcRaidFlags,
destGUID, destName, destFlags, destRaidFlags, spellId, spellName, spellSchool, ...).
destFlags is the 11th function parameter. Rewrite the parameter list with
all named args through spellSchool so the 0x511 (player + raid + me) bitmask
check on destFlags fires correctly and the SPELL_INTERRUPT path actually
recolors Player.Bar on the local player.
Config.lua: ChatCommand() called InterfaceOptionsFrame_OpenToCategory()
unconditionally. That global is nil on CoA's 3.3.5 client, so /quartz and /q3
with no arg threw 'attempt to call global ... (a nil value)'. Wrap with a
presence check and fall back to AceConfigDialog-3.0:Open("Quartz3").
luac -p clean on both files. libs/ untouched (coa-ace3-managed).
108 lines
3.1 KiB
Lua
108 lines
3.1 KiB
Lua
--[[
|
|
Copyright (C) 2006-2007 Nymbia
|
|
Copyright (C) 2010 Hendrik "Nevcairiel" Leppkes < h.leppkes@gmail.com >
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
]]
|
|
local Quartz3 = LibStub("AceAddon-3.0"):GetAddon("Quartz3")
|
|
local L = LibStub("AceLocale-3.0"):GetLocale("Quartz3")
|
|
|
|
local MODNAME = "Interrupt"
|
|
local Interrupt = Quartz3:NewModule(MODNAME, "AceEvent-3.0")
|
|
local Player = Quartz3:GetModule("Player")
|
|
|
|
local db, getOptions
|
|
|
|
----------------------------
|
|
-- Upvalues
|
|
local GetTime = GetTime
|
|
local unpack = unpack
|
|
local SPELLINTERRUPTOTHERSELF, UNKNOWN = SPELLINTERRUPTOTHERSELF, UNKNOWN
|
|
|
|
local defaults = {
|
|
profile = {
|
|
interruptcolor = {0,0,0},
|
|
},
|
|
}
|
|
|
|
function Interrupt:OnInitialize()
|
|
self.db = Quartz3.db:RegisterNamespace(MODNAME, defaults)
|
|
db = self.db.profile
|
|
|
|
self:SetEnabledState(Quartz3:GetModuleEnabled(MODNAME))
|
|
Quartz3:RegisterModuleOptions(MODNAME, getOptions, L["Interrupt"])
|
|
end
|
|
|
|
function Interrupt:OnEnable()
|
|
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
|
end
|
|
|
|
function Interrupt:ApplySettings()
|
|
db = self.db.profile
|
|
end
|
|
|
|
-- 3.3.5 CLEU signature:
|
|
-- (event, timestamp, subevent, hideCaster,
|
|
-- srcGUID, srcName, srcFlags, srcRaidFlags,
|
|
-- destGUID, destName, destFlags, destRaidFlags,
|
|
-- spellId, spellName, spellSchool, extraSpellId, extraSpellName, extraSpellSchool)
|
|
function Interrupt:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, combatEvent, hideCaster,
|
|
srcGUID, sourceName, srcFlags, srcRaidFlags,
|
|
destGUID, destName, destFlags, destRaidFlags,
|
|
spellId, spellName, spellSchool)
|
|
if combatEvent == "SPELL_INTERRUPT" and destFlags == 0x511 then
|
|
Player.Bar.Text:SetFormattedText(L["INTERRUPTED (%s)"], (sourceName or UNKNOWN):upper())
|
|
Player.Bar.Bar:SetStatusBarColor(unpack(db.interruptcolor))
|
|
Player.Bar.stopTime = GetTime()
|
|
end
|
|
end
|
|
|
|
do
|
|
local options
|
|
function getOptions()
|
|
options = options or {
|
|
type = "group",
|
|
name = L["Interrupt"],
|
|
order = 600,
|
|
args = {
|
|
toggle = {
|
|
type = "toggle",
|
|
name = L["Enable"],
|
|
get = function()
|
|
return Quartz3:GetModuleEnabled(MODNAME)
|
|
end,
|
|
set = function(info, v)
|
|
Quartz3:SetModuleEnabled(MODNAME, v)
|
|
end,
|
|
order = 100,
|
|
},
|
|
interruptcolor = {
|
|
type = "color",
|
|
name = L["Interrupt Color"],
|
|
desc = L["Set the color the cast bar is changed to when you have a spell interrupted"],
|
|
set = function(info, ...)
|
|
db.interruptcolor = {...}
|
|
end,
|
|
get = function()
|
|
return unpack(db.interruptcolor)
|
|
end,
|
|
order = 101,
|
|
},
|
|
},
|
|
}
|
|
return options
|
|
end
|
|
end
|