From 36060e84a3f6ca76d787e87d31ccaca1ff2f9000 Mon Sep 17 00:00:00 2001 From: Christopher Rosell Date: Sat, 17 Apr 2010 19:53:35 +0200 Subject: [PATCH] Reuse raid icons from dead mobs. --- Kungaloosh.toc | 2 +- kungaloosh.lua | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Kungaloosh.toc b/Kungaloosh.toc index 5ac3dd6..3c73502 100644 --- a/Kungaloosh.toc +++ b/Kungaloosh.toc @@ -1,7 +1,7 @@ ## Interface: 30300 ## Title: Kungaloosh ## Notes: Automagic raid marking when tanking -## Version: 1.0 +## Version: 1.1 ## Author: Christopher Rosell ## X-Email: chrippa@gmail.com ## X-Category: Combat diff --git a/kungaloosh.lua b/kungaloosh.lua index d16c58b..48afa79 100644 --- a/kungaloosh.lua +++ b/kungaloosh.lua @@ -59,12 +59,22 @@ function addon:UNIT_THREAT_LIST_UPDATE() end end +function addon:COMBAT_LOG_EVENT(timestamp, event, sguid, sname, sflags, dguid, dname, dflags) + if event == 'UNIT_DIED' then + for icon, guid in pairs(self.iconstate) do + if dguid == guid then + self.iconstate[icon] = nil + end + end + end +end + function addon:RAID_TARGET_UPDATE() local function check(unit) if UnitExists(unit) then local icon = GetRaidTargetIndex(unit) if icon then - self.iconstate[icon] = true + self.iconstate[icon] = UnitGUID(unit) end end end @@ -126,6 +136,7 @@ function addon:Enable(msg) self:RegisterEvent'PLAYER_REGEN_ENABLED' self:RegisterEvent'UNIT_THREAT_LIST_UPDATE' self:RegisterEvent'RAID_TARGET_UPDATE' + self:RegisterEvent'COMBAT_LOG_EVENT' self.enabled = true self:ResetState() @@ -139,6 +150,7 @@ function addon:Disable(msg) self:UnregisterEvent'PLAYER_REGEN_ENABLED' self:UnregisterEvent'UNIT_THREAT_LIST_UPDATE' self:UnregisterEvent'RAID_TARGET_UPDATE' + self:UnregisterEvent'COMBAT_LOG_EVENT' self.enabled = false if msg then self:Print(msg) end -- 1.7.9.5