add interrupts to auras
This commit is contained in:
parent
326af8e796
commit
fa01d38989
@ -695,6 +695,49 @@ function Gladdy:GetImportantAuras()
|
|||||||
return importantAuras
|
return importantAuras
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local interrupts = {
|
||||||
|
[GetSpellInfo(19675)] = {duration = 4, spellID = 19675, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(19675)), priority = 15}, -- Feral Charge Effect (Druid)
|
||||||
|
[GetSpellInfo(2139)] = {duration = 8, spellID = 2139, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(2139)), priority = 15}, -- Counterspell (Mage)
|
||||||
|
[GetSpellInfo(1766)] = {duration = 5, spellID = 1766, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(1766)), priority = 15}, -- Kick (Rogue)
|
||||||
|
[GetSpellInfo(6552)] = {duration = 4, spellID = 6552, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(6552)), priority = 15}, -- Pummel (Warrior)
|
||||||
|
[GetSpellInfo(72)] = {duration = 6, spellID = 72, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(72)), priority = 15}, -- Shield Bash (Warrior)
|
||||||
|
[GetSpellInfo(8042)] = {duration = 2, spellID = 8042, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(8042)), priority = 15}, -- Earth Shock (Shaman)
|
||||||
|
[GetSpellInfo(19244)] = {duration = 5, spellID = 19244, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(19244)), priority = 15}, -- Spell Lock (Warlock
|
||||||
|
[GetSpellInfo(32747)] = {duration = 3, spellID = 32747, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(32747)), priority = 15}, -- Deadly Throw Interrupt
|
||||||
|
}
|
||||||
|
function Gladdy:GetInterrupts()
|
||||||
|
return interrupts
|
||||||
|
end
|
||||||
|
|
||||||
|
local auraTypeColor = {}
|
||||||
|
auraTypeColor["none"] = { r = 0.80, g = 0, b = 0 , a = 1}
|
||||||
|
auraTypeColor["magic"] = { r = 0.20, g = 0.60, b = 1.00, a = 1}
|
||||||
|
auraTypeColor["curse"] = { r = 0.60, g = 0.00, b = 1.00, a = 1 }
|
||||||
|
auraTypeColor["disease"] = { r = 0.60, g = 0.40, b = 0, a = 1 }
|
||||||
|
auraTypeColor["poison"] = { r = 0.00, g = 0.60, b = 0, a = 1 }
|
||||||
|
auraTypeColor["immune"] = { r = 1.00, g = 0.02, b = 0.99, a = 1 }
|
||||||
|
auraTypeColor["form"] = auraTypeColor["none"]
|
||||||
|
auraTypeColor["aura"] = auraTypeColor["none"]
|
||||||
|
auraTypeColor[""] = auraTypeColor["none"]
|
||||||
|
|
||||||
|
function Gladdy:GetAuraTypeColor()
|
||||||
|
return auraTypeColor
|
||||||
|
end
|
||||||
|
|
||||||
|
local spellSchoolColors = {}
|
||||||
|
spellSchoolColors[1] = {r = 1, g = 1, b = 0, a = 1, type = "Physical"} --- "physical" 255, 255, 0
|
||||||
|
spellSchoolColors[2] = {r = 1, g = 0.901, b = 0.501, a = 1, type = "Holy"} ---"holy" -- 255, 230, 128
|
||||||
|
spellSchoolColors[4] = {r = 1, g = 0.501, b = 0, a = 1, type = "Fire"} ---"fire" -- 255, 128, 0
|
||||||
|
spellSchoolColors[8] = {r = 0.302, g = 1, b = 0.302, a = 1, type = "Nature"} ---"nature" -- 77, 255, 77
|
||||||
|
spellSchoolColors[16] = {r = 0.501, g = 1, b = 1, a = 1, type = "Frost"} ---"frost" -- 128, 255, 255
|
||||||
|
spellSchoolColors[32] = {r = 0.501, g = 0.501, b = 1, a = 1, type = "Shadow"} ---"shadow" --128, 128, 255
|
||||||
|
spellSchoolColors[64] = {r = 1, g = 0.501, b = 1, a = 1, type = "Arcane"} ---"arcane" -- 255, 128, 255
|
||||||
|
spellSchoolColors["unknown"] = {r = 0, g = 0, b = 0, a = 1, type = "Unknown"} ---"unknown spell school"
|
||||||
|
|
||||||
|
function Gladdy:GetSpellSchoolColors()
|
||||||
|
return spellSchoolColors
|
||||||
|
end
|
||||||
|
|
||||||
local cooldownList = {
|
local cooldownList = {
|
||||||
-- Spell Name Cooldown[, Spec]
|
-- Spell Name Cooldown[, Spec]
|
||||||
-- Mage
|
-- Mage
|
||||||
|
@ -74,7 +74,7 @@ end
|
|||||||
|
|
||||||
function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
|
function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
|
||||||
-- timestamp,eventType,hideCaster,sourceGUID,sourceName,sourceFlags,sourceRaidFlags,destGUID,destName,destFlags,destRaidFlags,spellId,spellName,spellSchool
|
-- timestamp,eventType,hideCaster,sourceGUID,sourceName,sourceFlags,sourceRaidFlags,destGUID,destName,destFlags,destRaidFlags,spellId,spellName,spellSchool
|
||||||
local _,eventType,_,sourceGUID,_,_,_,destGUID,_,_,_,spellID,spellName = CombatLogGetCurrentEventInfo()
|
local _,eventType,_,sourceGUID,_,_,_,destGUID,_,_,_,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool = CombatLogGetCurrentEventInfo()
|
||||||
local srcUnit = Gladdy.guids[sourceGUID]
|
local srcUnit = Gladdy.guids[sourceGUID]
|
||||||
local destUnit = Gladdy.guids[destGUID]
|
local destUnit = Gladdy.guids[destGUID]
|
||||||
|
|
||||||
@ -91,6 +91,10 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
|
|||||||
if not Gladdy.buttons[destUnit].class then
|
if not Gladdy.buttons[destUnit].class then
|
||||||
Gladdy:SpotEnemy(destUnit, true)
|
Gladdy:SpotEnemy(destUnit, true)
|
||||||
end
|
end
|
||||||
|
--interrupt detection
|
||||||
|
if eventType == "SPELL_INTERRUPT" then
|
||||||
|
Gladdy:SendMessage("SPELL_INTERRUPT", destUnit,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if srcUnit then
|
if srcUnit then
|
||||||
if (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_AURA_APPLIED") then
|
if (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_AURA_APPLIED") then
|
||||||
|
@ -18,6 +18,16 @@ local function defaultSpells(auraType)
|
|||||||
end
|
end
|
||||||
return spells
|
return spells
|
||||||
end
|
end
|
||||||
|
local function defaultInterrupts()
|
||||||
|
local spells = {}
|
||||||
|
for k,v in pairs(Gladdy:GetInterrupts()) do
|
||||||
|
spells[tostring(v.spellID)] = {}
|
||||||
|
spells[tostring(v.spellID)].enabled = true
|
||||||
|
spells[tostring(v.spellID)].priority = v.priority
|
||||||
|
end
|
||||||
|
return spells
|
||||||
|
end
|
||||||
|
|
||||||
local Auras = Gladdy:NewModule("Auras", nil, {
|
local Auras = Gladdy:NewModule("Auras", nil, {
|
||||||
auraFont = "DorisPP",
|
auraFont = "DorisPP",
|
||||||
auraFontSizeScale = 1,
|
auraFontSizeScale = 1,
|
||||||
@ -27,7 +37,10 @@ local Auras = Gladdy:NewModule("Auras", nil, {
|
|||||||
auraDebuffBorderColor = { r = 0, g = 1, b = 0, a = 1 },
|
auraDebuffBorderColor = { r = 0, g = 1, b = 0, a = 1 },
|
||||||
auraDisableCircle = false,
|
auraDisableCircle = false,
|
||||||
auraCooldownAlpha = 1,
|
auraCooldownAlpha = 1,
|
||||||
auraListDefault = defaultSpells()
|
auraListDefault = defaultSpells(),
|
||||||
|
auraListInterrupts = defaultInterrupts(),
|
||||||
|
auraInterruptColorsEnabled = true,
|
||||||
|
auraInterruptColors = Gladdy:GetSpellSchoolColors()
|
||||||
})
|
})
|
||||||
|
|
||||||
function Auras:Initialize()
|
function Auras:Initialize()
|
||||||
@ -39,6 +52,7 @@ function Auras:Initialize()
|
|||||||
self:RegisterMessage("UNIT_DEATH")
|
self:RegisterMessage("UNIT_DEATH")
|
||||||
self:RegisterMessage("AURA_GAIN")
|
self:RegisterMessage("AURA_GAIN")
|
||||||
self:RegisterMessage("AURA_FADE")
|
self:RegisterMessage("AURA_FADE")
|
||||||
|
self:RegisterMessage("SPELL_INTERRUPT")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Auras:CreateFrame(unit)
|
function Auras:CreateFrame(unit)
|
||||||
@ -83,17 +97,92 @@ function Auras:CreateFrame(unit)
|
|||||||
|
|
||||||
auraFrame:SetScript("OnUpdate", function(self, elapsed)
|
auraFrame:SetScript("OnUpdate", function(self, elapsed)
|
||||||
if (self.active) then
|
if (self.active) then
|
||||||
|
if (self.interruptFrame.priority and self.priority < self.interruptFrame.priority) then
|
||||||
|
self:SetAlpha(0.01)
|
||||||
|
else
|
||||||
|
self:SetAlpha(1)
|
||||||
|
end
|
||||||
if (self.timeLeft <= 0) then
|
if (self.timeLeft <= 0) then
|
||||||
Auras:AURA_FADE(self.unit, self.track)
|
Auras:AURA_FADE(self.unit, self.track)
|
||||||
else
|
else
|
||||||
self.timeLeft = self.timeLeft - elapsed
|
self.timeLeft = self.timeLeft - elapsed
|
||||||
self.text:SetFormattedText("%.1f", self.timeLeft >= 0.0 and self.timeLeft or 0.0)
|
self.text:SetFormattedText("%.1f", self.timeLeft >= 0.0 and self.timeLeft or 0.0)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
self:SetAlpha(0.01)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Gladdy.buttons[unit].aura = auraFrame
|
Gladdy.buttons[unit].aura = auraFrame
|
||||||
self.frames[unit] = auraFrame
|
self.frames[unit] = auraFrame
|
||||||
|
self:CreateInterrupt(unit)
|
||||||
|
self:ResetUnit(unit)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Auras:CreateInterrupt(unit)
|
||||||
|
local interruptFrame = CreateFrame("Frame", nil, Gladdy.modules["Class Icon"].frames[unit])
|
||||||
|
interruptFrame:EnableMouse(false)
|
||||||
|
interruptFrame:SetFrameStrata("MEDIUM")
|
||||||
|
interruptFrame:SetFrameLevel(3)
|
||||||
|
|
||||||
|
interruptFrame.cooldown = CreateFrame("Cooldown", nil, interruptFrame, "CooldownFrameTemplate")
|
||||||
|
interruptFrame.cooldown.noCooldownCount = true
|
||||||
|
interruptFrame.cooldown:SetFrameStrata("MEDIUM")
|
||||||
|
interruptFrame.cooldown:SetFrameLevel(4)
|
||||||
|
interruptFrame.cooldown:SetReverse(true)
|
||||||
|
interruptFrame.cooldown:SetHideCountdownNumbers(true)
|
||||||
|
|
||||||
|
interruptFrame.cooldownFrame = CreateFrame("Frame", nil, interruptFrame)
|
||||||
|
interruptFrame.cooldownFrame:ClearAllPoints()
|
||||||
|
interruptFrame.cooldownFrame:SetAllPoints(interruptFrame)
|
||||||
|
interruptFrame.cooldownFrame:SetFrameStrata("MEDIUM")
|
||||||
|
interruptFrame.cooldownFrame:SetFrameLevel(5)
|
||||||
|
|
||||||
|
interruptFrame.icon = interruptFrame:CreateTexture(nil, "BACKGROUND")
|
||||||
|
interruptFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
|
||||||
|
interruptFrame.icon:SetAllPoints(interruptFrame)
|
||||||
|
|
||||||
|
interruptFrame.icon.overlay = interruptFrame.cooldownFrame:CreateTexture(nil, "OVERLAY")
|
||||||
|
interruptFrame.icon.overlay:SetAllPoints(interruptFrame)
|
||||||
|
interruptFrame.icon.overlay:SetTexture(Gladdy.db.buttonBorderStyle)
|
||||||
|
|
||||||
|
local classIcon = Gladdy.modules["Class Icon"].frames[unit]
|
||||||
|
interruptFrame:ClearAllPoints()
|
||||||
|
interruptFrame:SetAllPoints(classIcon)
|
||||||
|
|
||||||
|
interruptFrame.text = interruptFrame.cooldownFrame:CreateFontString(nil, "OVERLAY")
|
||||||
|
interruptFrame.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), 10, "OUTLINE")
|
||||||
|
interruptFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a)
|
||||||
|
--auraFrame.text:SetShadowOffset(1, -1)
|
||||||
|
--auraFrame.text:SetShadowColor(0, 0, 0, 1)
|
||||||
|
interruptFrame.text:SetJustifyH("CENTER")
|
||||||
|
interruptFrame.text:SetPoint("CENTER")
|
||||||
|
interruptFrame.unit = unit
|
||||||
|
|
||||||
|
interruptFrame:SetScript("OnUpdate", function(self, elapsed)
|
||||||
|
if (self.active) then
|
||||||
|
if (Auras.frames[self.unit].priority and self.priority <= Auras.frames[self.unit].priority) then
|
||||||
|
self:SetAlpha(0.01)
|
||||||
|
else
|
||||||
|
self:SetAlpha(1)
|
||||||
|
end
|
||||||
|
if (self.timeLeft <= 0) then
|
||||||
|
self.active = false
|
||||||
|
self.priority = nil
|
||||||
|
self.spellSchool = nil
|
||||||
|
self.cooldown:SetCooldown(GetTime(), 0)
|
||||||
|
self:SetAlpha(0.01)
|
||||||
|
else
|
||||||
|
self.timeLeft = self.timeLeft - elapsed
|
||||||
|
self.text:SetFormattedText("%.1f", self.timeLeft >= 0.0 and self.timeLeft or 0.0)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self:SetAlpha(0.01)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
Gladdy.buttons[unit].interruptFrame = interruptFrame
|
||||||
|
self.frames[unit].interruptFrame = interruptFrame
|
||||||
self:ResetUnit(unit)
|
self:ResetUnit(unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -132,6 +221,42 @@ function Auras:UpdateFrame(unit)
|
|||||||
if Gladdy.db.auraDisableCircle then
|
if Gladdy.db.auraDisableCircle then
|
||||||
auraFrame.cooldown:SetAlpha(0)
|
auraFrame.cooldown:SetAlpha(0)
|
||||||
end
|
end
|
||||||
|
self:UpdateInterruptFrame(unit)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Auras:UpdateInterruptFrame(unit)
|
||||||
|
local interruptFrame = self.frames[unit] and self.frames[unit].interruptFrame
|
||||||
|
if (not interruptFrame) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local width, height = Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor, Gladdy.db.classIconSize
|
||||||
|
|
||||||
|
interruptFrame:SetWidth(width)
|
||||||
|
interruptFrame:SetHeight(height)
|
||||||
|
interruptFrame:SetAllPoints(Gladdy.modules["Class Icon"].frames[unit])
|
||||||
|
|
||||||
|
interruptFrame.cooldown:SetWidth(width - width/16)
|
||||||
|
interruptFrame.cooldown:SetHeight(height - height/16)
|
||||||
|
interruptFrame.cooldown:ClearAllPoints()
|
||||||
|
interruptFrame.cooldown:SetPoint("CENTER", interruptFrame, "CENTER")
|
||||||
|
interruptFrame.cooldown:SetAlpha(Gladdy.db.auraCooldownAlpha)
|
||||||
|
|
||||||
|
interruptFrame.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE")
|
||||||
|
interruptFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a)
|
||||||
|
|
||||||
|
interruptFrame.icon.overlay:SetTexture(Gladdy.db.auraBorderStyle)
|
||||||
|
if interruptFrame.spellSchool then
|
||||||
|
interruptFrame.icon.overlay:SetVertexColor(self:GetInterruptColor(interruptFrame.spellSchool))
|
||||||
|
else
|
||||||
|
interruptFrame.icon.overlay:SetVertexColor(0, 0, 0, 1)
|
||||||
|
end
|
||||||
|
if not interruptFrame.active then
|
||||||
|
interruptFrame.icon.overlay:Hide()
|
||||||
|
end
|
||||||
|
if Gladdy.db.auraDisableCircle then
|
||||||
|
interruptFrame.cooldown:SetAlpha(0)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Auras:ResetUnit(unit)
|
function Auras:ResetUnit(unit)
|
||||||
@ -147,12 +272,14 @@ function Auras:Test(unit)
|
|||||||
spellName, _, icon = GetSpellInfo(7922)
|
spellName, _, icon = GetSpellInfo(7922)
|
||||||
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||||
self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
|
self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
|
||||||
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 7922, spellName, icon, self.auras[spellName].duration + 2, GetTime() + self.auras[spellName].duration + 2)
|
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 7922, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
|
||||||
|
self:SPELL_INTERRUPT(unit,19244, select(1, GetSpellInfo(19244)), "physical", 25396, select(1, GetSpellInfo(25396)), 64)
|
||||||
elseif (unit == "arena2") then
|
elseif (unit == "arena2") then
|
||||||
spellName, _, icon = GetSpellInfo(6770)
|
spellName, _, icon = GetSpellInfo(6770)
|
||||||
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||||
self:AURA_FADE(unit,AURA_TYPE_DEBUFF)
|
self:AURA_FADE(unit,AURA_TYPE_DEBUFF)
|
||||||
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 6770, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
|
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 6770, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
|
||||||
|
self:SPELL_INTERRUPT(unit,19244, select(1, GetSpellInfo(19244)), "physical", 25396, select(1, GetSpellInfo(25396)), 64)
|
||||||
elseif (unit == "arena3") then
|
elseif (unit == "arena3") then
|
||||||
spellName, _, icon = GetSpellInfo(31224)
|
spellName, _, icon = GetSpellInfo(31224)
|
||||||
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||||
@ -222,7 +349,7 @@ function Auras:AURA_FADE(unit, auraType)
|
|||||||
if auraFrame.active then
|
if auraFrame.active then
|
||||||
auraFrame.cooldown:SetCooldown(GetTime(), 0)
|
auraFrame.cooldown:SetCooldown(GetTime(), 0)
|
||||||
end
|
end
|
||||||
auraFrame.cooldown:Hide()
|
--auraFrame.cooldown:Hide()
|
||||||
auraFrame.active = false
|
auraFrame.active = false
|
||||||
auraFrame.name = nil
|
auraFrame.name = nil
|
||||||
auraFrame.timeLeft = 0
|
auraFrame.timeLeft = 0
|
||||||
@ -231,11 +358,123 @@ function Auras:AURA_FADE(unit, auraType)
|
|||||||
auraFrame.endTime = nil
|
auraFrame.endTime = nil
|
||||||
auraFrame.icon:SetTexture("")
|
auraFrame.icon:SetTexture("")
|
||||||
auraFrame.text:SetText("")
|
auraFrame.text:SetText("")
|
||||||
auraFrame.icon.overlay:Hide()
|
--auraFrame.icon.overlay:Hide()
|
||||||
auraFrame.cooldownFrame:Hide()
|
--auraFrame.cooldownFrame:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
function Auras:GetInterruptColor(extraSpellSchool)
|
||||||
|
if not Gladdy.db.auraInterruptColorsEnabled then
|
||||||
|
return Gladdy.db.auraDebuffBorderColor.r, Gladdy.db.auraDebuffBorderColor.g, Gladdy.db.auraDebuffBorderColor.b, Gladdy.db.auraDebuffBorderColor.a
|
||||||
|
else
|
||||||
|
local color = Gladdy.db.auraInterruptColors[extraSpellSchool] or Gladdy.db.auraInterruptColors["unknown"]
|
||||||
|
return color.r, color.g, color.b, color.a
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Auras:SPELL_INTERRUPT(unit,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool)
|
||||||
|
local auraFrame = self.frames[unit]
|
||||||
|
local interruptFrame = auraFrame and auraFrame.interruptFrame
|
||||||
|
local button = Gladdy.buttons[unit]
|
||||||
|
if (not interruptFrame) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if not Gladdy.db.auraListInterrupts[tostring(Gladdy:GetInterrupts()[spellName].spellID)] or not Gladdy.db.auraListInterrupts[tostring(Gladdy:GetInterrupts()[spellName].spellID)].enabled then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if (interruptFrame.priority and interruptFrame.priority > Gladdy.db.auraListInterrupts[tostring(Gladdy:GetInterrupts()[spellName].spellID)].priority) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local multiplier = ((button.spec == L["Restoration"] and button.class == "SHAMAN") or (button.spec == L["Holy"] and button.class == "PALADIN")) and 0.7 or 1
|
||||||
|
|
||||||
|
local duration = Gladdy:GetInterrupts()[spellName].duration * multiplier
|
||||||
|
|
||||||
|
interruptFrame.startTime = GetTime()
|
||||||
|
interruptFrame.endTime = GetTime() + duration
|
||||||
|
interruptFrame.name = spellName
|
||||||
|
interruptFrame.timeLeft = duration
|
||||||
|
interruptFrame.priority = Gladdy.db.auraListInterrupts[tostring(Gladdy:GetInterrupts()[spellName].spellID)].priority
|
||||||
|
interruptFrame.icon:SetTexture(Gladdy:GetInterrupts()[spellName].texture)
|
||||||
|
interruptFrame.spellSchool = extraSpellSchool
|
||||||
|
interruptFrame.active = true
|
||||||
|
interruptFrame.icon.overlay:Show()
|
||||||
|
interruptFrame.cooldownFrame:Show()
|
||||||
|
|
||||||
|
interruptFrame.icon.overlay:SetVertexColor(self:GetInterruptColor(extraSpellSchool))
|
||||||
|
|
||||||
|
if not Gladdy.db.auraDisableCircle then
|
||||||
|
interruptFrame.cooldown:Show()
|
||||||
|
interruptFrame.cooldown:SetCooldown(interruptFrame.startTime, duration)
|
||||||
|
end
|
||||||
|
--interruptFrame:SetAlpha(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Auras:GetOptions()
|
function Auras:GetOptions()
|
||||||
|
local borderArgs = {
|
||||||
|
headerAuras = {
|
||||||
|
type = "header",
|
||||||
|
name = L["Border"],
|
||||||
|
order = 2,
|
||||||
|
},
|
||||||
|
auraBorderStyle = Gladdy:option({
|
||||||
|
type = "select",
|
||||||
|
name = L["Border style"],
|
||||||
|
order = 9,
|
||||||
|
values = Gladdy:GetIconStyles(),
|
||||||
|
}),
|
||||||
|
auraBuffBorderColor = Gladdy:colorOption({
|
||||||
|
type = "color",
|
||||||
|
name = L["Buff color"],
|
||||||
|
desc = L["Color of the text"],
|
||||||
|
order = 10,
|
||||||
|
hasAlpha = true,
|
||||||
|
width = "0.8",
|
||||||
|
}),
|
||||||
|
auraDebuffBorderColor = Gladdy:colorOption({
|
||||||
|
type = "color",
|
||||||
|
name = L["Debuff color"],
|
||||||
|
desc = L["Color of the text"],
|
||||||
|
order = 11,
|
||||||
|
hasAlpha = true,
|
||||||
|
width = "0.8",
|
||||||
|
}),
|
||||||
|
headerColors = {
|
||||||
|
type = "header",
|
||||||
|
name = L["Interrupt Spells School Colors"],
|
||||||
|
order = 12,
|
||||||
|
},
|
||||||
|
auraInterruptColorsEnabled = Gladdy:option({
|
||||||
|
type = "toggle",
|
||||||
|
name = L["Enable Interrupt Spell School Colors"],
|
||||||
|
width = "full",
|
||||||
|
desc = L["Will use Debuff Color if disabled"],
|
||||||
|
order = 13,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
local list = {}
|
||||||
|
for k,v in pairs(Gladdy:GetSpellSchoolColors()) do
|
||||||
|
tinsert(list, { key = k, val = v})
|
||||||
|
end
|
||||||
|
tbl_sort(list, function(a, b) return a.val.type < b.val.type end)
|
||||||
|
for i,v in ipairs(list) do
|
||||||
|
borderArgs["auraSpellSchool" .. v.key] = {
|
||||||
|
type = "color",
|
||||||
|
name = v.val.type,
|
||||||
|
order = i + 13,
|
||||||
|
hasAlpha = true,
|
||||||
|
width = "0.8",
|
||||||
|
set = function(info, r, g, b, a)
|
||||||
|
Gladdy.db.auraInterruptColors[v.key].r = r
|
||||||
|
Gladdy.db.auraInterruptColors[v.key].g = g
|
||||||
|
Gladdy.db.auraInterruptColors[v.key].b = b
|
||||||
|
Gladdy.db.auraInterruptColors[v.key].a = a
|
||||||
|
end,
|
||||||
|
get = function()
|
||||||
|
local color = Gladdy.db.auraInterruptColors[v.key]
|
||||||
|
return color.r, color.g, color.b, color.a
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
header = {
|
header = {
|
||||||
type = "header",
|
type = "header",
|
||||||
@ -316,35 +555,7 @@ function Auras:GetOptions()
|
|||||||
type = "group",
|
type = "group",
|
||||||
name = L["Border"],
|
name = L["Border"],
|
||||||
order = 3,
|
order = 3,
|
||||||
args = {
|
args = borderArgs
|
||||||
headerAuras = {
|
|
||||||
type = "header",
|
|
||||||
name = L["Border"],
|
|
||||||
order = 2,
|
|
||||||
},
|
|
||||||
auraBorderStyle = Gladdy:option({
|
|
||||||
type = "select",
|
|
||||||
name = L["Border style"],
|
|
||||||
order = 9,
|
|
||||||
values = Gladdy:GetIconStyles(),
|
|
||||||
}),
|
|
||||||
auraBuffBorderColor = Gladdy:colorOption({
|
|
||||||
type = "color",
|
|
||||||
name = L["Buff color"],
|
|
||||||
desc = L["Color of the text"],
|
|
||||||
order = 10,
|
|
||||||
hasAlpha = true,
|
|
||||||
width = "0.8",
|
|
||||||
}),
|
|
||||||
auraDebuffBorderColor = Gladdy:colorOption({
|
|
||||||
type = "color",
|
|
||||||
name = L["Debuff color"],
|
|
||||||
desc = L["Color of the text"],
|
|
||||||
order = 11,
|
|
||||||
hasAlpha = true,
|
|
||||||
width = "0.8",
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -361,6 +572,13 @@ function Auras:GetOptions()
|
|||||||
name = "Buffs",
|
name = "Buffs",
|
||||||
order = 5,
|
order = 5,
|
||||||
args = Auras:GetAuraOptions(AURA_TYPE_BUFF)
|
args = Auras:GetAuraOptions(AURA_TYPE_BUFF)
|
||||||
|
},
|
||||||
|
interruptList = {
|
||||||
|
type = "group",
|
||||||
|
childGroups = "tree",
|
||||||
|
name = "Interrupts",
|
||||||
|
order = 6,
|
||||||
|
args = Auras:GetInterruptOptions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -441,3 +659,78 @@ function Auras:GetAuraOptions(auraType)
|
|||||||
end
|
end
|
||||||
return options
|
return options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Auras:GetInterruptOptions()
|
||||||
|
local options = {
|
||||||
|
ckeckAll = {
|
||||||
|
order = 1,
|
||||||
|
width = "0.7",
|
||||||
|
name = L["Check All"],
|
||||||
|
type = "execute",
|
||||||
|
func = function(info)
|
||||||
|
for k,v in pairs(defaultInterrupts()) do
|
||||||
|
Gladdy.db.auraListInterrupts[k].enabled = true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
uncheckAll = {
|
||||||
|
order = 2,
|
||||||
|
width = "0.7",
|
||||||
|
name = L["Uncheck All"],
|
||||||
|
type = "execute",
|
||||||
|
func = function(info)
|
||||||
|
for k,v in pairs(defaultInterrupts()) do
|
||||||
|
Gladdy.db.auraListInterrupts[k].enabled = false
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
local auras = {}
|
||||||
|
for k,v in pairs(Gladdy:GetInterrupts()) do
|
||||||
|
tinsert(auras, v.spellID)
|
||||||
|
end
|
||||||
|
tbl_sort(auras, function(a, b) return GetSpellInfo(a) < GetSpellInfo(b) end)
|
||||||
|
for i,k in ipairs(auras) do
|
||||||
|
options[tostring(k)] = {
|
||||||
|
type = "group",
|
||||||
|
name = Gladdy:GetInterrupts()["Unstable Affliction Silence"]
|
||||||
|
and Gladdy:GetInterrupts()["Unstable Affliction Silence"].spellID == k
|
||||||
|
and Gladdy:GetInterrupts()["Unstable Affliction Silence"].altName
|
||||||
|
or GetSpellInfo(k),
|
||||||
|
order = i+2,
|
||||||
|
icon = Gladdy:GetInterrupts()[GetSpellInfo(k)] and Gladdy:GetInterrupts()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)),
|
||||||
|
args = {
|
||||||
|
enabled = {
|
||||||
|
order = 1,
|
||||||
|
name = L["Enabled"],
|
||||||
|
type = "toggle",
|
||||||
|
image = Gladdy:GetInterrupts()[GetSpellInfo(k)] and Gladdy:GetInterrupts()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)),
|
||||||
|
width = "2",
|
||||||
|
set = function(info, value)
|
||||||
|
Gladdy.db.auraListInterrupts[tostring(k)].enabled = value
|
||||||
|
end,
|
||||||
|
get = function(info)
|
||||||
|
return Gladdy.db.auraListInterrupts[tostring(k)].enabled
|
||||||
|
end
|
||||||
|
},
|
||||||
|
priority = {
|
||||||
|
order = 2,
|
||||||
|
name = L["Priority"],
|
||||||
|
type = "range",
|
||||||
|
min = 0,
|
||||||
|
max = 50,
|
||||||
|
width = "2",
|
||||||
|
step = 1,
|
||||||
|
get = function(info)
|
||||||
|
return Gladdy.db.auraListInterrupts[tostring(k)].priority
|
||||||
|
end,
|
||||||
|
set = function(info, value)
|
||||||
|
Gladdy.db.auraListInterrupts[tostring(k)].priority = value
|
||||||
|
end,
|
||||||
|
width = "full",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return options
|
||||||
|
end
|
@ -2,20 +2,9 @@ local GetSpellInfo = GetSpellInfo
|
|||||||
local CreateFrame = CreateFrame
|
local CreateFrame = CreateFrame
|
||||||
local GetTime = GetTime
|
local GetTime = GetTime
|
||||||
local select, lower, ceil, tremove, tinsert, pairs, ipairs, tostring = select, string.lower, ceil, tremove, tinsert, pairs, ipairs, tostring
|
local select, lower, ceil, tremove, tinsert, pairs, ipairs, tostring = select, string.lower, ceil, tremove, tinsert, pairs, ipairs, tostring
|
||||||
local auraTypeColor = { }
|
|
||||||
local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF
|
local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF
|
||||||
local auraTypes = {AURA_TYPE_BUFF, AURA_TYPE_DEBUFF}
|
local auraTypes = {AURA_TYPE_BUFF, AURA_TYPE_DEBUFF}
|
||||||
|
|
||||||
auraTypeColor["none"] = { r = 0.80, g = 0, b = 0 , a = 1}
|
|
||||||
auraTypeColor["magic"] = { r = 0.20, g = 0.60, b = 1.00, a = 1}
|
|
||||||
auraTypeColor["curse"] = { r = 0.60, g = 0.00, b = 1.00, a = 1 }
|
|
||||||
auraTypeColor["disease"] = { r = 0.60, g = 0.40, b = 0, a = 1 }
|
|
||||||
auraTypeColor["poison"] = { r = 0.00, g = 0.60, b = 0, a = 1 }
|
|
||||||
auraTypeColor["immune"] = { r = 1.00, g = 0.02, b = 0.99, a = 1 }
|
|
||||||
auraTypeColor["form"] = auraTypeColor["none"]
|
|
||||||
auraTypeColor["aura"] = auraTypeColor["none"]
|
|
||||||
auraTypeColor[""] = auraTypeColor["none"]
|
|
||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
-- Module init
|
-- Module init
|
||||||
---------------------------
|
---------------------------
|
||||||
@ -55,14 +44,14 @@ local BuffsDebuffs = Gladdy:NewModule("Buffs and Debuffs", nil, {
|
|||||||
buffsBorderColorsEnabled = true,
|
buffsBorderColorsEnabled = true,
|
||||||
trackedDebuffs = defaultTrackedDebuffs,
|
trackedDebuffs = defaultTrackedDebuffs,
|
||||||
trackedBuffs = defaultTrackedBuffs,
|
trackedBuffs = defaultTrackedBuffs,
|
||||||
buffsBorderColorCurse = auraTypeColor["curse"],
|
buffsBorderColorCurse = Gladdy:GetAuraTypeColor()["curse"],
|
||||||
buffsBorderColorMagic = auraTypeColor["magic"],
|
buffsBorderColorMagic = Gladdy:GetAuraTypeColor()["magic"],
|
||||||
buffsBorderColorPoison = auraTypeColor["poison"],
|
buffsBorderColorPoison = Gladdy:GetAuraTypeColor()["poison"],
|
||||||
buffsBorderColorPhysical = auraTypeColor["none"],
|
buffsBorderColorPhysical = Gladdy:GetAuraTypeColor()["none"],
|
||||||
buffsBorderColorImmune = auraTypeColor["immune"],
|
buffsBorderColorImmune = Gladdy:GetAuraTypeColor()["immune"],
|
||||||
buffsBorderColorDisease = auraTypeColor["disease"],
|
buffsBorderColorDisease = Gladdy:GetAuraTypeColor()["disease"],
|
||||||
buffsBorderColorForm = auraTypeColor["form"],
|
buffsBorderColorForm = Gladdy:GetAuraTypeColor()["form"],
|
||||||
buffsBorderColorAura = auraTypeColor["aura"]
|
buffsBorderColorAura = Gladdy:GetAuraTypeColor()["aura"]
|
||||||
})
|
})
|
||||||
|
|
||||||
local spellSchoolToOptionValueTable
|
local spellSchoolToOptionValueTable
|
||||||
|
Loading…
Reference in New Issue
Block a user