Merge branch 'release/v1.08-Beta' into main

This commit is contained in:
Sumsebrum 2021-05-22 14:24:51 +02:00
commit 084fad0074
24 changed files with 312 additions and 136 deletions

View File

@ -177,7 +177,7 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
end end
end end
local exceptionNames = { local exceptionNames = { -- TODO MOVE ME TO CLASSBUFFS LIB
[31117] = GetSpellInfo(30405) .. " Silence", -- Unstable Affliction Silence [31117] = GetSpellInfo(30405) .. " Silence", -- Unstable Affliction Silence
[43523] = GetSpellInfo(30405) .. " Silence", [43523] = GetSpellInfo(30405) .. " Silence",
[24131] = select(1, GetSpellInfo(19386)) .. " Dot", -- Wyvern Sting Dot [24131] = select(1, GetSpellInfo(19386)) .. " Dot", -- Wyvern Sting Dot

117
Frame.lua
View File

@ -30,6 +30,9 @@ Gladdy.BUTTON_DEFAULTS = {
function Gladdy:CreateFrame() function Gladdy:CreateFrame()
self.frame = CreateFrame("Frame", "GladdyFrame", UIParent) self.frame = CreateFrame("Frame", "GladdyFrame", UIParent)
--self.frame.texture = self.frame:CreateTexture(nil, "OVERLAY")
--self.frame.texture:SetAllPoints(self.frame)
--self.frame.texture:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp")
self.frame:SetClampedToScreen(true) self.frame:SetClampedToScreen(true)
self.frame:EnableMouse(false) self.frame:EnableMouse(false)
@ -109,48 +112,69 @@ function Gladdy:UpdateFrame()
end end
local teamSize = self.curBracket or 0 local teamSize = self.curBracket or 0
local iconSize = self.db.healthBarHeight local highlightBorderSize = (self.db.highlightInset and 0 or self.db.highlightBorderSize * 2)
local margin = 0 local leftSize = 0
local width = self.db.barWidth + self.db.padding * 2 + 5 local rightSize = 0
local height = self.db.healthBarHeight * teamSize + margin * (teamSize - 1) + self.db.padding * 2 + 5 --Trinket + Racial
local extraBarWidth = 0 if self.db.trinketEnabled and self.db.trinketPos == "LEFT" then
local extraBarHeight = 0 leftSize = leftSize + self.db.trinketSize * self.db.trinketWidthFactor + self.db.padding
if self.db.racialEnabled and self.db.racialAnchor == "trinket" and self.db.racialPos == "LEFT" then
leftSize = leftSize + self.db.racialSize * self.db.racialWidthFactor + self.db.padding
end
end
if self.db.trinketEnabled and self.db.trinketPos == "RIGHT" then
rightSize = rightSize + self.db.trinketSize * self.db.trinketWidthFactor + self.db.padding
if self.db.racialEnabled and self.db.racialAnchor == "trinket" and self.db.racialPos == "RIGHT" then
rightSize = rightSize + self.db.racialSize * self.db.racialWidthFactor + self.db.padding
end
end
--ClassIcon
if self.db.classIconPos == "LEFT" then
leftSize = leftSize + self.db.classIconSize * self.db.classIconWidthFactor + self.db.padding
else
rightSize = rightSize + self.db.classIconSize * self.db.classIconWidthFactor + self.db.padding
end
--Highlight
if not self.db.highlightInset then
leftSize = leftSize + self.db.highlightBorderSize
rightSize = rightSize + self.db.highlightBorderSize
end
-- Powerbar local margin = self.db.powerBarHeight + 1
iconSize = iconSize + self.db.powerBarHeight local width = self.db.barWidth + leftSize + rightSize
margin = margin + self.db.powerBarHeight local height = (self.db.healthBarHeight + self.db.powerBarHeight + 1) * teamSize
height = height + self.db.powerBarHeight * teamSize + (self.db.highlightInset and 0 or self.db.highlightBorderSize * 2 * teamSize)
extraBarHeight = extraBarHeight + self.db.powerBarHeight + self.db.bottomMargin * (teamSize - 1)
-- Cooldown -- Highlight
margin = margin + 1 + self.db.highlightBorderSize * 2 + 1 -- + 1 space between health and power bar margin = margin + highlightBorderSize
height = height + self.db.highlightBorderSize * teamSize
if (self.db.cooldownYPos == "TOP" or self.db.cooldownYPos == "BOTTOM") and self.db.cooldown then if (self.db.cooldownYPos == "TOP" or self.db.cooldownYPos == "BOTTOM") and self.db.cooldown then
margin = margin + self.db.cooldownSize margin = margin + self.db.cooldownSize
height = height + self.db.cooldownSize * teamSize height = height + self.db.cooldownSize * (teamSize - 1)
end end
if (self.db.buffsCooldownPos == "TOP" or self.db.buffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then if (self.db.buffsCooldownPos == "TOP" or self.db.buffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then
margin = margin + self.db.buffsIconSize margin = margin + self.db.buffsIconSize
height = height + self.db.buffsIconSize * teamSize height = height + self.db.buffsIconSize * (teamSize - 1)
end end
if (self.db.buffsBuffsCooldownPos == "TOP" or self.db.buffsBuffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then if (self.db.buffsBuffsCooldownPos == "TOP" or self.db.buffsBuffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then
margin = margin + self.db.buffsBuffsIconSize margin = margin + self.db.buffsBuffsIconSize
height = height + self.db.buffsBuffsIconSize * teamSize height = height + self.db.buffsBuffsIconSize * (teamSize - 1)
end end
if self.db.buffsCooldownPos == "TOP" and self.db.cooldownYPos == "TOP" and self.db.cooldown and self.db.buffsEnabled then if self.db.buffsCooldownPos == "TOP" and self.db.cooldownYPos == "TOP" and self.db.cooldown and self.db.buffsEnabled then
margin = margin + 1 margin = margin + 1
height = height + (teamSize - 1)
end end
if self.db.buffsCooldownPos == "BOTTOM" and self.db.cooldownYPos == "BOTTOM" and self.db.cooldown and self.db.buffsEnabled then if self.db.buffsCooldownPos == "BOTTOM" and self.db.cooldownYPos == "BOTTOM" and self.db.cooldown and self.db.buffsEnabled then
margin = margin + 1 margin = margin + 1
height = height + (teamSize - 1)
end end
-- Classicon -- GrowDirection
width = width + iconSize if (self.db.growDirection == "LEFT" or self.db.growDirection == "RIGHT") then
extraBarWidth = extraBarWidth + iconSize width = self.db.barWidth * teamSize + (leftSize + rightSize) * teamSize + self.db.bottomMargin * (teamSize - 1)
height = self.db.healthBarHeight + self.db.powerBarHeight + 1
-- Trinket end
width = width + iconSize
self.frame:SetScale(self.db.frameScale) self.frame:SetScale(self.db.frameScale)
self.frame:SetWidth(width) self.frame:SetWidth(width)
@ -161,53 +185,71 @@ function Gladdy:UpdateFrame()
self.frame:SetPoint("CENTER") self.frame:SetPoint("CENTER")
else else
local scale = self.frame:GetEffectiveScale() local scale = self.frame:GetEffectiveScale()
if (self.db.growUp) then if (self.db.growDirection == "TOP") then
self.frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, self.db.y / scale) self.frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, self.db.y / scale)
else else
self.frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, self.db.y / scale) self.frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, self.db.y / scale)
end end
end end
--Anchor
self.anchor:SetWidth(width) self.anchor:SetWidth(width)
self.anchor:ClearAllPoints() self.anchor:ClearAllPoints()
if (self.db.growUp) then if (self.db.growDirection == "TOP") then
self.anchor:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") self.anchor:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT")
else elseif self.growDirection == "BOTTOM" or self.growDirection == "RIGHT" then
self.anchor:SetPoint("BOTTOMLEFT", self.frame, "TOPLEFT") self.anchor:SetPoint("BOTTOMLEFT", self.frame, "TOPLEFT")
else
self.anchor:SetPoint("BOTTOMRIGHT", self.frame, "TOPRIGHT")
end end
if (self.db.locked) then if (self.db.locked) then
self.anchor:Hide() self.anchor:Hide()
self.anchor:Hide()
else else
self.anchor:Show() self.anchor:Show()
end end
for i = 1, teamSize do for i = 1, teamSize do
local button = self.buttons["arena" .. i] local button = self.buttons["arena" .. i]
button:SetWidth(self.db.barWidth + extraBarWidth) button:SetWidth(self.db.barWidth)
button:SetHeight(self.db.healthBarHeight) button:SetHeight(self.db.healthBarHeight)
button.secure:SetWidth(self.db.barWidth) button.secure:SetWidth(self.db.barWidth)
button.secure:SetHeight(self.db.healthBarHeight + extraBarHeight) button.secure:SetHeight(self.db.healthBarHeight + self.db.powerBarHeight + 1)
button:ClearAllPoints() button:ClearAllPoints()
button.secure:ClearAllPoints() button.secure:ClearAllPoints()
if (self.db.growUp) then if (self.db.growDirection == "TOP") then
if (i == 1) then if (i == 1) then
button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", self.db.padding + 2, 0) button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", leftSize, self.db.powerBarHeight + 1)
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT") button.secure:SetPoint("TOPLEFT", button.powerBar, "TOPLEFT")
else else
button:SetPoint("BOTTOMLEFT", self.buttons["arena" .. (i - 1)], "TOPLEFT", 0, margin + self.db.bottomMargin) button:SetPoint("BOTTOMLEFT", self.buttons["arena" .. (i - 1)], "TOPLEFT", 0, margin + self.db.bottomMargin)
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT") button.secure:SetPoint("TOPLEFT", button.powerBar, "TOPLEFT")
end end
else elseif (self.db.growDirection == "BOTTOM") then
if (i == 1) then if (i == 1) then
button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", self.db.padding + 2, 0) button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", leftSize, 0)
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT") button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
else else
button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "BOTTOMLEFT", 0, -margin - self.db.bottomMargin) button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "BOTTOMLEFT", 0, -margin - self.db.bottomMargin)
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT") button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
end end
elseif (self.db.growDirection == "LEFT") then
if (i == 1) then
button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -rightSize, 0)
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
else
button:SetPoint("TOPRIGHT", self.buttons["arena" .. (i - 1)], "TOPLEFT", -rightSize - leftSize - self.db.bottomMargin, 0)
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
end
elseif (self.db.growDirection == "RIGHT") then
if (i == 1) then
button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", leftSize, 0)
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
else
button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "TOPRIGHT", leftSize + rightSize + self.db.bottomMargin, 0)
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
end
end end
@ -258,7 +300,10 @@ function Gladdy:CreateButton(i)
local button = CreateFrame("Frame", "GladdyButtonFrame" .. i, self.frame) local button = CreateFrame("Frame", "GladdyButtonFrame" .. i, self.frame)
button:EnableMouse(false) button:EnableMouse(false)
button:SetAlpha(0) --button:SetAlpha(0)
--button.texture = button:CreateTexture(nil, "OVERLAY")
--button.texture:SetAllPoints(button)
--button.texture:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp")
local secure = CreateFrame("Button", "GladdyButton" .. i, button, "SecureActionButtonTemplate") local secure = CreateFrame("Button", "GladdyButton" .. i, button, "SecureActionButtonTemplate")
secure:RegisterForClicks("AnyUp") secure:RegisterForClicks("AnyUp")

View File

@ -25,7 +25,7 @@ local MAJOR, MINOR = "Gladdy", 4
local Gladdy = LibStub:NewLibrary(MAJOR, MINOR) local Gladdy = LibStub:NewLibrary(MAJOR, MINOR)
local L local L
Gladdy.version_major_num = 1 Gladdy.version_major_num = 1
Gladdy.version_minor_num = 0.07 Gladdy.version_minor_num = 0.08
Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num
Gladdy.version_releaseType = RELEASE_TYPES.beta Gladdy.version_releaseType = RELEASE_TYPES.beta
Gladdy.version = PREFIX .. Gladdy.version_num .. "-" .. Gladdy.version_releaseType Gladdy.version = PREFIX .. Gladdy.version_num .. "-" .. Gladdy.version_releaseType

View File

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

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -21,12 +21,12 @@ local Announcements = Gladdy:NewModule("Announcements", nil, {
drinks = true, drinks = true,
resurrections = true, resurrections = true,
enemy = false, enemy = false,
spec = false, spec = true,
health = false, health = false,
healthThreshold = 20, healthThreshold = 20,
trinketUsed = true, trinketUsed = true,
trinketReady = false, trinketReady = false,
dest = "self", dest = "party",
}, },
}) })

View File

@ -13,6 +13,7 @@ local function defaultSpells(auraType)
spells[tostring(v.spellID)] = {} spells[tostring(v.spellID)] = {}
spells[tostring(v.spellID)].enabled = true spells[tostring(v.spellID)].enabled = true
spells[tostring(v.spellID)].priority = v.priority spells[tostring(v.spellID)].priority = v.priority
spells[tostring(v.spellID)].track = v.track
end end
end end
return spells return spells
@ -70,16 +71,6 @@ function Auras:CreateFrame(unit)
local classIcon = Gladdy.modules.Classicon.frames[unit] local classIcon = Gladdy.modules.Classicon.frames[unit]
auraFrame:ClearAllPoints() auraFrame:ClearAllPoints()
auraFrame:SetAllPoints(classIcon) auraFrame:SetAllPoints(classIcon)
auraFrame:SetScript("OnUpdate", function(self, elapsed)
if (self.active) then
if (self.timeLeft <= 0) then
Auras:AURA_FADE(unit)
else
self.timeLeft = self.timeLeft - elapsed
self.text:SetFormattedText("%.1f", self.timeLeft >= 0.0 and self.timeLeft or 0.0)
end
end
end)
auraFrame.text = auraFrame.cooldownFrame:CreateFontString(nil, "OVERLAY") auraFrame.text = auraFrame.cooldownFrame:CreateFontString(nil, "OVERLAY")
auraFrame.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), 10, "OUTLINE") auraFrame.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), 10, "OUTLINE")
@ -90,6 +81,17 @@ function Auras:CreateFrame(unit)
auraFrame.text:SetPoint("CENTER") auraFrame.text:SetPoint("CENTER")
auraFrame.unit = unit auraFrame.unit = unit
auraFrame:SetScript("OnUpdate", function(self, elapsed)
if (self.active) then
if (self.timeLeft <= 0) then
Auras:AURA_FADE(self.unit, self.track)
else
self.timeLeft = self.timeLeft - elapsed
self.text:SetFormattedText("%.1f", self.timeLeft >= 0.0 and self.timeLeft or 0.0)
end
end
end)
self.frames[unit] = auraFrame self.frames[unit] = auraFrame
self:ResetUnit(unit) self:ResetUnit(unit)
end end
@ -123,6 +125,7 @@ function Auras:UpdateFrame(unit)
else else
auraFrame.icon.overlay:SetVertexColor(0, 0, 0, 1) auraFrame.icon.overlay:SetVertexColor(0, 0, 0, 1)
end end
auraFrame.icon.overlay:Hide()
if Gladdy.db.auraDisableCircle then if Gladdy.db.auraDisableCircle then
auraFrame.cooldown:SetAlpha(0) auraFrame.cooldown:SetAlpha(0)
end end
@ -130,21 +133,30 @@ end
function Auras:ResetUnit(unit) function Auras:ResetUnit(unit)
self.frames[unit]:UnregisterAllEvents() self.frames[unit]:UnregisterAllEvents()
self:AURA_FADE(unit) self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
self:AURA_FADE(unit, AURA_TYPE_BUFF)
end end
function Auras:Test(unit) function Auras:Test(unit)
local aura, _, icon local spellName, _, icon
if (unit == "arena1") then if (unit == "arena1") then
aura, _, icon = GetSpellInfo(12826) spellName, _, icon = GetSpellInfo(12826)
self:AURA_GAIN(unit,nil, 12826, aura, icon, self.auras[aura].duration, GetTime() + self.auras[aura].duration) self:AURA_FADE(unit, AURA_TYPE_BUFF)
self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 12826, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
elseif (unit == "arena2") then elseif (unit == "arena2") then
aura, _, icon = GetSpellInfo(6770) spellName, _, icon = GetSpellInfo(6770)
self:AURA_GAIN(unit,nil, 6770, aura, icon, self.auras[aura].duration, GetTime() + self.auras[aura].duration) self:AURA_FADE(unit, AURA_TYPE_BUFF)
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)
elseif (unit == "arena3") then elseif (unit == "arena3") then
aura, _, icon = GetSpellInfo(31224) spellName, _, icon = GetSpellInfo(31224)
self:AURA_GAIN(unit,nil, 31224, aura, icon, self.auras[aura].duration, GetTime() + self.auras[aura].duration) self:AURA_FADE(unit, AURA_TYPE_BUFF)
self:AURA_GAIN(unit,AURA_TYPE_BUFF, 31224, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
spellName, _, icon = GetSpellInfo(18425)
self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 18425, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
end end
end end
@ -155,35 +167,36 @@ function Auras:JOINED_ARENA()
end end
end end
function Auras:AURA_GAIN(unit, auraType, spellID, aura, icon, duration, expirationTime, count, debuffType) function Auras:AURA_GAIN(unit, auraType, spellID, spellName, icon, duration, expirationTime, count, debuffType)
local auraFrame = self.frames[unit] local auraFrame = self.frames[unit]
if (not auraFrame) then if (not auraFrame) then
return return
end end
if not self.auras[aura] then
if not self.auras[spellName] then
return return
end end
-- don't use spellId from combatlog, in case of different spellrank -- don't use spellId from combatlog, in case of different spellrank
if not Gladdy.db.auraListDefault[tostring(self.auras[aura].spellID)] or not Gladdy.db.auraListDefault[tostring(self.auras[aura].spellID)].enabled then if not Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)] or not Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)].enabled then
return return
end end
if (auraFrame.priority and auraFrame.priority > Gladdy.db.auraListDefault[tostring(self.auras[aura].spellID)].priority) then if (auraFrame.priority and auraFrame.priority > Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)].priority) then
return return
end end
auraFrame.startTime = expirationTime - duration auraFrame.startTime = expirationTime - duration
auraFrame.endTime = expirationTime auraFrame.endTime = expirationTime
auraFrame.name = aura auraFrame.name = spellName
auraFrame.timeLeft = expirationTime - GetTime() auraFrame.timeLeft = expirationTime - GetTime()
auraFrame.priority = Gladdy.db.auraListDefault[tostring(self.auras[aura].spellID)].priority auraFrame.priority = Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)].priority
auraFrame.icon:SetTexture(icon) auraFrame.icon:SetTexture(icon)
auraFrame.track = self.auras[aura].track auraFrame.track = auraType
auraFrame.active = true auraFrame.active = true
auraFrame.icon.overlay:SetTexture(Gladdy.db.auraBorderStyle) auraFrame.icon.overlay:Show()
auraFrame.cooldownFrame:Show() auraFrame.cooldownFrame:Show()
if auraFrame.track and auraFrame.track == AURA_TYPE_DEBUFF then if auraType == AURA_TYPE_DEBUFF then
auraFrame.icon.overlay:SetVertexColor(Gladdy.db.auraDebuffBorderColor.r, Gladdy.db.auraDebuffBorderColor.g, Gladdy.db.auraDebuffBorderColor.b, Gladdy.db.auraDebuffBorderColor.a) auraFrame.icon.overlay:SetVertexColor(Gladdy.db.auraDebuffBorderColor.r, Gladdy.db.auraDebuffBorderColor.g, Gladdy.db.auraDebuffBorderColor.b, Gladdy.db.auraDebuffBorderColor.a)
elseif auraFrame.track and auraFrame.track == AURA_TYPE_BUFF then elseif auraType == AURA_TYPE_BUFF then
auraFrame.icon.overlay:SetVertexColor(Gladdy.db.auraBuffBorderColor.r, Gladdy.db.auraBuffBorderColor.g, Gladdy.db.auraBuffBorderColor.b, Gladdy.db.auraBuffBorderColor.a) auraFrame.icon.overlay:SetVertexColor(Gladdy.db.auraBuffBorderColor.r, Gladdy.db.auraBuffBorderColor.g, Gladdy.db.auraBuffBorderColor.b, Gladdy.db.auraBuffBorderColor.a)
else else
auraFrame.icon.overlay:SetVertexColor(Gladdy.db.frameBorderColor.r, Gladdy.db.frameBorderColor.g, Gladdy.db.frameBorderColor.b, Gladdy.db.frameBorderColor.a) auraFrame.icon.overlay:SetVertexColor(Gladdy.db.frameBorderColor.r, Gladdy.db.frameBorderColor.g, Gladdy.db.frameBorderColor.b, Gladdy.db.frameBorderColor.a)
@ -194,9 +207,9 @@ function Auras:AURA_GAIN(unit, auraType, spellID, aura, icon, duration, expirati
end end
end end
function Auras:AURA_FADE(unit) function Auras:AURA_FADE(unit, auraType)
local auraFrame = self.frames[unit] local auraFrame = self.frames[unit]
if (not auraFrame) then if (not auraFrame or auraFrame.track ~= auraType) then
return return
end end
if auraFrame.active then if auraFrame.active then
@ -211,7 +224,7 @@ function Auras:AURA_FADE(unit)
auraFrame.endTime = nil auraFrame.endTime = nil
auraFrame.icon:SetTexture("") auraFrame.icon:SetTexture("")
auraFrame.text:SetText("") auraFrame.text:SetText("")
auraFrame.icon.overlay:SetTexture("") auraFrame.icon.overlay:Hide()
auraFrame.cooldownFrame:Hide() auraFrame.cooldownFrame:Hide()
end end
@ -252,6 +265,13 @@ function Auras:GetOptions()
step = 0.1, step = 0.1,
order = 4, order = 4,
}), }),
}
},
font = {
type = "group",
name = L["Font"],
order = 2,
args = {
auraFont = Gladdy:option({ auraFont = Gladdy:option({
type = "select", type = "select",
name = L["Font"], name = L["Font"],
@ -276,12 +296,12 @@ function Auras:GetOptions()
order = 7, order = 7,
hasAlpha = true, hasAlpha = true,
}), }),
} },
}, },
border = { border = {
type = "group", type = "group",
name = "Border", name = "Border",
order = 2, order = 3,
args = { args = {
headerAuras = { headerAuras = {
type = "header", type = "header",

View File

@ -226,15 +226,16 @@ end
--------------------------- ---------------------------
function BuffsDebuffs:CreateFrame(unit) function BuffsDebuffs:CreateFrame(unit)
local verticalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
local debuffFrame = CreateFrame("Frame", "GladdyDebuffs" .. unit, Gladdy.buttons[unit]) local debuffFrame = CreateFrame("Frame", "GladdyDebuffs" .. unit, Gladdy.buttons[unit])
debuffFrame:SetHeight(Gladdy.db.buffsIconSize) debuffFrame:SetHeight(Gladdy.db.buffsIconSize)
debuffFrame:SetWidth(1) debuffFrame:SetWidth(1)
debuffFrame:SetPoint("BOTTOMLEFT", Gladdy.buttons[unit].healthBar, "TOPLEFT", 0, Gladdy.db.highlightBorderSize + Gladdy.db.padding) debuffFrame:SetPoint("BOTTOMLEFT", Gladdy.buttons[unit].healthBar, "TOPLEFT", 0, verticalMargin)
debuffFrame.unit = unit debuffFrame.unit = unit
local buffFrame = CreateFrame("Frame", "GladdyBuffs" .. unit, Gladdy.buttons[unit]) local buffFrame = CreateFrame("Frame", "GladdyBuffs" .. unit, Gladdy.buttons[unit])
buffFrame:SetHeight(Gladdy.db.buffsIconSize) buffFrame:SetHeight(Gladdy.db.buffsIconSize)
buffFrame:SetWidth(1) buffFrame:SetWidth(1)
buffFrame:SetPoint("BOTTOMLEFT", Gladdy.buttons[unit].healthBar, "TOPLEFT", 0, Gladdy.db.highlightBorderSize + Gladdy.db.padding) buffFrame:SetPoint("BOTTOMLEFT", Gladdy.buttons[unit].healthBar, "TOPLEFT", 0, verticalMargin)
buffFrame.unit = unit buffFrame.unit = unit
self.frames[unit] = {} self.frames[unit] = {}
self.frames[unit].buffFrame = buffFrame self.frames[unit].buffFrame = buffFrame
@ -277,7 +278,9 @@ end
function BuffsDebuffs:UpdateFrame(unit) function BuffsDebuffs:UpdateFrame(unit)
self.frames[unit].debuffFrame:SetHeight(Gladdy.db.buffsIconSize) self.frames[unit].debuffFrame:SetHeight(Gladdy.db.buffsIconSize)
self.frames[unit].debuffFrame:ClearAllPoints() self.frames[unit].debuffFrame:ClearAllPoints()
local horizontalMargin = Gladdy.db.highlightBorderSize
--DEBUFFS
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize)
local verticalMargin = -(Gladdy.db.powerBarHeight)/2 local verticalMargin = -(Gladdy.db.powerBarHeight)/2
if Gladdy.db.buffsCooldownPos == "TOP" then if Gladdy.db.buffsCooldownPos == "TOP" then
verticalMargin = horizontalMargin + 1 verticalMargin = horizontalMargin + 1
@ -300,7 +303,7 @@ function BuffsDebuffs:UpdateFrame(unit)
self.frames[unit].debuffFrame:SetPoint("TOPRIGHT", Gladdy.buttons[unit].powerBar, "BOTTOMLEFT", Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset -verticalMargin) self.frames[unit].debuffFrame:SetPoint("TOPRIGHT", Gladdy.buttons[unit].powerBar, "BOTTOMLEFT", Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset -verticalMargin)
end end
elseif Gladdy.db.buffsCooldownPos == "LEFT" then elseif Gladdy.db.buffsCooldownPos == "LEFT" then
horizontalMargin = Gladdy.db.highlightBorderSize - 1 + Gladdy.db.padding horizontalMargin = horizontalMargin - 1 + Gladdy.db.padding
local anchor = Gladdy:GetAnchor(unit, "LEFT") local anchor = Gladdy:GetAnchor(unit, "LEFT")
if anchor == Gladdy.buttons[unit].healthBar then if anchor == Gladdy.buttons[unit].healthBar then
self.frames[unit].debuffFrame:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin + Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset) self.frames[unit].debuffFrame:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin + Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset)
@ -318,9 +321,10 @@ function BuffsDebuffs:UpdateFrame(unit)
end end
end end
--BUFFS
self.frames[unit].buffFrame:SetHeight(Gladdy.db.buffsBuffsIconSize) self.frames[unit].buffFrame:SetHeight(Gladdy.db.buffsBuffsIconSize)
self.frames[unit].buffFrame:ClearAllPoints() self.frames[unit].buffFrame:ClearAllPoints()
horizontalMargin = Gladdy.db.highlightBorderSize horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize)
verticalMargin = -(Gladdy.db.powerBarHeight)/2 verticalMargin = -(Gladdy.db.powerBarHeight)/2
if Gladdy.db.buffsBuffsCooldownPos == "TOP" then if Gladdy.db.buffsBuffsCooldownPos == "TOP" then
verticalMargin = horizontalMargin + 1 verticalMargin = horizontalMargin + 1
@ -369,7 +373,7 @@ function BuffsDebuffs:UpdateFrame(unit)
--self.frames[unit].buffFrame:SetPoint("RIGHT", Gladdy.buttons[unit].healthBar, "LEFT", -horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset + verticalMargin) --self.frames[unit].buffFrame:SetPoint("RIGHT", Gladdy.buttons[unit].healthBar, "LEFT", -horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset + verticalMargin)
local anchor = Gladdy:GetAnchor(unit, "LEFT") local anchor = Gladdy:GetAnchor(unit, "LEFT")
horizontalMargin = Gladdy.db.highlightBorderSize - 1 + Gladdy.db.padding horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) - 1 + Gladdy.db.padding
if anchor == Gladdy.buttons[unit].healthBar then if anchor == Gladdy.buttons[unit].healthBar then
self.frames[unit].buffFrame:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset) self.frames[unit].buffFrame:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset)
else else
@ -403,7 +407,7 @@ function BuffsDebuffs:UpdateFrame(unit)
--self.frames[unit].buffFrame:SetPoint("LEFT", Gladdy.buttons[unit].healthBar, "RIGHT", horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset + verticalMargin) --self.frames[unit].buffFrame:SetPoint("LEFT", Gladdy.buttons[unit].healthBar, "RIGHT", horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset + verticalMargin)
local anchor = Gladdy:GetAnchor(unit, "RIGHT") local anchor = Gladdy:GetAnchor(unit, "RIGHT")
horizontalMargin = Gladdy.db.highlightBorderSize - 1 + Gladdy.db.padding horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) - 1 + Gladdy.db.padding
if anchor == Gladdy.buttons[unit].healthBar then if anchor == Gladdy.buttons[unit].healthBar then
self.frames[unit].buffFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset) self.frames[unit].buffFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset)
else else

View File

@ -165,7 +165,7 @@ function Castbar:UpdateFrame(unit)
end end
castBar:ClearAllPoints() castBar:ClearAllPoints()
local horizontalMargin = Gladdy.db.highlightBorderSize + Gladdy.db.padding local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
if (Gladdy.db.castBarPos == "LEFT") then if (Gladdy.db.castBarPos == "LEFT") then
local anchor = Gladdy:GetAnchor(unit, "LEFT") local anchor = Gladdy:GetAnchor(unit, "LEFT")
if anchor == Gladdy.buttons[unit].healthBar then if anchor == Gladdy.buttons[unit].healthBar then

View File

@ -120,7 +120,7 @@ function Classicon:UpdateFrame(unit)
classIcon:SetHeight(Gladdy.db.classIconSize) classIcon:SetHeight(Gladdy.db.classIconSize)
classIcon:ClearAllPoints() classIcon:ClearAllPoints()
local margin = Gladdy.db.highlightBorderSize + Gladdy.db.padding local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
if (Gladdy.db.classIconPos == "LEFT") then if (Gladdy.db.classIconPos == "LEFT") then
classIcon:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -margin, 0) classIcon:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -margin, 0)
else else
@ -203,6 +203,11 @@ function Classicon:GetOptions()
name = L["Icon size"], name = L["Icon size"],
order = 1, order = 1,
args = { args = {
header = {
type = "header",
name = L["Icon size"],
order = 1,
},
classIconSize = Gladdy:option({ classIconSize = Gladdy:option({
type = "range", type = "range",
name = L["Icon size"], name = L["Icon size"],

View File

@ -64,6 +64,7 @@ function CombatIndicator:UpdateFrame(unit)
end end
ciFrame:SetHeight(Gladdy.db.ciSize) ciFrame:SetHeight(Gladdy.db.ciSize)
ciFrame:SetWidth(Gladdy.db.ciSize * Gladdy.db.ciWidthFactor) ciFrame:SetWidth(Gladdy.db.ciSize * Gladdy.db.ciWidthFactor)
ciFrame.border:SetTexture(Gladdy.db.ciBorderStyle)
ciFrame.border:SetVertexColor(Gladdy.db.ciBorderColor.r, Gladdy.db.ciBorderColor.g, Gladdy.db.ciBorderColor.b, Gladdy.db.ciBorderColor.a) ciFrame.border:SetVertexColor(Gladdy.db.ciBorderColor.r, Gladdy.db.ciBorderColor.g, Gladdy.db.ciBorderColor.b, Gladdy.db.ciBorderColor.a)
ciFrame:ClearAllPoints() ciFrame:ClearAllPoints()

View File

@ -135,29 +135,30 @@ function Cooldowns:UpdateFrame(unit)
if (Gladdy.db.cooldown) then if (Gladdy.db.cooldown) then
button.spellCooldownFrame:ClearAllPoints() button.spellCooldownFrame:ClearAllPoints()
local verticalMargin = -(Gladdy.db.powerBarHeight)/2 local verticalMargin = -(Gladdy.db.powerBarHeight)/2
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize)
if Gladdy.db.cooldownYPos == "TOP" then if Gladdy.db.cooldownYPos == "TOP" then
if Gladdy.db.cooldownXPos == "RIGHT" then if Gladdy.db.cooldownXPos == "RIGHT" then
button.spellCooldownFrame:SetPoint("BOTTOMRIGHT", button.healthBar, "TOPRIGHT", Gladdy.db.cooldownXOffset, Gladdy.db.highlightBorderSize + Gladdy.db.cooldownYOffset) -- needs to be properly anchored after trinket button.spellCooldownFrame:SetPoint("BOTTOMRIGHT", button.healthBar, "TOPRIGHT", Gladdy.db.cooldownXOffset, horizontalMargin + Gladdy.db.cooldownYOffset)
else else
button.spellCooldownFrame:SetPoint("BOTTOMLEFT", button.healthBar, "TOPLEFT", Gladdy.db.cooldownXOffset, Gladdy.db.highlightBorderSize + Gladdy.db.cooldownYOffset) button.spellCooldownFrame:SetPoint("BOTTOMLEFT", button.healthBar, "TOPLEFT", Gladdy.db.cooldownXOffset, horizontalMargin + Gladdy.db.cooldownYOffset)
end end
elseif Gladdy.db.cooldownYPos == "BOTTOM" then elseif Gladdy.db.cooldownYPos == "BOTTOM" then
if Gladdy.db.cooldownXPos == "RIGHT" then if Gladdy.db.cooldownXPos == "RIGHT" then
button.spellCooldownFrame:SetPoint("TOPRIGHT", button.powerBar, "BOTTOMRIGHT", Gladdy.db.cooldownXOffset, -Gladdy.db.highlightBorderSize + Gladdy.db.cooldownYOffset) -- needs to be properly anchored after trinket button.spellCooldownFrame:SetPoint("TOPRIGHT", button.powerBar, "BOTTOMRIGHT", Gladdy.db.cooldownXOffset, -horizontalMargin + Gladdy.db.cooldownYOffset)
else else
button.spellCooldownFrame:SetPoint("TOPLEFT", button.powerBar, "BOTTOMLEFT", Gladdy.db.cooldownXOffset, -Gladdy.db.highlightBorderSize + Gladdy.db.cooldownYOffset) button.spellCooldownFrame:SetPoint("TOPLEFT", button.powerBar, "BOTTOMLEFT", Gladdy.db.cooldownXOffset, -horizontalMargin + Gladdy.db.cooldownYOffset)
end end
elseif Gladdy.db.cooldownYPos == "LEFT" then elseif Gladdy.db.cooldownYPos == "LEFT" then
local anchor = Gladdy:GetAnchor(unit, "LEFT") local anchor = Gladdy:GetAnchor(unit, "LEFT")
if anchor == Gladdy.buttons[unit].healthBar then if anchor == Gladdy.buttons[unit].healthBar then
button.spellCooldownFrame:SetPoint("RIGHT", anchor, "LEFT", -(Gladdy.db.highlightBorderSize + Gladdy.db.padding) + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset) button.spellCooldownFrame:SetPoint("RIGHT", anchor, "LEFT", -(horizontalMargin + Gladdy.db.padding) + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset)
else else
button.spellCooldownFrame:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset) button.spellCooldownFrame:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset)
end end
elseif Gladdy.db.cooldownYPos == "RIGHT" then elseif Gladdy.db.cooldownYPos == "RIGHT" then
local anchor = Gladdy:GetAnchor(unit, "RIGHT") local anchor = Gladdy:GetAnchor(unit, "RIGHT")
if anchor == Gladdy.buttons[unit].healthBar then if anchor == Gladdy.buttons[unit].healthBar then
button.spellCooldownFrame:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.highlightBorderSize + Gladdy.db.padding + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset) button.spellCooldownFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.padding + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset)
else else
button.spellCooldownFrame:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset) button.spellCooldownFrame:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset)
end end
@ -601,7 +602,7 @@ function Cooldowns:GetOptions()
desc = L["Size of each cd icon"], desc = L["Size of each cd icon"],
order = 4, order = 4,
min = 5, min = 5,
max = (Gladdy.db.healthBarHeight + Gladdy.db.castBarHeight + Gladdy.db.powerBarHeight + Gladdy.db.bottomMargin) / 2, max = 50,
}), }),
cooldownWidthFactor = Gladdy:option({ cooldownWidthFactor = Gladdy:option({
type = "range", type = "range",

View File

@ -162,7 +162,7 @@ function Diminishings:UpdateFrame(unit)
end end
drFrame:ClearAllPoints() drFrame:ClearAllPoints()
local horizontalMargin = Gladdy.db.highlightBorderSize + Gladdy.db.padding local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
if (Gladdy.db.drCooldownPos == "LEFT") then if (Gladdy.db.drCooldownPos == "LEFT") then
local anchor = Gladdy:GetAnchor(unit, "LEFT") local anchor = Gladdy:GetAnchor(unit, "LEFT")
if anchor == Gladdy.buttons[unit].healthBar then if anchor == Gladdy.buttons[unit].healthBar then

View File

@ -85,6 +85,10 @@ end)
import:AddChild(importClearButton) import:AddChild(importClearButton)
import.clearButton = importClearButton import.clearButton = importClearButton
local deletedOptions = { --TODO backward compatibility Imports on deleted options
growUp = true
}
function ExportImport:CheckDeserializedOptions(tbl, refTbl, str) function ExportImport:CheckDeserializedOptions(tbl, refTbl, str)
if str == nil and not tbl.version_major_num then if str == nil and not tbl.version_major_num then
return false, "Version conflict: version_major_num not seen" return false, "Version conflict: version_major_num not seen"

View File

@ -164,7 +164,7 @@ function Healthbar:UpdateFrame(unit)
edgeSize = Gladdy.db.healthBarBorderSize }) edgeSize = Gladdy.db.healthBarBorderSize })
healthBar:SetBackdropBorderColor(Gladdy.db.healthBarBorderColor.r, Gladdy.db.healthBarBorderColor.g, Gladdy.db.healthBarBorderColor.b, Gladdy.db.healthBarBorderColor.a) healthBar:SetBackdropBorderColor(Gladdy.db.healthBarBorderColor.r, Gladdy.db.healthBarBorderColor.g, Gladdy.db.healthBarBorderColor.b, Gladdy.db.healthBarBorderColor.a)
healthBar:ClearAllPoints() healthBar:ClearAllPoints()
healthBar:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPLEFT", iconSize, 0) healthBar:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPLEFT", 0, 0)
healthBar:SetPoint("BOTTOMRIGHT", Gladdy.buttons[unit], "BOTTOMRIGHT") healthBar:SetPoint("BOTTOMRIGHT", Gladdy.buttons[unit], "BOTTOMRIGHT")
healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture)) healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture))

View File

@ -3,10 +3,12 @@ local CreateFrame, UnitIsUnit = CreateFrame, UnitIsUnit
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
local L = Gladdy.L local L = Gladdy.L
local Highlight = Gladdy:NewModule("Highlight", nil, { local Highlight = Gladdy:NewModule("Highlight", nil, {
highlightBorderSize = 2, highlightBorderSize = 1,
highlightInset = false,
targetBorderColor = { r = 1, g = 0.8, b = 0, a = 1 }, targetBorderColor = { r = 1, g = 0.8, b = 0, a = 1 },
focusBorderColor = { r = 1, g = 0, b = 0, a = 1 }, focusBorderColor = { r = 1, g = 0, b = 0, a = 1 },
leaderBorderColor = { r = 0, g = 1, b = 0, a = 1 }, leaderBorderColor = { r = 0, g = 1, b = 0, a = 1 },
highlightBorderStyle = "Square Full White",
highlight = true, highlight = true,
targetBorder = true, targetBorder = true,
focusBorder = true, focusBorder = true,
@ -53,17 +55,17 @@ function Highlight:CreateFrame(unit)
local healthBar = Gladdy.modules.Healthbar.frames[unit] local healthBar = Gladdy.modules.Healthbar.frames[unit]
local targetBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate") local targetBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
targetBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = Gladdy.db.highlightBorderSize }) targetBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = Gladdy.db.highlightBorderSize })
--targetBorder:SetFrameStrata("MEDIUM") --targetBorder:SetFrameStrata("MEDIUM")
targetBorder:Hide() targetBorder:Hide()
local focusBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate") local focusBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
focusBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = Gladdy.db.highlightBorderSize }) focusBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = Gladdy.db.highlightBorderSize })
--focusBorder:SetFrameStrata("MEDIUM") --focusBorder:SetFrameStrata("MEDIUM")
focusBorder:Hide() focusBorder:Hide()
local leaderBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate") local leaderBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
leaderBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = Gladdy.db.highlightBorderSize }) leaderBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = Gladdy.db.highlightBorderSize })
--leaderBorder:SetFrameStrata("MEDIUM") --leaderBorder:SetFrameStrata("MEDIUM")
leaderBorder:Hide() leaderBorder:Hide()
@ -88,29 +90,48 @@ function Highlight:UpdateFrame(unit)
end end
local borderSize = Gladdy.db.highlightBorderSize local borderSize = Gladdy.db.highlightBorderSize
local borderOffset = borderSize
local iconSize = Gladdy.db.healthBarHeight + Gladdy.db.powerBarHeight + 1 local iconSize = Gladdy.db.healthBarHeight + Gladdy.db.powerBarHeight + 1
local width = Gladdy.db.barWidth + borderSize * 2 local width = Gladdy.db.barWidth + (Gladdy.db.highlightInset and 0 or borderSize * 2)
local height = iconSize + borderSize * 2 local height = iconSize + (Gladdy.db.highlightInset and 0 or borderSize * 2)
button.targetBorder:SetWidth(width) button.targetBorder:SetWidth(width)
button.targetBorder:SetHeight(height) button.targetBorder:SetHeight(height)
button.targetBorder:ClearAllPoints() button.targetBorder:ClearAllPoints()
button.targetBorder:SetPoint("TOP", button.healthBar, "TOP", 0, borderSize) if Gladdy.db.highlightInset then
button.targetBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = borderSize }) button.targetBorder:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT", -(borderOffset/Gladdy.db.statusbarBorderOffset), (borderOffset/Gladdy.db.statusbarBorderOffset))
button.targetBorder:SetPoint("BOTTOMRIGHT", button.powerBar, "BOTTOMRIGHT", (borderOffset/Gladdy.db.statusbarBorderOffset), -(borderOffset/Gladdy.db.statusbarBorderOffset))
else
button.targetBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
end
button.targetBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = borderSize })
button.targetBorder:SetBackdropBorderColor(Gladdy.db.targetBorderColor.r, Gladdy.db.targetBorderColor.g, Gladdy.db.targetBorderColor.b, Gladdy.db.targetBorderColor.a) button.targetBorder:SetBackdropBorderColor(Gladdy.db.targetBorderColor.r, Gladdy.db.targetBorderColor.g, Gladdy.db.targetBorderColor.b, Gladdy.db.targetBorderColor.a)
button.focusBorder:SetWidth(width) button.focusBorder:SetWidth(width)
button.focusBorder:SetHeight(height) button.focusBorder:SetHeight(height)
button.focusBorder:ClearAllPoints() button.focusBorder:ClearAllPoints()
button.focusBorder:SetPoint("TOP", button.healthBar, "TOP", 0, borderSize) if Gladdy.db.highlightInset then
button.focusBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = borderSize }) button.focusBorder:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT", -(borderOffset/Gladdy.db.statusbarBorderOffset), (borderOffset/Gladdy.db.statusbarBorderOffset))
button.focusBorder:SetPoint("BOTTOMRIGHT", button.powerBar, "BOTTOMRIGHT", (borderOffset/Gladdy.db.statusbarBorderOffset), -(borderOffset/Gladdy.db.statusbarBorderOffset))
else
button.focusBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
end
button.focusBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = borderSize })
button.focusBorder:SetBackdropBorderColor(Gladdy.db.focusBorderColor.r, Gladdy.db.focusBorderColor.g, Gladdy.db.focusBorderColor.b, Gladdy.db.focusBorderColor.a) button.focusBorder:SetBackdropBorderColor(Gladdy.db.focusBorderColor.r, Gladdy.db.focusBorderColor.g, Gladdy.db.focusBorderColor.b, Gladdy.db.focusBorderColor.a)
button.leaderBorder:SetWidth(width) button.leaderBorder:SetWidth(width)
button.leaderBorder:SetHeight(height) button.leaderBorder:SetHeight(height)
button.leaderBorder:ClearAllPoints() button.leaderBorder:ClearAllPoints()
button.leaderBorder:SetPoint("TOP", button.healthBar, "TOP", 0, borderSize) if Gladdy.db.highlightInset then
button.leaderBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = borderSize }) button.leaderBorder:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT", -(borderOffset/Gladdy.db.statusbarBorderOffset), (borderOffset/Gladdy.db.statusbarBorderOffset))
button.leaderBorder:SetPoint("BOTTOMRIGHT", button.powerBar, "BOTTOMRIGHT", (borderOffset/Gladdy.db.statusbarBorderOffset), -(borderOffset/Gladdy.db.statusbarBorderOffset))
else
button.leaderBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
end
button.leaderBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = borderSize })
button.leaderBorder:SetBackdropBorderColor(Gladdy.db.leaderBorderColor.r, Gladdy.db.leaderBorderColor.g, Gladdy.db.leaderBorderColor.b, Gladdy.db.leaderBorderColor.a) button.leaderBorder:SetBackdropBorderColor(Gladdy.db.leaderBorderColor.r, Gladdy.db.leaderBorderColor.g, Gladdy.db.leaderBorderColor.b, Gladdy.db.leaderBorderColor.a)
if Gladdy.frame.testing then if Gladdy.frame.testing then
Highlight:Test(unit) Highlight:Test(unit)
@ -179,34 +200,52 @@ function Highlight:GetOptions()
name = L["Highlight"], name = L["Highlight"],
order = 2, order = 2,
}, },
highlightBorderSize = { highlightInset = Gladdy:option({
type = "toggle",
name = L["Show Inside"],
desc = L["Show Highlight border inside of frame"],
order = 3,
}),
highlightBorderSize = Gladdy:option({
type = "range", type = "range",
name = L["Border size"], name = L["Border size"],
desc = L["Border size"], desc = L["Border size"],
order = 3, order = 4,
min = 1, min = 1,
max = 10, max = 20,
step = 1, step = 1,
}),
highlightBorderStyle = Gladdy:option({
type = "select",
name = L["Border style"],
order = 5,
dialogControl = "LSM30_Border",
values = AceGUIWidgetLSMlists.border,
}),
headerColor = {
type = "header",
name = L["Colors"],
order = 6,
}, },
targetBorderColor = Gladdy:colorOption({ targetBorderColor = Gladdy:colorOption({
type = "color", type = "color",
name = L["Target border color"], name = L["Target border color"],
desc = L["Color of the selected targets border"], desc = L["Color of the selected targets border"],
order = 4, order = 7,
hasAlpha = true, hasAlpha = true,
}), }),
focusBorderColor = Gladdy:colorOption({ focusBorderColor = Gladdy:colorOption({
type = "color", type = "color",
name = L["Focus border color"], name = L["Focus border color"],
desc = L["Color of the focus border"], desc = L["Color of the focus border"],
order = 5, order = 8,
hasAlpha = true, hasAlpha = true,
}), }),
leaderBorderColor = Gladdy:colorOption({ leaderBorderColor = Gladdy:colorOption({
type = "color", type = "color",
name = L["Raid leader border color"], name = L["Raid leader border color"],
desc = L["Color of the raid leader border"], desc = L["Color of the raid leader border"],
order = 6, order = 9,
hasAlpha = true, hasAlpha = true,
}), }),
headerEnable = { headerEnable = {

View File

@ -1,12 +1,12 @@
local string_gsub, floor, pairs = string.gsub, math.floor, pairs local string_gsub, floor, pairs = string.gsub, math.floor, pairs
local CreateFrame = CreateFrame local CreateFrame, SetPortraitTexture = CreateFrame, SetPortraitTexture
local UnitHealthMax, UnitHealth, UnitGUID = UnitHealthMax, UnitHealth, UnitGUID local UnitHealthMax, UnitHealth, UnitGUID = UnitHealthMax, UnitHealth, UnitGUID
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
local L = Gladdy.L local L = Gladdy.L
local Pets = Gladdy:NewModule("Pets", nil, { local Pets = Gladdy:NewModule("Pets", nil, {
petEnabled = true, petEnabled = true,
petWidth = 100, petWidth = 128,
petHeight = 20, petHeight = 20,
petPortraitEnabled = true, petPortraitEnabled = true,
petPortraitBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp", petPortraitBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
@ -21,8 +21,8 @@ local Pets = Gladdy:NewModule("Pets", nil, {
petHealthBarFontColor = { r = 1, g = 1, b = 1, a = 1 }, petHealthBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
petHealthBarFontSize = 12, petHealthBarFontSize = 12,
petHealthPercentage = true, petHealthPercentage = true,
petXOffset = 50, petXOffset = 1,
petYOffset = 0, petYOffset = -62,
}) })
function Pets:Initialize() function Pets:Initialize()
@ -124,6 +124,7 @@ function Pets:Test(unitId)
petFrame.healthBar.hp:SetMinMaxValues(0, 6200) petFrame.healthBar.hp:SetMinMaxValues(0, 6200)
petFrame.healthBar.hp:SetValue(2000) petFrame.healthBar.hp:SetValue(2000)
Pets:SetHealthText(petFrame.healthBar, 2000, 6200) Pets:SetHealthText(petFrame.healthBar, 2000, 6200)
SetPortraitTexture(petFrame.healthBar.portrait, "player")
end end
end end
@ -374,7 +375,7 @@ function Pets:GetOptions()
desc = L["Width of the bar"], desc = L["Width of the bar"],
order = 4, order = 4,
min = 10, min = 10,
max = 100, max = 300,
step = 1, step = 1,
}), }),
petHealthBarTexture = option({ petHealthBarTexture = option({

View File

@ -134,7 +134,7 @@ function Racial:UpdateFrame(unit)
racial.texture.overlay:SetVertexColor(Gladdy.db.racialBorderColor.r, Gladdy.db.racialBorderColor.g, Gladdy.db.racialBorderColor.b, Gladdy.db.racialBorderColor.a) racial.texture.overlay:SetVertexColor(Gladdy.db.racialBorderColor.r, Gladdy.db.racialBorderColor.g, Gladdy.db.racialBorderColor.b, Gladdy.db.racialBorderColor.a)
racial:ClearAllPoints() racial:ClearAllPoints()
local margin = Gladdy.db.highlightBorderSize + Gladdy.db.padding local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
local parent = Gladdy.buttons[unit][Gladdy.db.racialAnchor] local parent = Gladdy.buttons[unit][Gladdy.db.racialAnchor]
if (Gladdy.db.racialPos == "RIGHT") then if (Gladdy.db.racialPos == "RIGHT") then
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset) racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset)
@ -237,7 +237,7 @@ function Racial:GetOptions()
header = { header = {
type = "header", type = "header",
name = L["Size"], name = L["Size"],
order = 4, order = 1,
}, },
racialSize = Gladdy:option({ racialSize = Gladdy:option({
type = "range", type = "range",
@ -245,7 +245,7 @@ function Racial:GetOptions()
min = 5, min = 5,
max = 100, max = 100,
step = 1, step = 1,
order = 4, order = 2,
}), }),
racialWidthFactor = Gladdy:option({ racialWidthFactor = Gladdy:option({
type = "range", type = "range",
@ -253,7 +253,7 @@ function Racial:GetOptions()
min = 0.5, min = 0.5,
max = 2, max = 2,
step = 0.05, step = 0.05,
order = 6, order = 3,
}), }),
}, },
}, },

View File

@ -451,7 +451,7 @@ function TotemPlates:GetOptions()
args = { args = {
header = { header = {
type = "header", type = "header",
name = L["Icon"], name = L["Font"],
order = 1, order = 1,
}, },
npTremorFont = Gladdy:option({ npTremorFont = Gladdy:option({

View File

@ -130,7 +130,7 @@ function Trinket:UpdateFrame(unit)
trinket.texture.overlay:SetVertexColor(Gladdy.db.trinketBorderColor.r, Gladdy.db.trinketBorderColor.g, Gladdy.db.trinketBorderColor.b, Gladdy.db.trinketBorderColor.a) trinket.texture.overlay:SetVertexColor(Gladdy.db.trinketBorderColor.r, Gladdy.db.trinketBorderColor.g, Gladdy.db.trinketBorderColor.b, Gladdy.db.trinketBorderColor.a)
trinket:ClearAllPoints() trinket:ClearAllPoints()
local margin = Gladdy.db.highlightBorderSize + Gladdy.db.padding local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
if (Gladdy.db.classIconPos == "LEFT") then if (Gladdy.db.classIconPos == "LEFT") then
if (Gladdy.db.trinketPos == "RIGHT") then if (Gladdy.db.trinketPos == "RIGHT") then
trinket:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", margin, 0) trinket:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", margin, 0)

View File

@ -34,12 +34,41 @@ function XiconProfiles:ApplyClassic()
Gladdy:ToggleFrame(3) Gladdy:ToggleFrame(3)
end end
function XiconProfiles:ApplyBlizz()
local deserialized = Gladdy.modules["ExportImport"]:Decode(Gladdy:GetBlizzardProfile())
if deserialized then
Gladdy.modules["ExportImport"]:ApplyImport(deserialized, Gladdy.db)
end
Gladdy:Reset()
Gladdy:HideFrame()
Gladdy:ToggleFrame(3)
end
function XiconProfiles:GetOptions() function XiconProfiles:GetOptions()
return { return {
headerProfileBlizzard = {
type = "header",
name = L["Blizzard Profile"],
order = 2,
},
blizzardProfile = {
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
XiconProfiles:ApplyBlizz()
end,
name = " ",
desc = "Blizzard Profile",
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Blizz1.blp",
imageWidth = 350,
imageHeight = 175,
width = "full",
order = 3,
},
headerProfileClassic = { headerProfileClassic = {
type = "header", type = "header",
name = L["Classic Profile"], name = L["Classic Profile"],
order = 2, order = 4,
}, },
classicProfile = { classicProfile = {
type = "execute", type = "execute",
@ -53,12 +82,12 @@ function XiconProfiles:GetOptions()
imageWidth = 350, imageWidth = 350,
imageHeight = 175, imageHeight = 175,
width = "full", width = "full",
order = 3, order = 5,
}, },
headerProfileKnall = { headerProfileKnall = {
type = "header", type = "header",
name = L["Knall's Profile"], name = L["Knall's Profile"],
order = 4, order = 6,
}, },
knallProfile = { knallProfile = {
type = "execute", type = "execute",
@ -72,12 +101,12 @@ function XiconProfiles:GetOptions()
imageWidth = 350, imageWidth = 350,
imageHeight = 175, imageHeight = 175,
width = "full", width = "full",
order = 5, order = 7,
}, },
headerProfileKlimp = { headerProfileKlimp = {
type = "header", type = "header",
name = L["Klimp's Profile"], name = L["Klimp's Profile"],
order = 6, order = 8,
}, },
klimpProfiles = { klimpProfiles = {
type = "execute", type = "execute",
@ -91,7 +120,8 @@ function XiconProfiles:GetOptions()
name = " ", name = " ",
desc = "Klimp's Profile", desc = "Klimp's Profile",
width = "full", width = "full",
order = 7, order = 9,
}, },
} }
end end

View File

@ -16,10 +16,11 @@ Gladdy.defaults = {
x = 0, x = 0,
y = 0, y = 0,
growUp = false, growUp = false,
growDirection = "BOTTOM",
frameScale = 1, frameScale = 1,
padding = 3, padding = 1,
barWidth = 180, barWidth = 180,
bottomMargin = 10, bottomMargin = 2,
statusbarBorderOffset = 6, statusbarBorderOffset = 6,
}, },
} }
@ -193,10 +194,21 @@ function Gladdy:SetupOptions()
desc = L["If enabled the frame will grow upwards instead of downwards"], desc = L["If enabled the frame will grow upwards instead of downwards"],
order = 2, order = 2,
}, },
growDirection = {
type = "select",
name = L["Grow Direction"],
order = 3,
values = {
["BOTTOM"] = L["Down"],
["TOP"] = L["Up"],
["LEFT"] = L["Left"],
["RIGHT"] = L["Right"],
}
},
group = { group = {
type = "group", type = "group",
name = "General", name = "General",
order = 3, order = 4,
childGroups = "tree", childGroups = "tree",
args = { args = {
frameGeneral = { frameGeneral = {
@ -238,11 +250,11 @@ function Gladdy:SetupOptions()
}, },
bottomMargin = { bottomMargin = {
type = "range", type = "range",
name = L["Bottom margin"], name = L["Margin"],
desc = L["Margin between each button"], desc = L["Margin between each button"],
order = 7, order = 7,
min = -100, min = -200,
max = 100, max = 200,
step = 1, step = 1,
}, },
} }
@ -490,6 +502,7 @@ function Gladdy:SetupOptions()
local g = Gladdy.db.cooldownBorderColor local g = Gladdy.db.cooldownBorderColor
local h = Gladdy.db.drBorderColor local h = Gladdy.db.drBorderColor
local i = Gladdy.db.trinketBorderColor local i = Gladdy.db.trinketBorderColor
local j = Gladdy.db.racialBorderColor
if (a.r == b.r and a.g == b.g and a.b == b.b and a.a == b.a if (a.r == b.r and a.g == b.g and a.b == b.b and a.a == b.a
and a.r == c.r and a.g == c.g and a.b == c.b and a.a == c.a and a.r == c.r and a.g == c.g and a.b == c.b and a.a == c.a
and a.r == d.r and a.g == d.g and a.b == d.b and a.a == d.a and a.r == d.r and a.g == d.g and a.b == d.b and a.a == d.a
@ -497,7 +510,8 @@ function Gladdy:SetupOptions()
and a.r == f.r and a.g == f.g and a.b == f.b and a.a == f.a and a.r == f.r and a.g == f.g and a.b == f.b and a.a == f.a
and a.r == g.r and a.g == g.g and a.b == g.b and a.a == g.a and a.r == g.r and a.g == g.g and a.b == g.b and a.a == g.a
and a.r == h.r and a.g == h.g and a.b == h.b and a.a == h.a and a.r == h.r and a.g == h.g and a.b == h.b and a.a == h.a
and a.r == i.r and a.g == i.g and a.b == i.b and a.a == i.a) then and a.r == i.r and a.g == i.g and a.b == i.b and a.a == i.a
and a.r == j.r and a.g == j.g and a.b == j.b and a.a == j.a) then
return a.r, a.g, a.b, a.a return a.r, a.g, a.b, a.a
else else
return { r = 0, g = 0, b = 0, a = 0 } return { r = 0, g = 0, b = 0, a = 0 }
@ -514,6 +528,7 @@ function Gladdy:SetupOptions()
Gladdy.db.cooldownBorderColor = rgb Gladdy.db.cooldownBorderColor = rgb
Gladdy.db.drBorderColor = rgb Gladdy.db.drBorderColor = rgb
Gladdy.db.trinketBorderColor = rgb Gladdy.db.trinketBorderColor = rgb
Gladdy.db.racialBorderColor = rgb
Gladdy:UpdateFrame() Gladdy:UpdateFrame()
end, end,
}, },

View File

@ -1,7 +1,7 @@
# Gladdy - TBC # Gladdy - TBC
### The most powerful arena addon for WoW TBC 2.5.1 ### The most powerful arena addon for WoW TBC 2.5.1
## [v1.07-Beta Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v1.07-Beta/Gladdy_TBC-Classic_v1.07-Beta.zip) ## [v1.08-Beta Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v1.08-Beta/Gladdy_TBC-Classic_v1.08-Beta.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 ###### <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
@ -39,6 +39,13 @@ The goal is to make Gladdy highly configurable in it's appearance. Everything ca
### Changes ### Changes
#### v1.08-Beta
- fix Buffs not showing on class icon
- added option highlight to be inside
- added option to grow frames vertically
- added new profile to XiconProfile (Blizzard raid style)
- minor bugfixes
#### v1.07-Beta #### v1.07-Beta
- CombatIndicator module added - CombatIndicator module added