diff --git a/Rekt.lua b/Rekt.lua index 55878a7..c87a791 100644 --- a/Rekt.lua +++ b/Rekt.lua @@ -73,6 +73,14 @@ Rekt.defaults = { colorframeenabled = true, colorframesize = 4 }, + warnframe = { + enabled = true, + size = 40, + xPos = 380, + yPos = 380, + textsize = 14, + textposition = tostring(1) + }, targetdr = { enabled = true, size = 27, @@ -242,7 +250,7 @@ function Rekt:CombatLogClearFix() --this will happen on the first run, this is here, becouse on the first test, --the first clear on load just bugged the addon, until the second clear - if delta > 30 then + if delta < 30 then return; end @@ -309,7 +317,7 @@ function Rekt:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, eventType, srcGUID, srcN end if Rekt.spells[spellID] then - Rekt:AddCd(srcGUID, spellID, srcFlags); + Rekt:AddCd(srcGUID, spellID, eventType, srcFlags); end end diff --git a/data/cooldowns.lua b/data/cooldowns.lua index 1c55e39..d143515 100644 --- a/data/cooldowns.lua +++ b/data/cooldowns.lua @@ -51,7 +51,7 @@ function Rekt:ReassignCds(which) end end -function Rekt:AddCd(srcGUID, spellID, srcFlags) +function Rekt:AddCd(srcGUID, spellID, eventType, srcFlags) local db = Rekt.db.profile; if not db["enabled"] then return end; @@ -106,7 +106,7 @@ function Rekt:AddCd(srcGUID, spellID, srcFlags) } --Interruptbar - if interrupt and db["interruptbar"]["enabled"] then + if interrupt and db["interruptbar"]["enabled"] and eventType == "SPELL_CAST_SUCCESS" then Rekt:AddInterruptCD(Rekt.cds[srcGUID][spellID], srcFlags); end diff --git a/data/interruptbar.lua b/data/interruptbar.lua index 7a9f5a0..9d4a307 100644 --- a/data/interruptbar.lua +++ b/data/interruptbar.lua @@ -15,7 +15,6 @@ function Rekt:AddInterruptCD(cooldown, srcFlags) end end - local ir = Rekt.interrupts; ir["count"] = ir["count"] + 1; @@ -97,7 +96,8 @@ function Rekt:UpdateIBCDs() if found then self.interrupts["count"] = self.interrupts["count"] - count; - self.interrupts["spells"] = Rekt.NormalizeTable(self.interrupts["spells"]); + --self:Print("Count:" .. count .. " self.interruptscount: " .. self.interrupts["count"]); + self.interrupts["spells"] = Rekt:NormalizeTable(self.interrupts["spells"]); end return found; @@ -116,9 +116,12 @@ end for k, v in pairs(table) do if v then tmp[i] = v; + i = i + 1; end end + --self:Print("normalize i: " .. i); + return tmp; end diff --git a/data/optiontable.lua b/data/optiontable.lua index dd2433d..30f9eb4 100644 --- a/data/optiontable.lua +++ b/data/optiontable.lua @@ -232,6 +232,48 @@ function Rekt:getTargetandFocusOptions() Rekt:setColorFrameSize("interruptbar", v); end }, + + warnHeader = { + type = "header", name = "Warn Frame's settings", order = 40 + }, + warntoggle = { + type = "toggle", name = "Warn Frame", desc = "Enable/Disable showing the Warn Frame", order = 41, + get = function() return Rekt:isPartEnabled("interruptbar") end, + set = function(_, v) + Rekt:SetPartEnabledOrDisabled("interruptbar", v); + end + }, + warnrange = { + type = "range", name = "Warn Frame's size", order = 42, min = 10, max = 150, step = 1, + get = function() return Rekt:getFrameSize("interruptbar") end, + set = function(_, v) + Rekt:setFrameSize("interruptbar", v); + end + }, + warntextsizerange = { + type = "range", name = "Text size", desc = "Warn Frame's Text size. Set it to 0 to disable it!", + order = 43, min = 1, max = 30, step = 1, + get = function() return Rekt:getDRNumSize("targetdr") end, + set = function(_, v) + Rekt:setDRNumSize("targetdr", v); + end + }, + warntextposselect = { + type = "select", style = "dropdown", name = "Warn Frame Text Position", + desc = "Change the target's DR's number's position.", order = 44, + values = { + ["1"] = "Up", + ["2"] = "Right", + ["3"] = "Down", + ["4"] = "Left", + ["5"] = "Middle" + }, + get = function() return Rekt:getDRNumPosition("targetdr") end, + set = function(_, v) + Rekt:setDRNumPosition("targetdr", v); + end + }, + } return args; end