WoWInterface SVN zz_Taunted

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 36 to Rev 37
    Reverse comparison

Rev 36 → Rev 37

trunk/zz_Taunted/LibCombatLog.lua
11,32 → 11,30
end
end
end
LibCombatLog['frame'] = LibCombatLog['frame'] or addon['RegisterFunc']({'PLAYER_ENTERING_WORLD'},"OnEvent", function(self,event,arg1)
LibCombatLog['frame'] = LibCombatLog['frame'] or addon:RegisterFunc({'PLAYER_ENTERING_WORLD'},"OnEvent", function(self,event,arg1)
self:UnregisterEvent(event)
self:SetScript("OnEvent", combatLog)
self:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
end)
local lib = {
['RegisterCLEvent'] = function(self,event,funcName)
if(type(event) ~= "string" and funcName) then
funcName = funcName or event[1]
for _,v in pairs(event) do
LibCombatLog['regs'][v] = LibCombatLog['regs'][v] or {}
LibCombatLog['regs'][v][self] = funcName
end
else
funcName = funcName or event
LibCombatLog['regs'][event] = LibCombatLog['regs'][event] or {}
LibCombatLog['regs'][event][self] = funcName
end
end,
['UnRegisterCLEvent'] = function(self, event)
if(LibCombatLog['regs'][event]) then
if(LibCombatLog['regs'][event][self]) then
LibCombatLog['regs'][event][self] = nil
end
end
end,
}
 
local lib = {}
function lib:RegisterCLEvent(event,funcName)
if(type(event) ~= "string" and funcName) then
funcName = funcName or event[1]
for _,v in pairs(event) do
LibCombatLog['regs'][v] = LibCombatLog['regs'][v] or {}
LibCombatLog['regs'][v][self] = funcName
end
else
funcName = funcName or event
LibCombatLog['regs'][event] = LibCombatLog['regs'][event] or {}
LibCombatLog['regs'][event][self] = funcName
end
end
function lib:UnRegisterCLEvent(event)
if(LibCombatLog['regs'][event]) then
if(LibCombatLog['regs'][event][self]) then
LibCombatLog['regs'][event][self] = nil
end
end
end
embed(lib)
trunk/zz_Taunted/taunted.lua
89,10 → 89,10
for k in pairs(spammer) do
spots = spots + spammer[k]['count']
end
addon['OnText'](name, spots)
addon:OnText(name, spots)
end
 
addon['CLParse'] = function(self, ...)
function addon:CLParse(...)
-- local event,timestamp, eventtype, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellId,spellName,spellSchool = ...
local name = tostring(select(6,...))
if not (UnitPlayerOrPetInParty(name) or UnitPlayerOrPetInRaid(name) or UnitIsUnit("player",name) or UnitIsUnit("pet",name)) then return end
106,11 → 106,11
end
if nameCompare(name,tank) and addon['db']['profile']['ignoreTanks'] then return end
if(not dontspam[tostring(select(13,...))] or spamShow) then
addon['Print'](L["Taunted"](name,select(10,...),select(14,...)))
addon:Print(L["Taunted"](name,select(10,...),select(14,...)))
end
spamShow = false
else
addon['Print'](L["Taunted Fail"](name,select(10,...),select(14,...)))
addon:Print(L["Taunted Fail"](name,select(10,...),select(14,...)))
end
OnUpdate()
end
175,14 → 175,14
['OnTooltipShow'] = tooltip,
})
addon:AddConfigEntry(name, 'toggle', 'ignoreTanks', 'Ignore Tanks', 'Dont show taunts of tanks.', 1)
addon['RegisterCLEvent'](addon,"SPELL_CAST_SUCCESS","CLParse")
addon['RegisterCLEvent'](addon,"SPELL_MISSED","CLParse")
addon:RegisterCLEvent("SPELL_CAST_SUCCESS","CLParse")
addon:RegisterCLEvent("SPELL_MISSED","CLParse")
self:RegisterEvent("RAID_ROSTER_UPDATE")
OnUpdate()
end
 
addon['frame'] = addon['RegisterFunc']({'PLAYER_ENTERING_WORLD'},"OnEvent", function(self, event, ...)
addon['frame'] = addon:RegisterFunc({'PLAYER_ENTERING_WORLD'},"OnEvent", function(self, event, ...)
if(type(addon[event]) == 'function') then
addon[event](self, event, ...)
end
end)
end)
\ No newline at end of file