From b2b4848ff41023ad85f42bfa72a4f0105e1bed1b Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Mon, 1 Aug 2022 19:50:42 +0200 Subject: [PATCH] zoomed icons auras, buffs, castbar, classicon, cooldowns, diminishing, racial, trinket --- Modules/Auras.lua | 127 ++++++++++++++++++++++++++++++++++++--- Modules/BuffsDebuffs.lua | 68 ++++++++++++++++++--- Modules/Castbar.lua | 43 +++++++++++-- Modules/Classicon.lua | 39 +++++++++++- Modules/Cooldowns.lua | 119 +++++++++++++++++++++++++++++++++--- Modules/Diminishings.lua | 49 ++++++++++++--- Modules/Racial.lua | 49 +++++++++++++-- Modules/Trinket.lua | 69 ++++++++++++++++----- 8 files changed, 500 insertions(+), 63 deletions(-) diff --git a/Modules/Auras.lua b/Modules/Auras.lua index a324218..da9ede8 100644 --- a/Modules/Auras.lua +++ b/Modules/Auras.lua @@ -47,11 +47,13 @@ local Auras = Gladdy:NewModule("Auras", nil, { auraYOffset = 0, auraSize = 60 + 20 + 1, auraWidthFactor = 0.9, + auraIconZoomed = false, auraInterruptDetached = false, auraInterruptXOffset = 0, auraInterruptYOffset = 0, auraInterruptSize = 60 + 20 + 1, auraInterruptWidthFactor = 0.9, + auraInterruptIconZoomed = false, auraFrameStrata = "MEDIUM", auraFrameLevel = 5, auraInterruptFrameStrata = "MEDIUM", @@ -101,6 +103,7 @@ function Auras:CreateFrame(unit) auraFrame.icon = auraFrame.frame:CreateTexture(nil, "BACKGROUND") auraFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") auraFrame.icon:SetAllPoints(auraFrame) + auraFrame.icon.masked = true auraFrame.icon.overlay = auraFrame.cooldownFrame:CreateTexture(nil, "OVERLAY") auraFrame.icon.overlay:SetAllPoints(auraFrame) @@ -174,6 +177,7 @@ function Auras:CreateInterrupt(unit) interruptFrame.icon = interruptFrame.frame:CreateTexture(nil, "BACKGROUND") interruptFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") interruptFrame.icon:SetAllPoints(interruptFrame.frame) + interruptFrame.icon.masked = true interruptFrame.icon.overlay = interruptFrame.cooldownFrame:CreateTexture(nil, "OVERLAY") interruptFrame.icon.overlay:SetAllPoints(interruptFrame.frame) @@ -287,6 +291,8 @@ function Auras:UpdateFrame(unit) end end + local testAgain = false + auraFrame:SetWidth(width) auraFrame:SetHeight(height) auraFrame.frame:SetWidth(height) @@ -296,8 +302,13 @@ function Auras:UpdateFrame(unit) auraFrame.cooldown:ClearAllPoints() auraFrame.cooldown:SetPoint("CENTER", auraFrame, "CENTER") - auraFrame.cooldown:SetWidth(width - width/16) - auraFrame.cooldown:SetHeight(height - height/16) + if Gladdy.db.auraIconZoomed then + auraFrame.cooldown:SetWidth(width) + auraFrame.cooldown:SetHeight(height) + else + auraFrame.cooldown:SetWidth(width - width/16) + auraFrame.cooldown:SetHeight(height - height/16) + end auraFrame.cooldown:SetAlpha(Gladdy.db.auraCooldownAlpha) auraFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE") @@ -317,7 +328,31 @@ function Auras:UpdateFrame(unit) if Gladdy.db.auraDisableCircle then auraFrame.cooldown:SetAlpha(0) end - self:UpdateInterruptFrame(unit) + + if Gladdy.db.auraIconZoomed then + if auraFrame.icon.masked then + auraFrame.icon:SetMask(nil) + auraFrame.icon:SetTexCoord(0.1,0.9,0.1,0.9) + auraFrame.icon.masked = nil + end + else + if not auraFrame.icon.masked then + auraFrame.icon:SetMask(nil) + auraFrame.icon:SetTexCoord(0,1,0,1) + auraFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + auraFrame.icon.masked = true + if Gladdy.frame.testing then + testAgain = true + end + end + end + + testAgain = testAgain or self:UpdateInterruptFrame(unit) + + if testAgain then + Auras:ResetUnit(unit) + Auras:Test(unit) + end end function Auras:UpdateInterruptFrame(unit) @@ -405,6 +440,8 @@ function Auras:UpdateInterruptFrame(unit) end end + local testAgain = false + interruptFrame:SetWidth(width) interruptFrame:SetHeight(height) interruptFrame.frame:SetWidth(width) @@ -414,8 +451,14 @@ function Auras:UpdateInterruptFrame(unit) interruptFrame.cooldown:ClearAllPoints() interruptFrame.cooldown:SetPoint("CENTER", interruptFrame, "CENTER") - interruptFrame.cooldown:SetWidth(width - width/16) - interruptFrame.cooldown:SetHeight(height - height/16) + if Gladdy.db.auraInterruptIconZoomed then + interruptFrame.cooldown:SetWidth(width) + interruptFrame.cooldown:SetHeight(height) + + else + interruptFrame.cooldown:SetWidth(width - width/16) + interruptFrame.cooldown:SetHeight(height - height/16) + end interruptFrame.cooldown:SetAlpha(Gladdy.db.auraCooldownAlpha) interruptFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE") @@ -433,6 +476,25 @@ function Auras:UpdateInterruptFrame(unit) if Gladdy.db.auraDisableCircle then interruptFrame.cooldown:SetAlpha(0) end + + if Gladdy.db.auraInterruptIconZoomed then + if interruptFrame.icon.masked then + interruptFrame.icon:SetMask(nil) + interruptFrame.icon:SetTexCoord(0.1,0.9,0.1,0.9) + interruptFrame.icon.masked = nil + end + else + if not interruptFrame.icon.masked then + interruptFrame.icon:SetMask(nil) + interruptFrame.icon:SetTexCoord(0,1,0,1) + interruptFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + interruptFrame.icon.masked = true + if Gladdy.frame.testing then + testAgain = true + end + end + end + return testAgain end function Auras:ResetUnit(unit) @@ -792,6 +854,21 @@ function Auras:GetOptions() order = 2, width = "full" }), + headerIcon = { + type = "header", + name = L["Icon"], + order = 5, + }, + auraIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + disabled = function() + return not Gladdy.db.auraDetached + end, + order = 6, + width = "full", + }), headerAuraSize = { type = "header", name = L["Size"], @@ -896,6 +973,21 @@ function Auras:GetOptions() order = 2, width = "full" }), + headerIcon = { + type = "header", + name = L["Icon"], + order = 5, + }, + auraInterruptIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + disabled = function() + return not Gladdy.db.auraInterruptDetached + end, + order = 6, + width = "full", + }), headerAuraSize = { type = "header", name = L["Size"], @@ -984,10 +1076,29 @@ function Auras:GetOptions() }), } }, + icon = { + type = "group", + name = L["Icon"], + order = 1, + args = { + headerIcon = { + type = "header", + name = L["Icon"], + order = 1, + }, + auraIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + order = 2, + width = "full", + }), + }, + }, cooldown = { type = "group", name = L["Cooldown"], - order = 1, + order = 2, args = { headerAuras = { type = "header", @@ -1030,7 +1141,7 @@ function Auras:GetOptions() font = { type = "group", name = L["Font"], - order = 2, + order = 3, args = { headerAuras = { type = "header", @@ -1067,7 +1178,7 @@ function Auras:GetOptions() border = { type = "group", name = L["Border"], - order = 3, + order = 4, args = borderArgs } } diff --git a/Modules/BuffsDebuffs.lua b/Modules/BuffsDebuffs.lua index bf32761..7ee6233 100644 --- a/Modules/BuffsDebuffs.lua +++ b/Modules/BuffsDebuffs.lua @@ -20,10 +20,12 @@ local BuffsDebuffs = Gladdy:NewModule("Buffs and Debuffs", nil, { buffsAlpha = 1, buffsIconSize = 30, buffsWidthFactor = 1, + buffsIconZoomed = false, buffsIconPadding = 1, buffsBuffsAlpha = 1, buffsBuffsIconSize = 30, buffsBuffsWidthFactor = 1, + buffsBuffsIconZoomed = false, buffsBuffsIconPadding = 1, buffsDisableCircle = false, buffsCooldownAlpha = 1, @@ -289,6 +291,31 @@ local function styleIcon(aura, auraType) aura.cooldowncircle:SetAlpha(Gladdy.db.buffsCooldownAlpha) end + local zoomedOption, testAgain + if auraType == AURA_TYPE_BUFF then + zoomedOption = Gladdy.db.buffsBuffsIconZoomed + else + zoomedOption = Gladdy.db.buffsIconZoomed + end + + if zoomedOption then + if aura.texture.masked then + aura.texture:SetMask(nil) + aura.texture:SetTexCoord(0.1,0.9,0.1,0.9) + aura.texture.masked = nil + end + else + if not aura.texture.masked then + aura.texture:SetMask(nil) + aura.texture:SetTexCoord(0,1,0,1) + aura.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + aura.texture.masked = true + if Gladdy.frame.testing then + testAgain = true + end + end + end + aura:SetFrameStrata(Gladdy.db.buffFrameStrata) aura:SetFrameLevel(Gladdy.db.buffsFrameLevel) aura.cooldowncircle:SetFrameLevel(Gladdy.db.buffsFrameLevel + 1) @@ -300,6 +327,8 @@ local function styleIcon(aura, auraType) 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, 1) + + return testAgain end function BuffsDebuffs:UpdateFrameOnce() @@ -339,16 +368,23 @@ function BuffsDebuffs:UpdateFrame(unit) 0, 0, "buffsEnabled") end + local testBuffsAgain, testDebuffsAgain + for i=1, #self.frames[unit].auras[AURA_TYPE_BUFF] do - styleIcon(self.frames[unit].auras[AURA_TYPE_BUFF][i], AURA_TYPE_BUFF) + testBuffsAgain = styleIcon(self.frames[unit].auras[AURA_TYPE_BUFF][i], AURA_TYPE_BUFF) end for i=1, #self.frames[unit].auras[AURA_TYPE_DEBUFF] do - styleIcon(self.frames[unit].auras[AURA_TYPE_DEBUFF][i], AURA_TYPE_DEBUFF) + testDebuffsAgain = styleIcon(self.frames[unit].auras[AURA_TYPE_DEBUFF][i], AURA_TYPE_DEBUFF) end for i=1, #self.framePool do styleIcon(self.framePool[i]) end self:UpdateAurasOnUnit(unit) + + if Gladdy.frame.testing and (testBuffsAgain or testDebuffsAgain) then + self:ResetUnit(unit) + self:Test(unit) + end end --------------------------- @@ -418,6 +454,7 @@ function BuffsDebuffs:AddAura(unit, spellID, auraType, duration, timeLeft, stack if not self.frames[unit].auras[auraType][index] then if #self.framePool > 0 then aura = tremove(self.framePool, #self.framePool) + styleIcon(aura) else aura = CreateFrame("Frame") aura:EnableMouse(false) @@ -425,6 +462,7 @@ function BuffsDebuffs:AddAura(unit, spellID, auraType, duration, timeLeft, stack aura:SetFrameLevel(Gladdy.db.buffsFrameLevel) aura.texture = aura:CreateTexture(nil, "BACKGROUND") aura.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + aura.texture.masked = true aura.texture:SetAllPoints(aura) aura.cooldowncircle = CreateFrame("Cooldown", nil, aura, "CooldownFrameTemplate") aura.cooldowncircle:SetFrameLevel(Gladdy.db.buffsFrameLevel + 1) @@ -529,14 +567,21 @@ function BuffsDebuffs:GetOptions() args = { size = { type = "group", - name = L["Size & Padding"], + name = L["Icon"], order = 1, args = { header = { type = "header", - name = L["Size & Padding"], - order = 5, + name = L["Icon"], + order = 1, }, + buffsBuffsIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + order = 2, + width = "full", + }), buffsBuffsIconSize = Gladdy:option({ type = "range", name = L["Icon Size"], @@ -639,14 +684,21 @@ function BuffsDebuffs:GetOptions() args = { size = { type = "group", - name = L["Size & Padding"], + name = L["Icon"], order = 1, args = { header = { type = "header", - name = L["Size & Padding"], - order = 5, + name = L["Icon"], + order = 1, }, + buffsIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + order = 2, + width = "full", + }), buffsIconSize = Gladdy:option({ type = "range", name = L["Icon Size"], diff --git a/Modules/Castbar.lua b/Modules/Castbar.lua index f5b2fdf..0077471 100644 --- a/Modules/Castbar.lua +++ b/Modules/Castbar.lua @@ -23,6 +23,7 @@ local Castbar = Gladdy:NewModule("Cast Bar", 70, { castBarHeight = 20, castBarWidth = 160, castBarIconSize = 22, + castBarIconZoomed = false, castBarBorderSize = 8, castBarFontSize = 12, castBarFontOutline = false, @@ -104,6 +105,7 @@ function Castbar:CreateFrame(unit) castBar.icon.texture = castBar.icon:CreateTexture(nil, "BACKGROUND") castBar.icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") castBar.icon.texture:SetAllPoints(castBar.icon) + castBar.icon.texture.masked = true castBar.icon.texture.overlay = castBar.icon:CreateTexture(nil, "BORDER") castBar.icon.texture.overlay:SetAllPoints(castBar.icon.texture) castBar.icon.texture.overlay:SetTexture(Gladdy.db.castBarIconStyle) @@ -157,6 +159,8 @@ function Castbar:UpdateFrame(unit) return end + local testAgain = false + castBar:SetFrameStrata(Gladdy.db.castBarFrameStrata) castBar:SetFrameLevel(Gladdy.db.castBarFrameLevel) castBar.backdrop:SetFrameStrata(Gladdy.db.castBarFrameStrata) @@ -191,12 +195,24 @@ function Castbar:UpdateFrame(unit) castBar.icon:SetWidth(Gladdy.db.castBarIconSize) castBar.icon:SetHeight(Gladdy.db.castBarIconSize) castBar.icon.texture:SetAllPoints(castBar.icon) - castBar.icon:ClearAllPoints() - if Gladdy.db.castBarIconEnabled then - castBar.icon:Show() + if Gladdy.db.castBarIconZoomed then + if castBar.icon.texture.masked then + castBar.icon.texture:SetMask(nil) + castBar.icon.texture:SetTexCoord(0.1,0.9,0.1,0.9) + castBar.icon.texture.masked = nil + end else - castBar.icon:Hide() + if not castBar.icon.texture.masked then + castBar.icon.texture:SetMask(nil) + castBar.icon.texture:SetTexCoord(0,1,0,1) + castBar.icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + castBar.icon.texture.masked = true + if Gladdy.frame.testing then + testAgain = true + end + end end + castBar.icon:ClearAllPoints() castBar.shield:SetWidth(Gladdy.db.castBarIconSize * 3.2) castBar.shield:SetHeight(Gladdy.db.castBarIconSize * 3.2) @@ -230,6 +246,16 @@ function Castbar:UpdateFrame(unit) if not Gladdy.db.castBarEnabled then self:CAST_STOP(unit) end + + if Gladdy.db.castBarIconEnabled then + castBar.icon:Show() + if testAgain then + self:ResetUnit(unit) + self:Test(unit) + end + else + castBar.icon:Hide() + end end --------------------------- @@ -712,7 +738,7 @@ function Castbar:GetOptions() args = { headerSize = { type = "header", - name = L["Icon Size"], + name = L["Icon"], order = 1, }, castBarIconEnabled = option({ @@ -721,6 +747,13 @@ function Castbar:GetOptions() order = 2, width = "full", }), + castBarIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + order = 3, + width = "full", + }), castBarIconSize = option({ type = "range", name = L["Icon size"], diff --git a/Modules/Classicon.lua b/Modules/Classicon.lua index cdf6d4b..72f8046 100644 --- a/Modules/Classicon.lua +++ b/Modules/Classicon.lua @@ -8,6 +8,7 @@ local Classicon = Gladdy:NewModule("Class Icon", 81, { classIconEnabled = true, classIconSize = 60 + 20 + 1, classIconWidthFactor = 0.9, + classIconZoomed = false, classIconBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp", classIconBorderColor = { r = 0, g = 0, b = 0, a = 1 }, classIconSpecIcon = false, @@ -115,6 +116,7 @@ function Classicon:CreateFrame(unit) classIcon.texture = classIcon:CreateTexture(nil, "BACKGROUND") classIcon.texture:SetAllPoints(classIcon) classIcon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + classIcon.texture.masked = true classIcon.texture.overlay = classIcon:CreateTexture(nil, "BORDER") classIcon.texture.overlay:SetAllPoints(classIcon) @@ -133,12 +135,32 @@ function Classicon:UpdateFrame(unit) return end + local testAgain = false + classIcon:SetFrameStrata(Gladdy.db.classIconFrameStrata) classIcon:SetFrameLevel(Gladdy.db.classIconFrameLevel) classIcon:SetWidth(Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) classIcon:SetHeight(Gladdy.db.classIconSize) + if Gladdy.db.classIconZoomed then + if classIcon.texture.masked then + classIcon.texture:SetMask(nil) + classIcon.texture:SetTexCoord(0.1,0.9,0.1,0.9) + classIcon.texture.masked = nil + end + else + if not classIcon.texture.masked then + classIcon.texture:SetMask(nil) + classIcon.texture:SetTexCoord(0,1,0,1) + classIcon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + classIcon.texture.masked = true + if Gladdy.frame.testing then + testAgain = true + end + end + end + Gladdy:SetPosition(classIcon, unit, "classIconXOffset", "classIconYOffset", Classicon:LegacySetPosition(classIcon, unit), Classicon) if (Gladdy.db.classIconGroup) then @@ -173,6 +195,10 @@ function Classicon:UpdateFrame(unit) classIcon.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.classIconBorderColor)) if Gladdy.db.classIconEnabled then classIcon:Show() + if testAgain then + Classicon:ResetUnit(unit) + Classicon:ENEMY_SPOTTED(unit) + end else classIcon:Hide() end @@ -267,17 +293,24 @@ function Classicon:GetOptions() args = { size = { type = "group", - name = L["Icon size"], + name = L["Icon"], order = 1, args = { header = { type = "header", - name = L["Icon size"], + name = L["Icon"], order = 1, }, + classIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + order = 2, + width = "full", + }), classIconSize = Gladdy:option({ type = "range", - name = L["Icon size"], + name = L["Size"], min = 3, max = 100, step = .1, diff --git a/Modules/Cooldowns.lua b/Modules/Cooldowns.lua index d0c80e0..21de6ab 100644 --- a/Modules/Cooldowns.lua +++ b/Modules/Cooldowns.lua @@ -58,6 +58,10 @@ local Cooldowns = Gladdy:NewModule("Cooldowns", nil, { cooldownYOffset = 0, cooldownXOffset = 0, cooldownSize = 30, + cooldownIconGlow = true, + cooldownIconZoomed = false, + cooldownIconDesaturateOnCooldown = false, + cooldownIconAlphaOnCooldown = 1, cooldownWidthFactor = 1, cooldownIconPadding = 1, cooldownMaxIconsPerLine = 10, @@ -126,6 +130,7 @@ function Cooldowns:CreateIcon() -- returns iconFrame icon.texture = icon:CreateTexture(nil, "BACKGROUND") icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + icon.texture.masked = true icon.texture:SetAllPoints(icon) icon.cooldown = CreateFrame("Cooldown", nil, icon, "CooldownFrameTemplate") @@ -161,8 +166,13 @@ function Cooldowns:UpdateIcon(icon) icon.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), Gladdy.db.cooldownSize / 2 * Gladdy.db.cooldownFontScale, "OUTLINE") icon.cooldownFont:SetTextColor(Gladdy:SetColor(Gladdy.db.cooldownFontColor)) - icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16) - icon.cooldown:SetHeight(icon:GetHeight() - icon:GetHeight()/16) + if Gladdy.db.cooldownIconZoomed then + icon.cooldown:SetWidth(icon:GetWidth()) + icon.cooldown:SetHeight(icon:GetHeight()) + else + icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16) + icon.cooldown:SetHeight(icon:GetHeight() - icon:GetHeight()/16) + end icon.cooldown:ClearAllPoints() icon.cooldown:SetPoint("CENTER", icon, "CENTER") icon.cooldown:SetAlpha(Gladdy.db.cooldownCooldownAlpha) @@ -172,6 +182,31 @@ function Cooldowns:UpdateIcon(icon) icon.border:SetTexture(Gladdy.db.cooldownBorderStyle) icon.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.cooldownBorderColor)) + + if Gladdy.db.cooldownIconZoomed then + if icon.texture.masked then + icon.texture:SetMask(nil) + icon.texture:SetTexCoord(0.1,0.9,0.1,0.9) + icon.texture.masked = nil + end + else + if not icon.texture.masked then + icon.texture:SetMask(nil) + icon.texture:SetTexCoord(0,1,0,1) + icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + icon.texture.masked = true + end + end + if Gladdy.db.cooldownIconDesaturateOnCooldown and icon.active then + icon.texture:SetDesaturated(true) + else + icon.texture:SetDesaturated(false) + end + if Gladdy.db.cooldownIconAlphaOnCooldown < 1 and icon.active then + icon.texture:SetAlpha(Gladdy.db.cooldownIconAlphaOnCooldown) + else + icon.texture:SetAlpha(1) + end end function Cooldowns:IconsSetPoint(button) @@ -224,6 +259,7 @@ end function Cooldowns:UpdateFrame(unit) local button = Gladdy.buttons[unit] -- Cooldown frame + local testAgain = false if (Gladdy.db.cooldown) then button.spellCooldownFrame:SetHeight(Gladdy.db.cooldownSize) button.spellCooldownFrame:SetWidth(1) @@ -249,13 +285,25 @@ function Cooldowns:UpdateFrame(unit) -- Update each cooldown icon for _,icon in pairs(button.spellCooldownFrame.icons) do + testAgain = icon.texture.masked self:UpdateIcon(icon) + if icon.texture.masked ~= testAgain then + testAgain = true + else + testAgain = false + end end self:IconsSetPoint(button) button.spellCooldownFrame:Show() else button.spellCooldownFrame:Hide() end + if testAgain and Gladdy.frame.testing then + Cooldowns:ResetUnit(unit) + Cooldowns:ENEMY_SPOTTED(unit) + Cooldowns:UNIT_SPEC(unit) + Cooldowns:Test(unit) + end end function Cooldowns:ResetUnit(unit) @@ -398,6 +446,13 @@ function Cooldowns:CooldownStart(button, spellId, duration, start) icon.active = true icon.timeLeft = start and start - GetTime() + duration or duration if (not Gladdy.db.cooldownDisableCircle) then icon.cooldown:SetCooldown(start or GetTime(), duration) end + if Gladdy.db.cooldownIconDesaturateOnCooldown then + icon.texture:SetDesaturated(true) + end + if Gladdy.db.cooldownIconAlphaOnCooldown < 1 then + icon.texture:SetAlpha(Gladdy.db.cooldownIconAlphaOnCooldown) + end + --if math.random(1, 30 ) > 10 then LCG.ButtonGlow_Start(icon, nil, 0.15) end icon:SetScript("OnUpdate", function(self, elapsed) self.timeLeft = self.timeLeft - elapsed local timeLeft = ceil(self.timeLeft) @@ -421,21 +476,29 @@ function Cooldowns:CooldownStart(button, spellId, duration, start) end end +local function resetIcon(icon) + if Gladdy.db.cooldownIconDesaturateOnCooldown then + icon.texture:SetDesaturated(false) + end + if Gladdy.db.cooldownIconAlphaOnCooldown < 1 then + icon.texture:SetAlpha(1) + end + icon.active = false + icon.cooldown:Hide() + icon.cooldownFont:SetText("") + icon:SetScript("OnUpdate", nil) + --LCG.ButtonGlow_Stop(icon) +end + function Cooldowns:CooldownReady(button, spellId, frame) if (frame == false) then for _,icon in pairs(button.spellCooldownFrame.icons) do if (icon.spellId == spellId) then - icon.active = false - icon.cooldown:Hide() - icon.cooldownFont:SetText("") - icon:SetScript("OnUpdate", nil) + resetIcon(icon) end end else - frame.active = false - frame.cooldown:Hide() - frame.cooldownFont:SetText("") - frame:SetScript("OnUpdate", nil) + resetIcon(frame) end end @@ -612,6 +675,13 @@ function Cooldowns:GetOptions() name = L["Icon"], order = 2, }, + cooldownIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + order = 4, + width = "full", + }), cooldownSize = Gladdy:option({ type = "range", name = L["Cooldown size"], @@ -653,6 +723,35 @@ function Cooldowns:GetOptions() name = L["Cooldown"], order = 2, }, + cooldownIconGlow = Gladdy:option({ + type = "toggle", + name = L["Glow Icon"], + desc = L["Glow the icon when cooldown active"], + order = 3, + width = "full", + }), + cooldownIconDesaturateOnCooldown = Gladdy:option({ + type = "toggle", + name = L["Desaturate Icon"], + order = 4, + width = "full", + }), + cooldownIconAlphaOnCooldown = Gladdy:option({ + type = "range", + name = L["Cooldown alpha on CD"], + desc = L["Alpha of the icon when cooldown active"], + desc = L["changes "], + order = 5, + min = 0, + max = 1, + step = 0.1, + width = "full", + }), + headerCircle = { + type = "header", + name = L["Cooldowncircle"], + order = 6, + }, cooldownDisableCircle = Gladdy:option({ type = "toggle", name = L["No Cooldown Circle"], diff --git a/Modules/Diminishings.lua b/Modules/Diminishings.lua index 4e8b941..b47ff3c 100644 --- a/Modules/Diminishings.lua +++ b/Modules/Diminishings.lua @@ -37,6 +37,7 @@ local Diminishings = Gladdy:NewModule("Diminishings", nil, { drXOffset = 0, drYOffset = 0, drIconSize = 36, + drIconZoomed = false, drEnabled = true, drBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_Gloss", drBorderColor = { r = 1, g = 1, b = 1, a = 1 }, @@ -102,6 +103,7 @@ function Diminishings:CreateFrame(unit) icon:SetFrameLevel(Gladdy.db.drFrameLevel) icon.texture = icon:CreateTexture(nil, "BACKGROUND") icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + icon.texture.masked = true icon.texture:SetAllPoints(icon) icon:SetScript("OnUpdate", function(self, elapsed) if (self.running) then @@ -215,6 +217,7 @@ function Diminishings:UpdateFrame(unit) 0, "drEnabled") end + local testAgain = false for i = 1, 16 do local icon = drFrame["icon" .. i] @@ -242,8 +245,13 @@ function Diminishings:UpdateFrame(unit) icon.drLevelText:SetTextColor(Gladdy:SetColor(Gladdy.db.drLevelTextColor)) end - icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16) - icon.cooldown:SetHeight(icon:GetHeight() - icon:GetHeight()/16) + if Gladdy.db.drIconZoomed then + icon.cooldown:SetWidth(icon:GetWidth()) + icon.cooldown:SetHeight(icon:GetHeight()) + else + icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16) + icon.cooldown:SetHeight(icon:GetHeight() - icon:GetHeight()/16) + end icon.cooldown:ClearAllPoints() icon.cooldown:SetPoint("CENTER", icon, "CENTER") if Gladdy.db.drDisableCircle then @@ -285,9 +293,27 @@ function Diminishings:UpdateFrame(unit) icon.border:SetTexture(Gladdy.db.drBorderStyle) end - --icon.texture:SetTexCoord(.1, .9, .1, .9) - --icon.texture:SetPoint("TOPLEFT", icon, "TOPLEFT", 2, -2) - --icon.texture:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", -2, 2) + if Gladdy.db.drIconZoomed then + if icon.texture.masked then + icon.texture:SetMask(nil) + icon.texture:SetTexCoord(0.1,0.9,0.1,0.9) + icon.texture.masked = nil + end + else + if not icon.texture.masked then + icon.texture:SetMask(nil) + icon.texture:SetTexCoord(0,1,0,1) + icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + icon.texture.masked = true + if Gladdy.frame.testing then + testAgain = true + end + end + end + end + if testAgain then + Diminishings:ResetUnit(unit) + Diminishings:Test(unit) end end @@ -574,11 +600,18 @@ function Diminishings:GetOptions() name = L["Icon"], order = 4, }, + drIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + order = 5, + width = "full", + }), drIconSize = Gladdy:option({ type = "range", name = L["Icon Size"], desc = L["Size of the DR Icons"], - order = 5, + order = 6, min = 5, max = 80, step = 1, @@ -588,7 +621,7 @@ function Diminishings:GetOptions() type = "range", name = L["Icon Width Factor"], desc = L["Stretches the icon"], - order = 6, + order = 7, min = 0.5, max = 2, step = 0.05, @@ -598,7 +631,7 @@ function Diminishings:GetOptions() type = "range", name = L["Icon Padding"], desc = L["Space between Icons"], - order = 7, + order = 8, min = 0, max = 10, step = 0.1, diff --git a/Modules/Racial.lua b/Modules/Racial.lua index 65f0cd0..570d97e 100644 --- a/Modules/Racial.lua +++ b/Modules/Racial.lua @@ -11,6 +11,7 @@ local Racial = Gladdy:NewModule("Racial", 79, { racialEnabled = true, racialSize = 60 + 20 + 1, racialWidthFactor = 0.9, + racialIconZoomed = false, racialXOffset = 0, racialYOffset = 0, racialBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp", @@ -91,6 +92,7 @@ function Racial:CreateFrame(unit) racial.texture = racial:CreateTexture(nil, "BACKGROUND") racial.texture:SetAllPoints(racial) racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + racial.texture.masked = true --racial.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02") racial.cooldown = CreateFrame("Cooldown", nil, racial, "CooldownFrameTemplate") @@ -133,6 +135,7 @@ function Racial:UpdateFrame(unit) return end + local testAgain = false local width, height = Gladdy.db.racialSize * Gladdy.db.racialWidthFactor, Gladdy.db.racialSize racial:SetFrameStrata(Gladdy.db.racialFrameStrata) @@ -146,8 +149,13 @@ function Racial:UpdateFrame(unit) racial:SetWidth(width) racial:SetHeight(height) - racial.cooldown:SetWidth(width - width/16) - racial.cooldown:SetHeight(height - height/16) + if Gladdy.db.racialIconZoomed then + racial.cooldown:SetWidth(width) + racial.cooldown:SetHeight(height) + else + racial.cooldown:SetWidth(width - width/16) + racial.cooldown:SetHeight(height - height/16) + end racial.cooldown:ClearAllPoints() racial.cooldown:SetPoint("CENTER", racial, "CENTER") racial.cooldown.noCooldownCount = true -- Gladdy.db.racialDisableOmniCC @@ -159,6 +167,24 @@ function Racial:UpdateFrame(unit) racial.texture.overlay:SetTexture(Gladdy.db.racialBorderStyle) racial.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.racialBorderColor)) + if Gladdy.db.racialIconZoomed then + if racial.texture.masked then + racial.texture:SetMask(nil) + racial.texture:SetTexCoord(0.1,0.9,0.1,0.9) + racial.texture.masked = nil + end + else + if not racial.texture.masked then + racial.texture:SetMask(nil) + racial.texture:SetTexCoord(0,1,0,1) + racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + racial.texture.masked = true + if Gladdy.frame.testing then + testAgain = true + end + end + end + Gladdy:SetPosition(racial, unit, "racialXOffset", "racialYOffset", Racial:LegacySetPosition(racial, unit), Racial) if (Gladdy.db.racialGroup) then @@ -189,6 +215,10 @@ function Racial:UpdateFrame(unit) racial:Hide() else racial:Show() + if testAgain then + Racial:ResetUnit(unit) + Racial:Test(unit) + end end end @@ -311,21 +341,28 @@ function Racial:GetOptions() args = { general = { type = "group", - name = L["Size"], + name = L["Icon"], order = 1, args = { header = { type = "header", - name = L["Size"], + name = L["Icon"], order = 1, }, + racialIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + order = 2, + width = "full", + }), racialSize = Gladdy:option({ type = "range", name = L["Icon size"], min = 5, max = 100, step = 1, - order = 2, + order = 3, width = "full", }), racialWidthFactor = Gladdy:option({ @@ -334,7 +371,7 @@ function Racial:GetOptions() min = 0.5, max = 2, step = 0.05, - order = 3, + order = 4, width = "full", }), }, diff --git a/Modules/Trinket.lua b/Modules/Trinket.lua index b575057..147d0ce 100644 --- a/Modules/Trinket.lua +++ b/Modules/Trinket.lua @@ -13,6 +13,7 @@ local Trinket = Gladdy:NewModule("Trinket", 80, { trinketEnabled = true, trinketSize = 60 + 20 + 1, trinketWidthFactor = 0.9, + trinketIconZoomed = false, trinketBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp", trinketBorderColor = { r = 0, g = 0, b = 0, a = 1 }, trinketDisableCircle = false, @@ -101,6 +102,7 @@ function Trinket:CreateFrame(unit) trinket.texture:SetAllPoints(trinket) trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02") trinket.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + trinket.texture.masked = true trinket.cooldown = CreateFrame("Cooldown", nil, trinket, "CooldownFrameTemplate") trinket.cooldown.noCooldownCount = true --Gladdy.db.trinketDisableOmniCC @@ -144,17 +146,7 @@ function Trinket:UpdateFrame(unit) return end - if Gladdy.db.trinketColored then - if trinket.active then - trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd)) - else - trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredNoCd)) - end - trinket.texture:SetTexture() - else - trinket:SetBackdropColor(0,0,0,0) - trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02") - end + local testAgain = false local width, height = Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor, Gladdy.db.trinketSize @@ -169,8 +161,14 @@ function Trinket:UpdateFrame(unit) trinket:SetWidth(width) trinket:SetHeight(height) - trinket.cooldown:SetWidth(width - width/16) - trinket.cooldown:SetHeight(height - height/16) + if Gladdy.db.trinketIconZoomed then + trinket.cooldown:SetWidth(width) + trinket.cooldown:SetHeight(height) + + else + trinket.cooldown:SetWidth(width - width/16) + trinket.cooldown:SetHeight(height - height/16) + end trinket.cooldown:ClearAllPoints() trinket.cooldown:SetPoint("CENTER", trinket, "CENTER") trinket.cooldown.noCooldownCount = true -- Gladdy.db.trinketDisableOmniCC @@ -182,6 +180,36 @@ function Trinket:UpdateFrame(unit) trinket.texture.overlay:SetTexture(Gladdy.db.trinketBorderStyle) trinket.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.trinketBorderColor)) + if Gladdy.db.trinketIconZoomed then + if trinket.texture.masked then + trinket.texture:SetMask(nil) + trinket.texture:SetTexCoord(0.1,0.9,0.1,0.9) + trinket.texture.masked = nil + end + else + if not trinket.texture.masked then + trinket.texture:SetMask(nil) + trinket.texture:SetTexCoord(0,1,0,1) + trinket.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") + trinket.texture.masked = true + if Gladdy.frame.testing then + testAgain = true + end + end + end + + if Gladdy.db.trinketColored then + if trinket.active then + trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd)) + else + trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredNoCd)) + end + trinket.texture:SetTexture() + else + trinket:SetBackdropColor(0,0,0,0) + trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02") + end + Gladdy:SetPosition(trinket, unit, "trinketXOffset", "trinketYOffset", Trinket:LegacySetPosition(trinket, unit), Trinket) if (Gladdy.db.trinketGroup) then @@ -221,6 +249,10 @@ function Trinket:UpdateFrame(unit) trinket:Hide() else trinket:Show() + if testAgain then + Trinket:ResetUnit(unit) + Trinket:Test(unit) + end end end @@ -393,14 +425,21 @@ function Trinket:GetOptions() args = { general = { type = "group", - name = L["Size"], + name = L["Icon"], order = 1, args = { header = { type = "header", - name = L["Size"], + name = L["Icon"], order = 1, }, + trinketIconZoomed = Gladdy:option({ + type = "toggle", + name = L["Zoomed Icon"], + desc = L["Zoomes the icon to remove borders"], + order = 2, + width = "full", + }), trinketSize = Gladdy:option({ type = "range", name = L["Size"],