From 5eb2284086313e612421ba9fe733d393ceb60316 Mon Sep 17 00:00:00 2001 From: Jeremy Cortes Date: Mon, 22 Feb 2021 22:12:59 +0100 Subject: [PATCH 1/7] Fix error stop glowing try access ppl that leave after dying --- Gladius/Gladius.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/Gladius/Gladius.lua b/Gladius/Gladius.lua index f61451a..b1ee67c 100644 --- a/Gladius/Gladius.lua +++ b/Gladius/Gladius.lua @@ -929,6 +929,7 @@ function Gladius:StopCooldownGlow(unit, spellId, auraType) if (db.cooldownList[spellId] == false and auraType == 'BUFF') then return end for i=1,(button.lastCooldownSpell or 14) do + if (button.spellCooldownFrame["icon" .. i] == nil) then return end if (button.spellCooldownFrame["icon" .. i].spellId == spellId) then local frame = button.spellCooldownFrame["icon" .. i] frame.glowActive = false From 4545f11729d8f460b6c7af2a23dab7b163b7c57d Mon Sep 17 00:00:00 2001 From: Jeremy Cortes Date: Mon, 22 Feb 2021 22:44:16 +0100 Subject: [PATCH 2/7] fix error returned after dead leave arena before end match --- Gladius/Gladius.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gladius/Gladius.lua b/Gladius/Gladius.lua index b1ee67c..1a333ef 100644 --- a/Gladius/Gladius.lua +++ b/Gladius/Gladius.lua @@ -906,7 +906,7 @@ function Gladius:StartCooldownGlow(unit, spellId, auraType) if (db.cooldownList[spellId] == false and auraType == 'DEBUFF') then return end for i=1,(button.lastCooldownSpell or 14) do -- button.lastCooldownSpell return a number that match max number of detected talent cooldown - if (button.spellCooldownFrame["icon" .. i] == nil) then return end + if (button.spellCooldownFrame["icon" .. i].spellId == nil) then return end if (button.spellCooldownFrame["icon" .. i].spellId == spellId) then local frame = button.spellCooldownFrame["icon" .. i] frame.glowActive = true @@ -929,7 +929,7 @@ function Gladius:StopCooldownGlow(unit, spellId, auraType) if (db.cooldownList[spellId] == false and auraType == 'BUFF') then return end for i=1,(button.lastCooldownSpell or 14) do - if (button.spellCooldownFrame["icon" .. i] == nil) then return end + if (button.spellCooldownFrame["icon" .. i].spellId == nil) then return end if (button.spellCooldownFrame["icon" .. i].spellId == spellId) then local frame = button.spellCooldownFrame["icon" .. i] frame.glowActive = false From 8a308aaa4d1e54a8ce114234c9f5dc3eed9d9d76 Mon Sep 17 00:00:00 2001 From: Cortes-Jeremy <56119078+Cortes-Jeremy@users.noreply.github.com> Date: Wed, 24 Feb 2021 17:43:18 +0100 Subject: [PATCH 3/7] It seems to fix the case when ppl leave arena and gladius try to stop a glowing cooldowns --- Gladius/Gladius.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gladius/Gladius.lua b/Gladius/Gladius.lua index 1a333ef..5aa09f6 100644 --- a/Gladius/Gladius.lua +++ b/Gladius/Gladius.lua @@ -906,7 +906,7 @@ function Gladius:StartCooldownGlow(unit, spellId, auraType) if (db.cooldownList[spellId] == false and auraType == 'DEBUFF') then return end for i=1,(button.lastCooldownSpell or 14) do -- button.lastCooldownSpell return a number that match max number of detected talent cooldown - if (button.spellCooldownFrame["icon" .. i].spellId == nil) then return end + if (button.spellCooldownFrame == nil) then return end if (button.spellCooldownFrame["icon" .. i].spellId == spellId) then local frame = button.spellCooldownFrame["icon" .. i] frame.glowActive = true @@ -929,7 +929,7 @@ function Gladius:StopCooldownGlow(unit, spellId, auraType) if (db.cooldownList[spellId] == false and auraType == 'BUFF') then return end for i=1,(button.lastCooldownSpell or 14) do - if (button.spellCooldownFrame["icon" .. i].spellId == nil) then return end + if (button.spellCooldownFrame == nil) then return end if (button.spellCooldownFrame["icon" .. i].spellId == spellId) then local frame = button.spellCooldownFrame["icon" .. i] frame.glowActive = false From 1154af7334342765c68bb6d061415d85cad9a2f4 Mon Sep 17 00:00:00 2001 From: Jeremy Cortes Date: Tue, 2 Mar 2021 12:22:21 +0100 Subject: [PATCH 4/7] cutaway bar (retail like) --- Gladius/Gladius.lua | 43 +++++++++++++++++++++++++++++++++++ Gladius/frame.lua | 30 ++++++++++++++++++++---- Gladius/localization/enUS.lua | 1 + Gladius/options.lua | 6 +++++ 4 files changed, 75 insertions(+), 5 deletions(-) diff --git a/Gladius/Gladius.lua b/Gladius/Gladius.lua index 5aa09f6..9211112 100644 --- a/Gladius/Gladius.lua +++ b/Gladius/Gladius.lua @@ -270,6 +270,45 @@ function Gladius:LeftArena() self.frame:Hide() end +-- Health bar Loss Animation +function Gladius:UpdateCutaway(button, curH, maxH) + + local curHealthNorm = curH / maxH -- normalized (0->1) + + -- First time it run there is no previous value so we pretend max + if not button.cutaway.previousValue then button.cutaway.previousValue = 1 end + -- Not animating for Health Gain + if(button.cutaway.previousValue and button.cutaway.previousValue < curHealthNorm) then + -- Check if old animation is already playing and stop it + if(button.cutaway.anim:IsPlaying()) then + button.cutaway.anim:Stop() + button.cutaway.anim:Hide() + end + button.cutaway.previousValue = curHealthNorm + return + end + + -- RED Health Loss + if(button.cutaway.previousValue and math.abs(curHealthNorm - button.cutaway.previousValue) > 0.001) then + -- Check if old animation is already playing and stop it + if(button.cutaway.anim:IsPlaying()) then + button.cutaway.anim:Stop() + button.cutaway.bar:Hide() + end + -- + local low = curHealthNorm > button.cutaway.previousValue and button.cutaway.previousValue or curHealthNorm + local diff = math.abs(button.cutaway.previousValue - curHealthNorm) + button.cutaway.bar:ClearAllPoints() + button.cutaway.bar:SetPoint("TOPLEFT", button.health, low*button.health:GetWidth(), 0) + button.cutaway.bar:SetWidth(diff*button.health:GetWidth()) + button.cutaway.bar:Show() + button.cutaway.anim:Play() + button.cutaway.anim:SetScript("OnFinished", function() cutaway.bar:Hide() end) + end + button.cutaway.previousValue = curHealthNorm + +end + --Update units health function Gladius:UNIT_HEALTH(event, unit) if (arenaUnits[unit]) then @@ -316,6 +355,10 @@ function Gladius:UNIT_HEALTH(event, unit) button.healthText:SetText(healthText) button.health:SetValue(healthPercent) + if ( db.cutawayBar ) then + Gladius:UpdateCutaway(button, currentHealth, maxHealth) + end + -- display low health announcement if ( db.lowHealthAnnounce and healthPercent <= db.lowHealthPercentage and not button.lowHealth and (not button.healthThrottle or GetTime() > button.healthThrottle) and button.name ) then local text = string.format(L["LOW HEALTH: %s"], button.name) diff --git a/Gladius/frame.lua b/Gladius/frame.lua index 3476820..ec5c0ef 100644 --- a/Gladius/frame.lua +++ b/Gladius/frame.lua @@ -224,6 +224,20 @@ function Gladius:CreateButton(i) healthBar.highlight:SetAllPoints(healthBar) healthBar.highlight:Hide() + -- Health bar loss animation + local cutaway = CreateFrame("Frame", "GladiusCutawayBar"..i, healthBar) + cutaway:SetFrameLevel(healthBar:GetFrameLevel() + 10) + cutaway.bar = cutaway:CreateTexture(nil, "OVERLAY") -- b.BS + cutaway.bar:SetAlpha(1) -- set from alpha + cutaway.bar:Hide() + -- + cutaway.anim = cutaway.bar:CreateAnimationGroup() + cutaway.anim.s1 = cutaway.anim:CreateAnimation("Scale") + cutaway.anim.s1:SetScale(0,1) + cutaway.anim.s1:SetOrigin("LEFT", 0, 0) + cutaway.anim.s1:SetDuration(0.475) + cutaway.anim.s1:SetSmoothing("OUT") + -- AbsorbBar local absorbBar = CreateFrame("Frame", "GladiusAbsorbBar"..i, button) local overAbsorbFrame = CreateFrame("Frame", "GladiusOverAbsorbGlow"..i, healthBar) -- hack to get the glow spark over everything @@ -234,7 +248,6 @@ function Gladius:CreateButton(i) absorbBar.overAbsorbGlow:Hide() -- Total absorb absorbBar.totalAbsorb = absorbBar:CreateTexture(nil, "BORDER", nil, 0) - absorbBar.totalAbsorb:SetTexture([[Interface\AddOns\Gladius\media\RaidFrame\Shield-Fill]]) absorbBar.totalAbsorb:Hide() -- Total absorb overlay absorbBar.totalAbsorbOverlay = absorbBar:CreateTexture(nil, "BORDER", nil, 1) @@ -452,6 +465,7 @@ function Gladius:CreateButton(i) button.mana = manaBar button.health = healthBar + button.cutaway = cutaway button.absorb = absorbBar button.castBar = castBar button.castBar.timeText = castBarTextTime @@ -783,19 +797,25 @@ function Gladius:UpdateFrame() DisableTexTiling(button.health:GetStatusBarTexture()) DisableTexTiling(button.health.bg) + -- Health bar loss animation (textures, size, position) + button.cutaway.bar:SetTexture(LSM:Fetch(LSM.MediaType.STATUSBAR, db.barTexture)) -- same bar as health bar + button.cutaway.bar:SetVertexColor(255/255, 0/255, 0/255, 1) -- texture color + button.cutaway.bar:SetSize(0, button.health:GetHeight()) + -- absorb bar location and size -- OverAbsorb button.absorb.overAbsorbGlow:ClearAllPoints() - button.absorb.overAbsorbGlow:SetPoint("RIGHT", button.health, "RIGHT", 7, 0) - button.absorb.overAbsorbGlow:SetSize(12, button.health:GetHeight() + 4) + button.absorb.overAbsorbGlow:SetPoint("RIGHT", button.health, "RIGHT", 6, 0) + button.absorb.overAbsorbGlow:SetSize(12, button.health:GetHeight()) -- Total absorb button.absorb.totalAbsorb:ClearAllPoints() + button.absorb.totalAbsorb:SetTexture(LSM:Fetch(LSM.MediaType.STATUSBAR, db.barTexture)) -- same bar as health bar button.absorb.totalAbsorb:SetPoint("RIGHT", button.health, "RIGHT") - button.absorb.totalAbsorb:SetSize(15, button.health:GetHeight()) + button.absorb.totalAbsorb:SetSize(button.health:GetSize()*0.5, button.health:GetHeight()) -- Total absorb overlay button.absorb.totalAbsorbOverlay:ClearAllPoints() button.absorb.totalAbsorbOverlay:SetPoint("RIGHT", button.health, "RIGHT") - button.absorb.totalAbsorbOverlay:SetSize(15, button.health:GetHeight()) -- -15 + button.absorb.totalAbsorbOverlay:SetSize(button.health:GetSize()*0.5, button.health:GetHeight()) --mana bar location, size and texture button.mana:ClearAllPoints() diff --git a/Gladius/localization/enUS.lua b/Gladius/localization/enUS.lua index 45a2c2a..2e2b96c 100644 --- a/Gladius/localization/enUS.lua +++ b/Gladius/localization/enUS.lua @@ -119,6 +119,7 @@ L["Font of the aura text"] = "Font of the aura text" L["Cast bar position"] = "Cast bar position" L["Position of the cast bar"] = "Position of the cast bar" L["Show absorb bars"] = "Show absorb bars" +L["Show cutaway bars"] = "Show cutaway bars" L["Show power bars"] = "Show power bars" L["Show class icon"] = "Show class icon" L["Show class icon\nIMPORTANT:\nToggling this off will disable showing auras even if it is enabled"] = "Show class icon\nIMPORTANT:\nToggling this off will disable showing auras even if it is enabled" diff --git a/Gladius/options.lua b/Gladius/options.lua index 02f8939..e4ca86e 100644 --- a/Gladius/options.lua +++ b/Gladius/options.lua @@ -803,6 +803,12 @@ function Gladius:SetupOptions() desc=L["Show absorb bars"], order=16, }, + cutawayBar = { + type="toggle", + name=L["Show cutaway bars"], + desc=L["Show cutaway bars"], + order=17, + }, powerBar = { type="toggle", name=L["Show power bars"], From 835581b2bcc7d2d862f8602efbdc0081b91bb7f7 Mon Sep 17 00:00:00 2001 From: Cortes-Jeremy <56119078+Cortes-Jeremy@users.noreply.github.com> Date: Tue, 2 Mar 2021 17:03:54 +0100 Subject: [PATCH 5/7] Cutaway bar fix 1 --- Gladius/Gladius.lua | 25 ++++++++++++++----------- Gladius/frame.lua | 8 +++++--- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Gladius/Gladius.lua b/Gladius/Gladius.lua index 9211112..62aec7f 100644 --- a/Gladius/Gladius.lua +++ b/Gladius/Gladius.lua @@ -282,7 +282,7 @@ function Gladius:UpdateCutaway(button, curH, maxH) -- Check if old animation is already playing and stop it if(button.cutaway.anim:IsPlaying()) then button.cutaway.anim:Stop() - button.cutaway.anim:Hide() + button.cutaway.bar:Hide() end button.cutaway.previousValue = curHealthNorm return @@ -296,14 +296,15 @@ function Gladius:UpdateCutaway(button, curH, maxH) button.cutaway.bar:Hide() end -- + local marge = 2 local low = curHealthNorm > button.cutaway.previousValue and button.cutaway.previousValue or curHealthNorm local diff = math.abs(button.cutaway.previousValue - curHealthNorm) button.cutaway.bar:ClearAllPoints() - button.cutaway.bar:SetPoint("TOPLEFT", button.health, low*button.health:GetWidth(), 0) + button.cutaway.bar:SetPoint("TOPLEFT", button.health, low*button.health:GetWidth() - marge, 0) button.cutaway.bar:SetWidth(diff*button.health:GetWidth()) button.cutaway.bar:Show() button.cutaway.anim:Play() - button.cutaway.anim:SetScript("OnFinished", function() cutaway.bar:Hide() end) + button.cutaway.anim:SetScript("OnFinished", function() button.cutaway.bar:Hide() end) end button.cutaway.previousValue = curHealthNorm @@ -315,15 +316,21 @@ function Gladius:UNIT_HEALTH(event, unit) local button = self.buttons[unit] if(not button) then return end + -- show the button + if (arenaUnits[unit] == "playerUnit" or (arenaUnits[unit] ~= "playerUnit" and db.showPets)) then + if (not button:IsShown()) then button:Show() end + if (button:GetAlpha() < 1) then button:SetAlpha(1) end + end + -- update absorb bar if( db.absorbBar and unit == 'arena1' or unit == 'arena2' or unit == 'arena3') then --hardcode for now to avoid checking pet Gladius:UpdateAbsorb(event, unit, button) end - -- show the button - if (arenaUnits[unit] == "playerUnit" or (arenaUnits[unit] ~= "playerUnit" and db.showPets)) then - if (not button:IsShown()) then button:Show() end - if (button:GetAlpha() < 1) then button:SetAlpha(1) end + -- update cutaway + if ( db.cutawayBar and unit == 'arena1' or unit == 'arena2' or unit == 'arena3') then + local _currentHealth, _maxHealth = UnitHealth(unit), UnitHealthMax(unit) + Gladius:UpdateCutaway(button, _currentHealth, _maxHealth) end if(not UnitIsDeadOrGhost(unit)) then @@ -355,10 +362,6 @@ function Gladius:UNIT_HEALTH(event, unit) button.healthText:SetText(healthText) button.health:SetValue(healthPercent) - if ( db.cutawayBar ) then - Gladius:UpdateCutaway(button, currentHealth, maxHealth) - end - -- display low health announcement if ( db.lowHealthAnnounce and healthPercent <= db.lowHealthPercentage and not button.lowHealth and (not button.healthThrottle or GetTime() > button.healthThrottle) and button.name ) then local text = string.format(L["LOW HEALTH: %s"], button.name) diff --git a/Gladius/frame.lua b/Gladius/frame.lua index ec5c0ef..fca7732 100644 --- a/Gladius/frame.lua +++ b/Gladius/frame.lua @@ -225,9 +225,9 @@ function Gladius:CreateButton(i) healthBar.highlight:Hide() -- Health bar loss animation - local cutaway = CreateFrame("Frame", "GladiusCutawayBar"..i, healthBar) - cutaway:SetFrameLevel(healthBar:GetFrameLevel() + 10) - cutaway.bar = cutaway:CreateTexture(nil, "OVERLAY") -- b.BS + local cutaway = CreateFrame("Frame", "GladiusCutawayBar"..i, button) + --cutaway:SetFrameLevel(healthBar:GetFrameLevel() + 1) + cutaway.bar = cutaway:CreateTexture(nil, "ARTWORK") -- b.BS cutaway.bar:SetAlpha(1) -- set from alpha cutaway.bar:Hide() -- @@ -237,6 +237,8 @@ function Gladius:CreateButton(i) cutaway.anim.s1:SetOrigin("LEFT", 0, 0) cutaway.anim.s1:SetDuration(0.475) cutaway.anim.s1:SetSmoothing("OUT") + -- + cutaway.previousValue = 1 -- init at max -- AbsorbBar local absorbBar = CreateFrame("Frame", "GladiusAbsorbBar"..i, button) From e32d4ef90f5616d04622edecfa6bddaa1a08ace9 Mon Sep 17 00:00:00 2001 From: Cortes-Jeremy <56119078+Cortes-Jeremy@users.noreply.github.com> Date: Tue, 2 Mar 2021 19:53:11 +0100 Subject: [PATCH 6/7] Fixed absorb bar texture showing under --- Gladius/Gladius.lua | 8 ++++---- Gladius/frame.lua | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gladius/Gladius.lua b/Gladius/Gladius.lua index 62aec7f..59af04b 100644 --- a/Gladius/Gladius.lua +++ b/Gladius/Gladius.lua @@ -296,11 +296,11 @@ function Gladius:UpdateCutaway(button, curH, maxH) button.cutaway.bar:Hide() end -- - local marge = 2 + local padding = 2 local low = curHealthNorm > button.cutaway.previousValue and button.cutaway.previousValue or curHealthNorm local diff = math.abs(button.cutaway.previousValue - curHealthNorm) button.cutaway.bar:ClearAllPoints() - button.cutaway.bar:SetPoint("TOPLEFT", button.health, low*button.health:GetWidth() - marge, 0) + button.cutaway.bar:SetPoint("TOPLEFT", button.health, low*button.health:GetWidth() - padding, 0) button.cutaway.bar:SetWidth(diff*button.health:GetWidth()) button.cutaway.bar:Show() button.cutaway.anim:Play() @@ -1763,11 +1763,11 @@ function Gladius:UpdateAbsorb(event, unit, button) -- if ( myCurrentHealAbsorb > 0 and health < maxHealth ) then - CompactUnitFrameUtil_UpdateFillBar(button.absorb.totalAbsorbOverlay, button, button.health, health, myCurrentHealAbsorb) CompactUnitFrameUtil_UpdateFillBar(button.absorb.totalAbsorb, button, button.health, health, myCurrentHealAbsorb) + CompactUnitFrameUtil_UpdateFillBar(button.absorb.totalAbsorbOverlay, button, button.health, health, myCurrentHealAbsorb) else - button.absorb.totalAbsorbOverlay:Hide() button.absorb.totalAbsorb:Hide() + button.absorb.totalAbsorbOverlay:Hide() end local overAbsorb = false; diff --git a/Gladius/frame.lua b/Gladius/frame.lua index fca7732..1a0b248 100644 --- a/Gladius/frame.lua +++ b/Gladius/frame.lua @@ -249,12 +249,10 @@ function Gladius:CreateButton(i) absorbBar.overAbsorbGlow:SetBlendMode("ADD"); absorbBar.overAbsorbGlow:Hide() -- Total absorb - absorbBar.totalAbsorb = absorbBar:CreateTexture(nil, "BORDER", nil, 0) + absorbBar.totalAbsorb = absorbBar:CreateTexture(nil, "BACKGROUND") absorbBar.totalAbsorb:Hide() -- Total absorb overlay - absorbBar.totalAbsorbOverlay = absorbBar:CreateTexture(nil, "BORDER", nil, 1) - absorbBar.totalAbsorbOverlay:SetHorizTile(true) - absorbBar.totalAbsorbOverlay:SetTexture([[Interface\AddOns\Gladius\media\RaidFrame\Shield-Overlay]], "MIRROR") + absorbBar.totalAbsorbOverlay = absorbBar:CreateTexture(nil, "BORDER") absorbBar.totalAbsorbOverlay:Hide() --Mana bar @@ -816,6 +814,8 @@ function Gladius:UpdateFrame() button.absorb.totalAbsorb:SetSize(button.health:GetSize()*0.5, button.health:GetHeight()) -- Total absorb overlay button.absorb.totalAbsorbOverlay:ClearAllPoints() + button.absorb.totalAbsorbOverlay:SetHorizTile(true) + button.absorb.totalAbsorbOverlay:SetTexture([[Interface\AddOns\Gladius\media\RaidFrame\Shield-Overlay]], "MIRROR") button.absorb.totalAbsorbOverlay:SetPoint("RIGHT", button.health, "RIGHT") button.absorb.totalAbsorbOverlay:SetSize(button.health:GetSize()*0.5, button.health:GetHeight()) From de7c7ff1743bb006bc05adf1054da51d662517c0 Mon Sep 17 00:00:00 2001 From: Cortes-Jeremy <56119078+Cortes-Jeremy@users.noreply.github.com> Date: Tue, 2 Mar 2021 23:20:46 +0100 Subject: [PATCH 7/7] more options for cooldowns padding and added some new things in the default profile --- Gladius/frame.lua | 43 +++++++++---- Gladius/localization/enUS.lua | 1 + Gladius/options.lua | 111 ++++++++++++++++++++-------------- 3 files changed, 96 insertions(+), 59 deletions(-) diff --git a/Gladius/frame.lua b/Gladius/frame.lua index 1a0b248..658a8c8 100644 --- a/Gladius/frame.lua +++ b/Gladius/frame.lua @@ -44,7 +44,7 @@ local function CastUpdate(self, elapsed) end end -local function StyleActionButton(f) +local function StyleActionButton(f, hideBorder, iconPadding) local name = f:GetName() local button = _G[name] local icon = _G[name.."Icon"] @@ -56,9 +56,21 @@ local function StyleActionButton(f) button:SetNormalTexture("Interface\\AddOns\\Gladius\\images\\clean") + if hideBorder then + normalTex:SetAlpha(0) + else + normalTex:SetAlpha(1) + end + icon:SetTexCoord(0.1,0.9,0.1,0.9) - icon:SetPoint("TOPLEFT", button, "TOPLEFT", 2, -2) - icon:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2) + + if iconPadding then + icon:SetPoint("TOPLEFT", button, "TOPLEFT", iconPadding, -iconPadding) + icon:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -iconPadding, iconPadding) + else + icon:SetPoint("TOPLEFT", button, "TOPLEFT", 2, -2) + icon:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2) + end --normalTex:SetVertexColor(1,1,1,1) end @@ -333,9 +345,6 @@ function Gladius:CreateButton(i) for x=1, 14 do local icon = CreateFrame("CheckButton", "Gladius"..i.."SpellCooldownFrame"..x, spellCooldownFrame, "ActionButtonTemplate") icon:EnableMouse(false) - if( db.hideCooldownBorder ) then - icon:GetNormalTexture():SetTexCoord(1,1,1,1) -- force removal of ugly black square - end icon.texture = _G[icon:GetName().."Icon"] icon.cooldown = _G[icon:GetName().."Cooldown"] icon.cooldown:SetReverse(false) @@ -1227,7 +1236,13 @@ function Gladius:UpdateFrame() button.spellCooldownFrame:SetHeight(db.barHeight+extraBarHeight) button.spellCooldownFrame:SetWidth(db.barHeight+extraBarHeight) - -- Update each cooldown icon + -- Update each cooldown icon + local iconPadding = 0 + if db.cooldownIconPadding then + iconPadding = db.cooldownIconPadding + else + iconPadding = 2 -- default + end for i=1,14 do local icon = button.spellCooldownFrame["icon"..i] icon:SetHeight(button.spellCooldownFrame:GetHeight()/2) @@ -1238,17 +1253,17 @@ function Gladius:UpdateFrame() if(i==1) then icon:SetPoint("TOPLEFT",button.spellCooldownFrame) elseif(i==2) then - icon:SetPoint("TOP",button.spellCooldownFrame["icon"..i-1],"BOTTOM",0,-1) + icon:SetPoint("TOP",button.spellCooldownFrame["icon"..i-1],"BOTTOM",0,-iconPadding) elseif(i>=3) then - icon:SetPoint("LEFT",button.spellCooldownFrame["icon"..i-2],"RIGHT",1,0) + icon:SetPoint("LEFT",button.spellCooldownFrame["icon"..i-2],"RIGHT",iconPadding,0) end else if(i==1) then icon:SetPoint("TOPRIGHT",button.spellCooldownFrame) elseif(i==2) then - icon:SetPoint("TOP",button.spellCooldownFrame["icon"..i-1],"BOTTOM",0,-1) + icon:SetPoint("TOP",button.spellCooldownFrame["icon"..i-1],"BOTTOM",0,-iconPadding) elseif(i>=3) then - icon:SetPoint("RIGHT",button.spellCooldownFrame["icon"..i-2],"LEFT",-1,0) + icon:SetPoint("RIGHT",button.spellCooldownFrame["icon"..i-2],"LEFT",-iconPadding,0) end end @@ -1261,7 +1276,11 @@ function Gladius:UpdateFrame() icon.spellId = nil icon:SetAlpha(1) icon.texture:SetTexture("Interface\\Icons\\Spell_Holy_PainSupression") - StyleActionButton(icon) + if db.hideCooldownBorder then + StyleActionButton(icon, true, iconPadding) + else + StyleActionButton(icon, false, iconPadding) + end if (not self.frame.testing) then icon:Hide() diff --git a/Gladius/localization/enUS.lua b/Gladius/localization/enUS.lua index 2e2b96c..4990606 100644 --- a/Gladius/localization/enUS.lua +++ b/Gladius/localization/enUS.lua @@ -367,6 +367,7 @@ L["Show cooldown icons"] = "Show cooldown icons" L["Cooldown list"] = "Cooldown list" L["Show cooldown"] = "Show cooldown" L["Hide Cooldown border"] = "Hide Cooldown border" +L["Cooldown icon padding"] = "Cooldown icon padding" L["Glow when cooldown is active"] = "Glow when cooldown is active" L["Desaturate used cooldown"] = "Desature used cooldown" L["Used cooldown opacity"] = "Used cooldown opacity" diff --git a/Gladius/options.lua b/Gladius/options.lua index e4ca86e..11cbf24 100644 --- a/Gladius/options.lua +++ b/Gladius/options.lua @@ -11,7 +11,7 @@ local spellCache local defaults = { profile = { - x=0, + x=0, y=0, frameScale = 1, barWidth=150, @@ -119,7 +119,18 @@ local defaults = { debuffFontSize = 13, debuffPos = "RIGHT", debuffs = {}, + castBarSpark = true, + castBarOnCast = true, + hideSpellRank = true, + absorbBar = false, + cutawayBar = false, cooldown = false, + cooldownIconPadding = 2, + hideCooldownBorder = false, + cooldownAuraGlow = true, + cooldownDesaturate = true, + cooldownOpacity = false, + cooldownOpacityValue = 0.5, cooldownPos = "RIGHT", cooldownAnnounce = false, cooldownAnnounceList = {}, @@ -1713,52 +1724,58 @@ function Gladius:SetupOptions() order = 10, name = L["Cooldowns"], args = { - cooldown = { - type="toggle", - name=L["Show cooldown icons"], - order=0, - }, - cooldownPos = { - type="select", - name=L["Cooldown position"], - desc=L["Position of the cooldown icons"], - values = { - ["RIGHT"] = L["Right"], - ["LEFT"] = L["Left"], - }, - order=1, - }, - hideCooldownBorder = { - type="toggle", - name=L["Hide Cooldown border"], - order=5, - }, - cooldownAuraGlow = { - type="toggle", - name=L["Glow when cooldown is active"], - order=9, - }, - cooldownDesaturate = { - type="toggle", - name=L["Desaturate used cooldown"], - order=10, - }, - cooldownOpacity = { - type="toggle", - name=L["Cooldown used Opacity"], - order=15, - }, - cooldownOpacityValue = { - type="range", - name=L["Used cooldown opacity"], - min=0, - max=1, - step=.01, - order=16, - disabled = function() return not self.db.profile.cooldownOpacity end, - }, - - + cooldown = { + type="toggle", + name=L["Show cooldown icons"], + order=0, + }, + cooldownPos = { + type="select", + name=L["Cooldown position"], + desc=L["Position of the cooldown icons"], + values = { + ["RIGHT"] = L["Right"], + ["LEFT"] = L["Left"], + }, + order=1, + }, + hideCooldownBorder = { + type="toggle", + name=L["Hide Cooldown border"], + order=5, + }, + cooldownIconPadding = { + type="range", + name=L["Cooldown icon padding"], + min=0, + max=5, + step=0.1, + order=6, + }, + cooldownAuraGlow = { + type="toggle", + name=L["Glow when cooldown is active"], + order=9, + }, + cooldownDesaturate = { + type="toggle", + name=L["Desaturate used cooldown"], + order=10, + }, + cooldownOpacity = { + type="toggle", + name=L["Cooldown used Opacity"], + order=15, + }, + cooldownOpacityValue = { + type="range", + name=L["Used cooldown opacity"], + min=0, + max=1, + step=.01, + order=16, + disabled = function() return not self.db.profile.cooldownOpacity end, + }, }, }