From f6b7736c0fcf5aa03a81109d8e2dd5b507b00a07 Mon Sep 17 00:00:00 2001 From: Xruptor Date: Mon, 10 Oct 2016 19:40:05 -0400 Subject: [PATCH] Some small bug fixes --- XanDebuffTimers.lua | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/XanDebuffTimers.lua b/XanDebuffTimers.lua index 25a3e13..8057152 100644 --- a/XanDebuffTimers.lua +++ b/XanDebuffTimers.lua @@ -104,6 +104,7 @@ function f:PLAYER_LOGIN() XDT_DB.grow = true DEFAULT_CHAT_FRAME:AddMessage("xanDebuffTimers: Bars will now grow [|cFF99CC33DOWN|r]") end + f:adjustBars() return true elseif c and c:lower() == "sort" then if XDT_DB.sort then @@ -114,6 +115,9 @@ function f:PLAYER_LOGIN() DEFAULT_CHAT_FRAME:AddMessage("xanDebuffTimers: Bars sort [|cFF99CC33ASCENDING|r]") end return true + elseif c and c:lower() == "reload" then + f:ReloadDebuffs() + return true end end @@ -122,6 +126,7 @@ function f:PLAYER_LOGIN() DEFAULT_CHAT_FRAME:AddMessage("/xdt scale # - sets the scale size of the bars") DEFAULT_CHAT_FRAME:AddMessage("/xdt grow - changes the direction in which the bars grow (UP/DOWN)") DEFAULT_CHAT_FRAME:AddMessage("/xdt sort - changes the sorting of the bars. (ASCENDING/DESCENDING)") + DEFAULT_CHAT_FRAME:AddMessage("/xdt reload - reload all the debuff bars") end local ver = tonumber(GetAddOnMetadata("xanDebuffTimers","Version")) or 'Unknown' @@ -166,6 +171,13 @@ local eventSwitch = { ["SPELL_HEAL"] = true, ["SPELL_DAMAGE"] = true, ["SPELL_PERIODIC_DAMAGE"] = true, + --added new + ["SPELL_DRAIN"] = true, + ["SPELL_LEECH"] = true, + ["SPELL_PERIODIC_DRAIN"] = true, + ["SPELL_PERIODIC_LEECH"] = true, + ["DAMAGE_SHIELD"] = true, + ["DAMAGE_SPLIT"] = true, } function f:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, eventType, hideCaster, sourceGUID, sourceName, srcFlags, sourceRaidFlags, dstGUID, destName, destFlags, destRaidFlags, spellID, spellName, spellSchool, auraType, amount) @@ -338,6 +350,24 @@ function f:generateBars() end +function f:adjustBars() + local adj = 0 + for i=1, MAX_TIMERS do + if XDT_DB.grow then + timers[i]:ClearAllPoints() + timers[i]:SetPoint("TOPLEFT", XDT_Anchor, "BOTTOMRIGHT", 0, adj) + timersFocus[i]:ClearAllPoints() + timersFocus[i]:SetPoint("TOPLEFT", XDT_FocusAnchor, "BOTTOMRIGHT", 0, adj) + else + timers[i]:ClearAllPoints() + timers[i]:SetPoint("BOTTOMLEFT", XDT_Anchor, "TOPRIGHT", 0, (adj * -1)) + timersFocus[i]:ClearAllPoints() + timersFocus[i]:SetPoint("BOTTOMLEFT", XDT_FocusAnchor, "TOPRIGHT", 0, (adj * -1)) + end + adj = adj - BAR_ADJUST + end +end + function f:ProcessDebuffBar(data) local beforeEnd = data.endTime - GetTime() -- local percentTotal = (beforeEnd / data.durationTime) @@ -447,6 +477,14 @@ function f:ClearDebuffs(id) end +function f:ReloadDebuffs() + f:ClearDebuffs("target") + f:ClearDebuffs("focus") + + f:ProcessDebuffs("target") + f:ProcessDebuffs("focus") +end + function f:ShowDebuffs(id) if locked then return end -- 1.7.9.5