Merge branch 'release/v1.22-Release' into main

This commit is contained in:
Sumsebrum 2021-09-19 12:44:19 +02:00
commit d2f307fca0
13 changed files with 167 additions and 43 deletions

View File

@ -649,7 +649,7 @@ local importantAuras = {
-- Grounding Totem Effect
[GetSpellInfo(8178)] = {
track = AURA_TYPE_BUFF,
duration = 4,
duration = 0,
priority = 20,
spellID = 8178
},

View File

@ -26,7 +26,7 @@ local MAJOR, MINOR = "Gladdy", 4
local Gladdy = LibStub:NewLibrary(MAJOR, MINOR)
local L
Gladdy.version_major_num = 1
Gladdy.version_minor_num = 0.21
Gladdy.version_minor_num = 0.22
Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num
Gladdy.version_releaseType = RELEASE_TYPES.release
Gladdy.version = PREFIX .. Gladdy.version_num .. "-" .. Gladdy.version_releaseType

View File

@ -1,6 +1,6 @@
## Interface: 20502
## Title: Gladdy - TBC
## Version: 1.21-Release
## Version: 1.22-Release
## Notes: The most powerful arena AddOn for WoW 2.5.1
## Author: XiconQoo, DnB_Junkee, Knall
## X-Email: contact me on discord Knall#1751

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@ LibClassAuras.debuffs = {}
LibClassAuras.debuffToId = {}
LibClassAuras.buffs = {}
LibClassAuras.buffToId = {}
LibClassAuras.altNames = {}
local function Spell(id, opts, class, spellTable, idTable)
if not opts or not class then
@ -26,9 +27,20 @@ local function Spell(id, opts, class, spellTable, idTable)
return
end
if opts.altName then
idTable[opts.altName] = {id = id , class = class}
for _,v in ipairs(id) do
LibClassAuras.altNames[v] = opts.altName
end
if idTable[opts.altName] then
tinsert(idTable[opts.altName], {id = id , class = class})
else
idTable[spellName] = {id = id , class = class}
idTable[opts.altName] = {[1] = {id = id , class = class}}
end
else
if idTable[spellName] then
tinsert(idTable[spellName], {id = id , class = class})
else
idTable[spellName] = {[1] = {id = id , class = class}}
end
end
if type(id) == "table" then
@ -54,9 +66,11 @@ LibClassAuras.Buff = Buff
local function getClassDebuffs(class)
local classSpells = {}
for k,v in pairs(LibClassAuras.debuffToId) do
if v.class == class then
tinsert(classSpells, {name = k, id = v.id})
for name, spells in pairs(LibClassAuras.debuffToId) do
for _, spellInfo in ipairs(spells) do
if spellInfo.class == class then
tinsert(classSpells, {name = name, id = spellInfo.id})
end
end
end
return classSpells
@ -65,9 +79,11 @@ LibClassAuras.GetClassDebuffs = getClassDebuffs
local function getClassBuffs(class)
local classSpells = {}
for k,v in pairs(LibClassAuras.buffToId) do
if v.class == class then
tinsert(classSpells, {name = k, id = v.id})
for name, spells in pairs(LibClassAuras.buffToId) do
for _, spellInfo in ipairs(spells) do
if spellInfo.class == class then
tinsert(classSpells, {name = name, id = spellInfo.id})
end
end
end
return classSpells
@ -83,3 +99,8 @@ local function getSpellNameToId(auraType)
end
LibClassAuras.GetSpellNameToId = getSpellNameToId
local function getAltName(spellID)
return LibClassAuras.altNames[spellID]
end
LibClassAuras.GetAltName = getAltName

View File

@ -106,9 +106,13 @@ function Auras:CreateFrame(unit)
if (self.timeLeft <= 0) then
Auras:AURA_FADE(self.unit, self.track)
else
self.timeLeft = self.timeLeft - elapsed
if self.spellID == 8178 then
self.text:SetText("")
else
Gladdy:FormatTimer(self.text, self.timeLeft, self.timeLeft < 10)
end
self.timeLeft = self.timeLeft - elapsed
end
else
self:SetAlpha(0.01)
end
@ -359,7 +363,8 @@ function Auras:AURA_GAIN(unit, auraType, spellID, spellName, icon, duration, exp
auraFrame.startTime = expirationTime - duration
auraFrame.endTime = expirationTime
auraFrame.name = spellName
auraFrame.timeLeft = expirationTime - GetTime()
auraFrame.spellID = spellID
auraFrame.timeLeft = spellID == 8178 and 45 or expirationTime - GetTime()
auraFrame.priority = Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)].priority
auraFrame.icon:SetTexture(Gladdy:GetImportantAuras()[GetSpellInfo(self.auras[spellName].spellID)] and Gladdy:GetImportantAuras()[GetSpellInfo(self.auras[spellName].spellID)].texture or icon)
auraFrame.track = auraType
@ -373,9 +378,11 @@ function Auras:AURA_GAIN(unit, auraType, spellID, spellName, icon, duration, exp
else
auraFrame.icon.overlay:SetVertexColor(Gladdy.db.frameBorderColor.r, Gladdy.db.frameBorderColor.g, Gladdy.db.frameBorderColor.b, Gladdy.db.frameBorderColor.a)
end
if not Gladdy.db.auraDisableCircle then
if not Gladdy.db.auraDisableCircle and spellID ~= 8178 then
auraFrame.cooldown:Show()
auraFrame.cooldown:SetCooldown(auraFrame.startTime, duration)
else
auraFrame.cooldown:Hide()
end
end
@ -550,6 +557,22 @@ function Auras:GetOptions()
order = 4,
width = "full",
}),
auraCooldownNumberAlpha = {
type = "range",
name = L["Cooldown number alpha"],
min = 0,
max = 1,
step = 0.1,
order = 5,
width = "full",
set = function(info, value)
Gladdy.db.auraFontColor.a = value
Gladdy:UpdateFrame()
end,
get = function(info)
return Gladdy.db.auraFontColor.a
end,
},
}
},
font = {

View File

@ -138,7 +138,8 @@ function BuffsDebuffs:Test(unit)
BuffsDebuffs:AURA_FADE(unit, AURA_TYPE_DEBUFF)
BuffsDebuffs:AURA_FADE(unit, AURA_TYPE_BUFF)
--BuffsDebuffs:AURA_GAIN(unit, AURA_TYPE_BUFF, 1243, select(1, GetSpellInfo(1243)), select(3, GetSpellInfo(1243)), 10, GetTime() + 10, 1, "physical")
--self:AURA_GAIN(unit, AURA_TYPE_DEBUFF, 31117, select(1, GetSpellInfo(31117)), select(3, GetSpellInfo(31117)), 10, GetTime() + 10, 1, "physical")
local i = 1
for spellID, enabled in pairs(Gladdy.db.trackedDebuffs) do
if i > 4 then
@ -197,13 +198,24 @@ function BuffsDebuffs:AURA_GAIN(unit, auraType, spellID, spellName, texture, dur
return
end
local auraFrame = self.frames[unit]
spellName = LibClassAuras.GetAltName(spellID) or spellName
local aura = Gladdy:GetImportantAuras()[spellName] and Gladdy.db.auraListDefault[tostring(Gladdy:GetImportantAuras()[spellName].spellID)].enabled
if aura and Gladdy.db.buffsShowAuraDebuffs then
aura = false
end
local auraNames = LibClassAuras.GetSpellNameToId(auraType)
local spellId = auraNames[spellName] and auraNames[spellName].id[1]
if not aura and spellID and spellId and expirationTime and (Gladdy.db.trackedBuffs[tostring(spellId)] or Gladdy.db.trackedDebuffs[tostring(spellId)]) then
local spellId
local isTracked = false
if auraNames[spellName] then
for _, spellInfo in ipairs(auraNames[spellName]) do
spellId = spellInfo.id[1]
if (Gladdy.db.trackedBuffs[tostring(spellId)] or Gladdy.db.trackedDebuffs[tostring(spellId)]) then
isTracked = true
break
end
end
end
if not aura and spellID and expirationTime and isTracked then
local index
if auraType == AURA_TYPE_DEBUFF then
auraFrame.numDebuffs = auraFrame.numDebuffs + 1
@ -267,7 +279,7 @@ local function styleIcon(aura, auraType)
aura.cooldown:SetFont(Gladdy:SMFetch("font", "buffsFont"), (Gladdy.db.buffsIconSize/2 - 1) * Gladdy.db.buffsFontScale, "OUTLINE")
aura.cooldown:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, Gladdy.db.buffsFontColor.a)
aura.stacks:SetFont(Gladdy:SMFetch("font", "buffsFont"), (Gladdy.db.buffsIconSize/3 - 1) * Gladdy.db.buffsFontScale, "OUTLINE")
aura.stacks:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, Gladdy.db.buffsFontColor.a)
aura.stacks:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, 1)
end
function BuffsDebuffs:UpdateFrame(unit)
@ -474,15 +486,15 @@ local function iconTimer(auraFrame, elapsed)
auraFrame.timeLeft = timeLeftMilliSec
if Gladdy.db.buffsDynamicColor then
if timeLeftSec >= 60 then
auraFrame.cooldown:SetTextColor(0.7, 1, 0)
auraFrame.cooldown:SetTextColor(0.7, 1, 0, Gladdy.db.buffsFontColor.a)
elseif timeLeftSec < 60 and timeLeftSec >= 11 then
auraFrame.cooldown:SetTextColor(0.7, 1, 0)
auraFrame.cooldown:SetTextColor(0.7, 1, 0, Gladdy.db.buffsFontColor.a)
elseif timeLeftSec <= 10 and timeLeftSec >= 5 then
auraFrame.cooldown:SetTextColor(1, 0.7, 0)
auraFrame.cooldown:SetTextColor(1, 0.7, 0, Gladdy.db.buffsFontColor.a)
elseif timeLeftSec <= 4 and timeLeftSec >= 3 then
auraFrame.cooldown:SetTextColor(1, 0, 0)
auraFrame.cooldown:SetTextColor(1, 0, 0, Gladdy.db.buffsFontColor.a)
elseif timeLeftMilliSec <= 3 and timeLeftMilliSec > 0 then
auraFrame.cooldown:SetTextColor(1, 0, 0)
auraFrame.cooldown:SetTextColor(1, 0, 0, Gladdy.db.buffsFontColor.a)
end
end
if timeLeftMilliSec < 0 then
@ -899,6 +911,22 @@ function BuffsDebuffs:GetOptions()
order = 10,
width = "full",
}),
buffsCooldownNumberAlpha = {
type = "range",
name = L["Cooldown number alpha"],
min = 0,
max = 1,
step = 0.1,
order = 11,
width = "full",
set = function(info, value)
Gladdy.db.buffsFontColor.a = value
Gladdy:UpdateFrame()
end,
get = function(info)
return Gladdy.db.buffsFontColor.a
end,
},
},
},
font = {

View File

@ -663,6 +663,22 @@ function Cooldowns:GetOptions()
order = 9,
width = "full",
}),
cooldownCooldownNumberAlpha = {
type = "range",
name = L["Cooldown number alpha"],
min = 0,
max = 1,
step = 0.1,
order = 10,
width = "full",
set = function(info, value)
Gladdy.db.cooldownFontColor.a = value
Gladdy:UpdateFrame()
end,
get = function(info)
return Gladdy.db.cooldownFontColor.a
end,
},
},
},
font = {

View File

@ -456,6 +456,22 @@ function Diminishings:GetOptions()
order = 9,
width = "full",
}),
drCooldownNumberAlpha = {
type = "range",
name = L["Cooldown number alpha"],
min = 0,
max = 1,
step = 0.1,
order = 10,
width = "full",
set = function(info, value)
Gladdy.db.drFontColor.a = value
Gladdy:UpdateFrame()
end,
get = function(info)
return Gladdy.db.drFontColor.a
end,
},
},
},
font = {

View File

@ -14,12 +14,6 @@ local function table_copy(t, str)
end
for k,v in pairs(t) do
if type(v) == "table" then
if k == "drCategories" then
for key,val in pairs(v) do
--Gladdy:Print("TableCopy", str .. "." .. key)
end
end
t2[k] = table_copy(v, str .. "." .. k);
else
@ -94,7 +88,7 @@ end)
import:AddChild(importClearButton)
import.clearButton = importClearButton
local deletedOptions = { --TODO backward compatibility Imports on deleted options
local deletedOptions = { -- backwards compatibility
growUp = true,
freezetrap = true,
repentance = true

View File

@ -19,6 +19,7 @@ local Racial = Gladdy:NewModule("Racial", nil, {
racialBorderColor = { r = 0, g = 0, b = 0, a = 1 },
racialDisableCircle = false,
racialCooldownAlpha = 1,
racialCooldownNumberAlpha = 1,
})
local ANCHORS = { ["LEFT"] = "RIGHT", ["RIGHT"] = "LEFT", ["BOTTOM"] = "TOP", ["TOP"] = "BOTTOM"}
@ -43,19 +44,19 @@ local function iconTimer(self,elapsed)
local timeLeft = ceil(self.timeLeft)
if timeLeft >= 60 then
self.cooldownFont:SetTextColor(1, 1, 0)
self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.racialCooldownNumberAlpha)
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 0.15* self:GetWidth()) * Gladdy.db.racialFontScale, "OUTLINE")
elseif timeLeft < 60 and timeLeft >= 30 then
self.cooldownFont:SetTextColor(1, 1, 0)
self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.racialCooldownNumberAlpha)
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
elseif timeLeft < 30 and timeLeft >= 11 then
self.cooldownFont:SetTextColor(1, 0.7, 0)
self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.racialCooldownNumberAlpha)
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
elseif timeLeft < 10 and timeLeft >= 5 then
self.cooldownFont:SetTextColor(1, 0.7, 0)
self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.racialCooldownNumberAlpha)
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
elseif timeLeft < 5 and timeLeft > 0 then
self.cooldownFont:SetTextColor(1, 0, 0)
self.cooldownFont:SetTextColor(1, 0, 0, Gladdy.db.racialCooldownNumberAlpha)
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
end
Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
@ -270,6 +271,15 @@ function Racial:GetOptions()
order = 8,
width = "full",
}),
racialCooldownNumberAlpha = Gladdy:option({
type = "range",
name = L["Cooldown number alpha"],
min = 0,
max = 1,
step = 0.1,
order = 9,
width = "full",
}),
},
},
font = {

View File

@ -17,6 +17,7 @@ local Trinket = Gladdy:NewModule("Trinket", nil, {
trinketBorderColor = { r = 0, g = 0, b = 0, a = 1 },
trinketDisableCircle = false,
trinketCooldownAlpha = 1,
trinketCooldownNumberAlpha = 1,
})
LibStub("AceComm-3.0"):Embed(Trinket)
@ -39,19 +40,19 @@ local function iconTimer(self, elapsed)
local timeLeft = ceil(self.timeLeft)
if timeLeft >= 60 then
self.cooldownFont:SetTextColor(1, 1, 0)
self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.trinketCooldownNumberAlpha)
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 0.15*self:GetWidth()) * Gladdy.db.trinketFontScale, "OUTLINE")
elseif timeLeft < 60 and timeLeft >= 30 then
self.cooldownFont:SetTextColor(1, 1, 0)
self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.trinketCooldownNumberAlpha)
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
elseif timeLeft < 30 and timeLeft >= 11 then
self.cooldownFont:SetTextColor(1, 0.7, 0)
self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.trinketCooldownNumberAlpha)
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
elseif timeLeft <= 10 and timeLeft >= 5 then
self.cooldownFont:SetTextColor(1, 0.7, 0)
self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.trinketCooldownNumberAlpha)
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
elseif timeLeft < 5 and timeLeft > 0 then
self.cooldownFont:SetTextColor(1, 0, 0)
self.cooldownFont:SetTextColor(1, 0, 0, Gladdy.db.trinketCooldownNumberAlpha)
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
end
Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
@ -276,6 +277,15 @@ function Trinket:GetOptions()
order = 8,
width = "full",
}),
trinketCooldownNumberAlpha = Gladdy:option({
type = "range",
name = L["Cooldown number alpha"],
min = 0,
max = 1,
step = 0.1,
order = 9,
width = "full",
}),
},
},
font = {

View File

@ -1,7 +1,7 @@
# Gladdy - TBC
### The most powerful arena addon for WoW TBC 2.5.1
## [v1.21-Release Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v1.21-Release/Gladdy_TBC-Classic_v1.21-Release.zip)
## [v1.22-Release Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v1.22-Release/Gladdy_TBC-Classic_v1.22-Release.zip)
###### <a target="_blank" rel="noopener noreferrer" href="https://www.paypal.me/xiconqoo/10"><img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/Paypal-Donate.png" height="30" style="margin-top:-30px;position:relative;top:20px;"></a> Please consider donating if you like my work
@ -62,6 +62,12 @@ The goal is to make Gladdy highly configurable in it's appearance. Everything ca
### Changes
### v1.22-Release
- fixed import for some localizations not working
- added cooldown number alpha configurations for Auras, BuffsDebuffs, Cooldowns, Diminishings, Racial & Trinket
- grounding totem effect fix
- fixed some buffs/debuffs not being present in BuffsDebuffs
### v1.21-Release
- fixed error when hiding blizzard frames ArenaEnemyFrames related to ElvUI
- added Pummel cooldown