diff --git a/IceBarElement.lua b/IceBarElement.lua index 621eae7..2f342b2 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -588,7 +588,7 @@ end -- Creates background for the bar function IceBarElement.prototype:CreateBackground() if not (self.frame) then - self.frame = CreateFrame("StatusBar", "IceHUD_"..self.elementName, self.parent) + self.frame = CreateFrame("Frame", "IceHUD_"..self.elementName, self.parent) end self.frame:SetFrameStrata("BACKGROUND") @@ -599,10 +599,13 @@ function IceBarElement.prototype:CreateBackground() self.frame.bg = self.frame:CreateTexture(nil, "BACKGROUND") end - self.frame.bg:SetTexture(IceElement.TexturePath .. "RivetBarBG")--self:GetMyBarTexture() .."BG") + self.frame.bg:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture() .."BG") self.frame.bg:SetBlendMode(self.settings.barBgBlendMode) + self.frame.bg:ClearAllPoints() - self.frame.bg:SetAllPoints(self.frame) + self.frame.bg:SetPoint("BOTTOMLEFT",self.frame,"BOTTOMLEFT") + self.frame.bg:SetPoint("BOTTOMRIGHT",self.frame,"BOTTOMRIGHT") + self.frame.bg:SetHeight(self.settings.barHeight) if (self.moduleSettings.side == IceCore.Side.Left) then self.frame.bg:SetTexCoord(1, 0, 0, 1) @@ -610,8 +613,7 @@ function IceBarElement.prototype:CreateBackground() self.frame.bg:SetTexCoord(0, 1, 0, 1) end - --self.frame:SetStatusBarTexture(self.frame.bg) - self.frame:SetStatusBarColor(self:GetColor("undef", self.settings.alphabg)) + self.frame.bg:SetVertexColor(self:GetColor("undef", self.settings.alphabg)) local ownPoint = "LEFT" if (self.moduleSettings.side == ownPoint) then @@ -633,7 +635,7 @@ end -- Creates the actual bar function IceBarElement.prototype:CreateBar() if not (self.barFrame) then - self.barFrame = CreateFrame("StatusBar", nil, self.frame) + self.barFrame = CreateFrame("Frame", nil, self.frame) end self.barFrame:SetFrameStrata("LOW") @@ -642,29 +644,26 @@ function IceBarElement.prototype:CreateBar() if not (self.barFrame.bar) then - self.barFrame.bar = self.frame:CreateTexture(nil, "LOW") - --self.barFrame.bar:SetHorizTile(true) - --self.barFrame.bar:SetVertTile(true) + self.barFrame.bar = self.frame:CreateTexture(nil, "BACKGROUND") end - self.barFrame.bar:SetTexture(IceElement.TexturePath .. "RivetBar")--self:GetMyBarTexture()) + self.barFrame.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture()) self.barFrame.bar:SetBlendMode(self.settings.barBlendMode) - self.barFrame.bar:SetAllPoints(self.barFrame) + self.barFrame.bar:ClearAllPoints() + self.barFrame.bar:SetPoint("BOTTOMLEFT",self.barFrame,"BOTTOMLEFT") + self.barFrame.bar:SetPoint("BOTTOMRIGHT",self.barFrame,"BOTTOMRIGHT") if (self.moduleSettings.side == IceCore.Side.Left) then self.barFrame.bar:SetTexCoord(1, 0, 1-self.CurrScale, 1) else self.barFrame.bar:SetTexCoord(0, 1, 1-self.CurrScale, 1) end + self.barFrame.bar:SetHeight(self.settings.barHeight*self.CurrScale) - --self.barFrame:SetStatusBarTexture(self.barFrame.bar) - self:UpdateBar(1, "undef") self.barFrame:ClearAllPoints() self.barFrame:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0) - - --self.barFrame.bar:SetPoint("BOTTOM", self.barFrame, "BOTTOM", 0, 0) end @@ -781,14 +780,12 @@ function IceBarElement.prototype:SetScale(texture, scale) max_y = 1; end end ---[[ if (self.moduleSettings.side == IceCore.Side.Left) then texture:SetTexCoord(1, 0, min_y, max_y) else texture:SetTexCoord(0, 1, min_y, max_y) end -]]-- - self.barFrame:SetHeight(self.settings.barHeight * self.CurrScale) + self.barFrame.bar:SetHeight(self.settings.barHeight * self.CurrScale) end end @@ -842,8 +839,7 @@ function IceBarElement.prototype:UpdateBar(scale, color, alpha) self.alpha = 1 end - self.frame:SetStatusBarColor(r, g, b, self.backgroundAlpha) - --self.barFrame:SetStatusBarColor(self:GetColor(color)) + self.frame.bg:SetVertexColor(r, g, b, self.backGroundAlpha) self.barFrame.bar:SetVertexColor(self:GetColor(color)) if self.DesiredScale ~= scale then diff --git a/IceCastBar.lua b/IceCastBar.lua index c893a17..ff4293e 100644 --- a/IceCastBar.lua +++ b/IceCastBar.lua @@ -198,8 +198,8 @@ function IceCastBar.prototype:FlashBar(color, alpha, text, textColor) r, g, b = self:GetColor(color) end - self.frame:SetStatusBarColor(r, g, b, 0.3) - self.barFrame:SetStatusBarColor(self:GetColor(color, 0.8)) + self.frame.bg:SetVertexColor(r, g, b, 0.3) + self.barFrame.bar:SetVertexColor(self:GetColor(color, 0.8)) self:SetScale(self.barFrame.bar, 1) self:SetBottomText1(text, textColor or "Text") diff --git a/IceHUD.lua b/IceHUD.lua index 2fd639d..8914d90 100644 --- a/IceHUD.lua +++ b/IceHUD.lua @@ -324,7 +324,6 @@ IceHUD.options = IceHUD.IceCore:SetBarPreset(value) end, validate = IceHUD.validBarList, - disabled = true, order = 9 }, @@ -347,7 +346,6 @@ IceHUD.options = IceHUD.IceCore:SetBarTexture(value) end, validate = IceHUD.validBarList, - disabled = true, order = 11 }, diff --git a/IceUnitBar.lua b/IceUnitBar.lua index d279cdb..969d120 100644 --- a/IceUnitBar.lua +++ b/IceUnitBar.lua @@ -162,7 +162,7 @@ end -- Creates the low amount warning frame function IceUnitBar.prototype:CreateFlashFrame() if not (self.flashFrame) then - self.flashFrame = CreateFrame("StatusBar", nil, self.frame) + self.flashFrame = CreateFrame("Frame", nil, self.frame) end self.flashFrame:SetFrameStrata("BACKGROUND") @@ -178,9 +178,6 @@ function IceUnitBar.prototype:CreateFlashFrame() self.flashFrame.flash:SetBlendMode("ADD") self.flashFrame.flash:SetAllPoints(self.flashFrame) - self.flashFrame:SetStatusBarTexture(self.flashFrame.flash) - - self:SetScale(self.flashFrame.flash, 1) self.flashFrame:SetAlpha(0) @@ -277,8 +274,8 @@ function IceUnitBar.prototype:UpdateBar(scale, color, alpha) -- skip if flashFrame hasn't been created yet return end - - self.flashFrame:SetStatusBarColor(self:GetColor(color)) + + self.flashFrame.flash:SetVertexColor(self:GetColor(color)) if (self.moduleSettings.lowThreshold > 0 and self.moduleSettings.lowThresholdFlash and diff --git a/modules/CastBar.lua b/modules/CastBar.lua index 8cf1af3..dee77f3 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -386,7 +386,7 @@ end function CastBar.prototype:CreateLagBar() if not (self.lagBar) then - self.lagBar = CreateFrame("StatusBar", nil, self.frame) + self.lagBar = CreateFrame("Frame", nil, self.frame) end self.lagBar:SetFrameStrata("BACKGROUND") @@ -399,15 +399,14 @@ function CastBar.prototype:CreateLagBar() end self.lagBar.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture()) - self.lagBar.bar:SetAllPoints(self.lagBar) - - self.lagBar:SetStatusBarTexture(self.lagBar.bar) + self.lagBar.bar:SetPoint("BOTTOMLEFT",self.lagBar,"BOTTOMLEFT") + self.lagBar.bar:SetPoint("BOTTOMRIGHT",self.lagBar,"BOTTOMRIGHT") local r, g, b = self:GetColor("CastLag") if (self.settings.backgroundToggle) then r, g, b = self:GetColor("CastCasting") end - self.lagBar:SetStatusBarColor(r, g, b, self.moduleSettings.lagAlpha) + self.lagBar.bar:SetVertexColor(r, g, b, self.moduleSettings.lagAlpha) if (self.moduleSettings.side == IceCore.Side.Left) then @@ -415,6 +414,7 @@ function CastBar.prototype:CreateLagBar() else self.lagBar.bar:SetTexCoord(0, 1, 0, 0) end + self.lagBar.bar:SetHeight(0) self.lagBar:ClearAllPoints() self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0) @@ -446,15 +446,16 @@ function CastBar.prototype:SpellCastStart(unit, spell, rank) pos = 0 end local y = self.settings.barHeight - (pos * self.settings.barHeight) ---[[ + if (self.moduleSettings.side == IceCore.Side.Left) then self.lagBar.bar:SetTexCoord(1, 0, 0, pos) else self.lagBar.bar:SetTexCoord(0, 1, 0, pos) end - - self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, y) -]]-- + self.lagBar.bar:SetHeight(self.settings.barHeight * pos) + + self.lagBar:ClearAllPoints() + self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, y) end @@ -474,15 +475,15 @@ function CastBar.prototype:SpellCastChannelStart(unit) pos = 0 end local y = self.settings.barHeight - (pos * self.settings.barHeight) ---[[ + if (self.moduleSettings.side == IceCore.Side.Left) then self.lagBar.bar:SetTexCoord(1, 0, 1-pos, 1) else self.lagBar.bar:SetTexCoord(0, 1, 1-pos, 1) end + self.lagBar.bar:SetHeight(self.settings.barHeight * pos) self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0) -]]-- end diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua index 9c0807f..72e9255 100644 --- a/modules/CustomBar.lua +++ b/modules/CustomBar.lua @@ -354,7 +354,6 @@ function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate) self:SetBottomText1(self.moduleSettings.upperText) end - --self.barFrame:SetStatusBarColor(self:GetBarColor()) self.barFrame.bar:SetVertexColor(self:GetBarColor()) end diff --git a/modules/CustomCDBar.lua b/modules/CustomCDBar.lua index 887cc7b..5f3cda0 100644 --- a/modules/CustomCDBar.lua +++ b/modules/CustomCDBar.lua @@ -276,7 +276,6 @@ function IceCustomCDBar.prototype:UpdateCustomBar(fromUpdate) self:SetBottomText1(self.moduleSettings.upperText) end - --self.barFrame:SetStatusBarColor(self:GetBarColor()) self.barFrame.bar:SetVertexColor(self:GetBarColor()) end diff --git a/modules/PlayerHealth.lua b/modules/PlayerHealth.lua index 94613ea..3a3eaa2 100644 --- a/modules/PlayerHealth.lua +++ b/modules/PlayerHealth.lua @@ -744,7 +744,7 @@ end function PlayerHealth.prototype:CreateHealBar() if not self.healFrame then - self.healFrame = CreateFrame("Statusbar", nil, self.frame) + self.healFrame = CreateFrame("Frame", nil, self.frame) end self.healFrame:SetFrameStrata("LOW") @@ -756,10 +756,10 @@ function PlayerHealth.prototype:CreateHealBar() end self.healFrame.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture()) - self.healFrame.bar:SetAllPoints(self.frame) + self.healFrame.bar:SetPoint("BOTTOMLEFT",self.frame,"BOTTOMLEFT") + self.healFrame.bar:SetPoint("BOTTOMRIGHT",self.frame,"BOTTOMRIGHT") - self.healFrame:SetStatusBarTexture(self.healFrame.bar) - self.healFrame:SetStatusBarColor(self:GetColor("PlayerHealthHealAmount", self.alpha * self.moduleSettings.healAlpha)) + self.healFrame.bar:SetVertexColor(self:GetColor("PlayerHealthHealAmount", self.alpha * self.moduleSettings.healAlpha)) self:UpdateBar(1, "undef") @@ -965,21 +965,25 @@ function PlayerHealth.prototype:Update(unit) -- sadly, animation uses bar-local variables so we can't use the animation for 2 bar textures on the same bar element if self.moduleSettings.showIncomingHeals and self.healFrame and self.healFrame.bar and incomingHealAmt then - local barValue + local barValue, percent if incomingHealAmt > 0 then - barValue = 1-((self.health + incomingHealAmt) / self.maxHealth) + percent = ((self.health + incomingHealAmt) / self.maxHealth) + barValue = 1-percent else barValue = 1 + percent = 0 end barValue = IceHUD:Clamp(barValue, 0, 1) + percent = IceHUD:Clamp(percent, 0, 1) if (self.moduleSettings.side == IceCore.Side.Left) then self.healFrame.bar:SetTexCoord(1, 0, barValue, 1) else self.healFrame.bar:SetTexCoord(0, 1, barValue, 1) end + self.healFrame.bar:SetHeight(self.settings.barHeight * percent) end if not IceHUD.IceCore:ShouldUseDogTags() then diff --git a/modules/PlayerMana.lua b/modules/PlayerMana.lua index c9a9727..a09d217 100644 --- a/modules/PlayerMana.lua +++ b/modules/PlayerMana.lua @@ -67,7 +67,7 @@ if self:ShouldUseTicker() then end, set = function(value) self.moduleSettings.tickerAlpha = value - self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha)) + self.tickerFrame.spark:SetVertexColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha)) end, disabled = function() return not self.moduleSettings.enabled @@ -262,9 +262,9 @@ function PlayerMana.prototype:Update(unit) if self:ShouldUseTicker() then -- hide ticker if rest of the bar is not visible if (self.alpha == 0) then - self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", 0)) + self.tickerFrame.spark:SetVertexColor(self:GetColor("PlayerEnergy", 0)) else - self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha)) + self.tickerFrame.spark:SetVertexColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha)) end end @@ -341,6 +341,7 @@ function PlayerMana.prototype:EnergyTick() else self.tickerFrame.spark:SetTexCoord(0, 1, 1-pos-0.01, 1-pos) end + self.tickerFrame.spark:SetHeight(self.settings.barHeight * 0.01) self.tickerFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 0, y) end @@ -352,7 +353,7 @@ function PlayerMana.prototype:CreateTickerFrame() end if not (self.tickerFrame) then - self.tickerFrame = CreateFrame("StatusBar", nil, self.barFrame) + self.tickerFrame = CreateFrame("Frame", nil, self.barFrame) end self.tickerFrame:SetFrameStrata("BACKGROUND") @@ -367,10 +368,11 @@ function PlayerMana.prototype:CreateTickerFrame() self.tickerFrame.spark:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture()) self.tickerFrame.spark:SetBlendMode("ADD") self.tickerFrame.spark:ClearAllPoints() - self.tickerFrame.spark:SetAllPoints(self.tickerFrame) - - self.tickerFrame:SetStatusBarTexture(self.tickerFrame.spark) - self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha)) + self.tickerFrame.spark:SetPoint("BOTTOMLEFT",self.tickerFrame,"BOTTOMLEFT") + self.tickerFrame.spark:SetPoint("BOTTOMRIGHT",self.tickerFrame,"BOTTOMRIGHT") + self.tickerFrame.spark:SetHeight(0) + + self.tickerFrame.spark:SetVertexColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha)) self.tickerFrame:ClearAllPoints() self.tickerFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 0, 0) diff --git a/modules/SliceAndDice.lua b/modules/SliceAndDice.lua index f34caef..f618004 100644 --- a/modules/SliceAndDice.lua +++ b/modules/SliceAndDice.lua @@ -153,10 +153,10 @@ function SliceAndDice.prototype:CreateDurationBar() end self.durationFrame.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture()) - self.durationFrame.bar:SetAllPoints(self.frame) + self.durationFrame.bar:SetPoint("BOTTOMLEFT",self.frame,"BOTTOMLEFT") + self.durationFrame.bar:SetPoint("BOTTOMRIGHT",self.frame,"BOTTOMRIGHT") - self.durationFrame:SetStatusBarTexture(self.durationFrame.bar) - self.durationFrame:SetStatusBarColor(self:GetColor("SliceAndDicePotential", self.alpha * self.moduleSettings.durationAlpha)) + self.durationFrame.bar:SetVertexColor(self:GetColor("SliceAndDicePotential", self.alpha * self.moduleSettings.durationAlpha)) self:UpdateBar(1, "undef") @@ -285,6 +285,7 @@ function SliceAndDice.prototype:UpdateDurationBar(unit) else self.durationFrame.bar:SetTexCoord(0, 1, 1-scale, 1) end + self.durationFrame.bar:SetHeight(self.settings.barHeight * scale) if sndEndTime < GetTime() then self:SetBottomText1(self.moduleSettings.upperText .. "0 (" .. PotentialSnDDuration .. ")") diff --git a/modules/Threat.lua b/modules/Threat.lua index d2dd393..b97129c 100644 --- a/modules/Threat.lua +++ b/modules/Threat.lua @@ -155,7 +155,7 @@ end -- create the aggro range indicator bar function IceThreat.prototype:CreateAggroBar() if not (self.aggroBar) then - self.aggroBar = CreateFrame("StatusBar", nil, self.frame) + self.aggroBar = CreateFrame("Frame", nil, self.frame) end self.aggroBar:SetFrameStrata("BACKGROUND") @@ -167,21 +167,21 @@ function IceThreat.prototype:CreateAggroBar() end self.aggroBar.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture() .. "BG") - self.aggroBar.bar:SetAllPoints(self.aggroBar) - - self.aggroBar:SetStatusBarTexture(self.aggroBar.bar) + self.aggroBar.bar:SetPoint("BOTTOMLEFT",self.aggroBar,"BOTTOMLEFT") + self.aggroBar.bar:SetPoint("BOTTOMRIGHT",self.aggroBar,"BOTTOMRIGHT") local r, g, b = self:GetColor("ThreatPullAggro") if (self.settings.backgroundToggle) then r, g, b = self:GetColor("CastCasting") end - self.aggroBar:SetStatusBarColor(r, g, b, self.moduleSettings.aggroAlpha) + self.aggroBar.bar:SetVertexColor(r, g, b, self.moduleSettings.aggroAlpha) if (self.moduleSettings.side == IceCore.Side.Left) then self.aggroBar.bar:SetTexCoord(1, 0, 0, 0) else self.aggroBar.bar:SetTexCoord(0, 1, 0, 0) end + self.aggroBar.bar:SetHeight(0) self.aggroBar:ClearAllPoints() self.aggroBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0) @@ -288,7 +288,7 @@ function IceThreat.prototype:Update(unit) -- set the bar value self:UpdateBar( scaledPercentZeroToOne, self.color ) ---[[ + -- do the aggro indicator bar stuff, but only if it has changed if ( self.aggroBarMulti ~= rangeMulti ) then self.aggroBarMulti = rangeMulti @@ -301,10 +301,11 @@ function IceThreat.prototype:Update(unit) else self.aggroBar.bar:SetTexCoord(0, 1, 0, pos) end + self.aggroBar.bar:SetHeight(self.settings.barHeight * pos) self.aggroBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, y) end -]]-- + self:UpdateAlpha() end