From 6cee8c738c957f2f39441861d85333a03a195abe Mon Sep 17 00:00:00 2001 From: Parnic Date: Wed, 2 Aug 2023 08:25:34 -0500 Subject: [PATCH] Apply strata adjustment inside BarFactory instead of every callsite --- IceBarElement.lua | 4 ++-- modules/CastBar.lua | 2 +- modules/EclipseBar.lua | 2 +- modules/GlobalCoolDown.lua | 2 +- modules/PlayerHealth.lua | 4 ++-- modules/RollTheBones.lua | 2 +- modules/SliceAndDice.lua | 2 +- modules/Stagger.lua | 2 +- modules/Threat.lua | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/IceBarElement.lua b/IceBarElement.lua index 2684b44..894cea1 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -1040,7 +1040,7 @@ end -- Creates the actual bar function IceBarElement.prototype:CreateBar() - self.barFrame = self:BarFactory(self.barFrame, IceHUD.IceCore:DetermineStrata("LOW"), "ARTWORK", "Bar") + self.barFrame = self:BarFactory(self.barFrame, "LOW", "ARTWORK", "Bar") self:SetBarCoord(self.barFrame) @@ -1056,7 +1056,7 @@ function IceBarElement.prototype:BarFactory(barFrame, frameStrata, textureLayer, barFrame = CreateFrame("Frame", "IceHUD_"..self.elementName.."_"..(nameSuffix or "Bar"), self.frame) end - barFrame:SetFrameStrata(frameStrata and frameStrata or IceHUD.IceCore:DetermineStrata("LOW")) + barFrame:SetFrameStrata(IceHUD.IceCore:DetermineStrata(frameStrata and frameStrata or "LOW")) barFrame:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0)) barFrame:SetHeight(self.settings.barHeight) self:SetBarFramePoints(barFrame) diff --git a/modules/CastBar.lua b/modules/CastBar.lua index bba9a30..26ba9c4 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -426,7 +426,7 @@ end function CastBar.prototype:CreateLagBar() if self.lagBar == nil then - self.lagBar = self:BarFactory(self.lagBar, IceHUD.IceCore:DetermineStrata("LOW"), "OVERLAY", "Lag") + self.lagBar = self:BarFactory(self.lagBar, "LOW", "OVERLAY", "Lag") end local r, g, b = self:GetColor("CastLag") diff --git a/modules/EclipseBar.lua b/modules/EclipseBar.lua index 245bb41..2aa4b79 100644 --- a/modules/EclipseBar.lua +++ b/modules/EclipseBar.lua @@ -107,7 +107,7 @@ function EclipseBar.prototype:CreateFrame() end function EclipseBar.prototype:CreateSolarBar() - self.solarBar = self:BarFactory(self.solarBar, IceHUD.IceCore:DetermineStrata("BACKGROUND"), "ARTWORK", "Solar") + self.solarBar = self:BarFactory(self.solarBar, "BACKGROUND", "ARTWORK", "Solar") self:SetBarCoord(self.solarBar, 0.5, true) self.solarBar.bar:SetVertexColor(self:GetColor("EclipseSolar", 1)) diff --git a/modules/GlobalCoolDown.lua b/modules/GlobalCoolDown.lua index b92ec7f..ab330a8 100644 --- a/modules/GlobalCoolDown.lua +++ b/modules/GlobalCoolDown.lua @@ -255,7 +255,7 @@ function GlobalCoolDown.prototype:CreateFrame() end function GlobalCoolDown.prototype:CreateLagBar() - self.lagBar = self:BarFactory(self.lagBar, IceHUD.IceCore:DetermineStrata("LOW"), "OVERLAY", "Lag") + self.lagBar = self:BarFactory(self.lagBar, "LOW", "OVERLAY", "Lag") local r, g, b = self:GetColor("CastLag") if (self.settings.backgroundToggle) then diff --git a/modules/PlayerHealth.lua b/modules/PlayerHealth.lua index c76078c..c9a51da 100644 --- a/modules/PlayerHealth.lua +++ b/modules/PlayerHealth.lua @@ -933,7 +933,7 @@ function PlayerHealth.prototype:CreateBackground(redraw) end function PlayerHealth.prototype:CreateHealBar() - self.healFrame = self:BarFactory(self.healFrame, IceHUD.IceCore:DetermineStrata("LOW"),"BACKGROUND", "Heal") + self.healFrame = self:BarFactory(self.healFrame, "LOW","BACKGROUND", "Heal") self.healFrame.bar:SetVertexColor(self:GetColor("PlayerHealthHealAmount", self.alpha * self.moduleSettings.healAlpha)) @@ -945,7 +945,7 @@ function PlayerHealth.prototype:CreateHealBar() end function PlayerHealth.prototype:CreateAbsorbBar() - self.absorbFrame = self:BarFactory(self.absorbFrame, IceHUD.IceCore:DetermineStrata("LOW"),"BACKGROUND", "Absorb") + self.absorbFrame = self:BarFactory(self.absorbFrame, "LOW","BACKGROUND", "Absorb") self.absorbFrame.bar:SetVertexColor(self:GetColor("PlayerHealthAbsorbAmount", self.alpha * self.moduleSettings.absorbAlpha)) diff --git a/modules/RollTheBones.lua b/modules/RollTheBones.lua index ca89a8c..8f2c230 100644 --- a/modules/RollTheBones.lua +++ b/modules/RollTheBones.lua @@ -199,7 +199,7 @@ function RollTheBones.prototype:CreateDurationBar() return end - self.durationFrame = self:BarFactory(self.durationFrame, IceHUD.IceCore:DetermineStrata("BACKGROUND"),"ARTWORK", "Duration") + self.durationFrame = self:BarFactory(self.durationFrame, "BACKGROUND","ARTWORK", "Duration") -- Rokiyo: Do we need to call this here? self.CurrScale = 0 diff --git a/modules/SliceAndDice.lua b/modules/SliceAndDice.lua index d57fee5..b81d298 100644 --- a/modules/SliceAndDice.lua +++ b/modules/SliceAndDice.lua @@ -214,7 +214,7 @@ function SliceAndDice.prototype:CreateFrame() end function SliceAndDice.prototype:CreateDurationBar() - self.durationFrame = self:BarFactory(self.durationFrame, IceHUD.IceCore:DetermineStrata("BACKGROUND"),"ARTWORK", "Duration") + self.durationFrame = self:BarFactory(self.durationFrame, "BACKGROUND", "ARTWORK", "Duration") -- Rokiyo: Do we need to call this here? self.CurrScale = 0 diff --git a/modules/Stagger.lua b/modules/Stagger.lua index 3cfd2ac..b8bf02a 100644 --- a/modules/Stagger.lua +++ b/modules/Stagger.lua @@ -137,7 +137,7 @@ function StaggerBar.prototype:CreateFrame() end function StaggerBar.prototype:CreateTimerBar() - self.timerFrame = self:BarFactory(self.timerFrame, IceHUD.IceCore:DetermineStrata("MEDIUM"),"ARTWORK", "Timer") + self.timerFrame = self:BarFactory(self.timerFrame, "MEDIUM", "ARTWORK", "Timer") self.CurrScale = 0 diff --git a/modules/Threat.lua b/modules/Threat.lua index ec76544..5571cfb 100644 --- a/modules/Threat.lua +++ b/modules/Threat.lua @@ -231,7 +231,7 @@ end -- create the aggro range indicator bar function IceThreat.prototype:CreateAggroBar() - self.aggroBar = self:BarFactory(self.aggroBar, IceHUD.IceCore:DetermineStrata("BACKGROUND"), "ARTWORK", "Aggro") + self.aggroBar = self:BarFactory(self.aggroBar, "BACKGROUND", "ARTWORK", "Aggro") local r, g, b = self:GetColor("ThreatPullAggro") if (self.settings.backgroundToggle) then @@ -243,7 +243,7 @@ function IceThreat.prototype:CreateAggroBar() end function IceThreat.prototype:CreateSecondThreatBar() - self.secondThreatBar = self:BarFactory(self.secondThreatBar, IceHUD.IceCore:DetermineStrata("MEDIUM"), "OVERLAY", "SecondThreat") + self.secondThreatBar = self:BarFactory(self.secondThreatBar, "MEDIUM", "OVERLAY", "SecondThreat") self.secondThreatBar.bar:SetVertexColor(self:GetColor("ThreatSecondPlace", self.alpha * self.moduleSettings.secondPlaceThreatAlpha))