diff --git a/IceBarElement.lua b/IceBarElement.lua index fe99acc..de1b2d6 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -35,8 +35,6 @@ end function IceBarElement.prototype:Enable() IceBarElement.super.prototype.Enable(self) - -- never register the OnUpdate for the mirror bar since it's handled internally - -- in addition, do not register OnUpdate if predictedPower is set and this is the player mana or target mana bar self:ConditionalSetupUpdate() if IceHUD.IceCore:ShouldUseDogTags() then @@ -940,8 +938,7 @@ function IceBarElement.prototype:ConditionalSetupUpdate() return end - if not string.find(self.elementName, "MirrorBar") - and ((IceHUD.WowVer < 30000 or not GetCVarBool("predictedPower")) or (not string.find(self.elementName, "PlayerMana"))) then + if not string.find(self.elementName, "MirrorBar") and not string.find(self.elementName, "PlayerMana") then IceHUD.IceCore:RequestUpdates(self, self.MyOnUpdateFunc) end end @@ -1167,11 +1164,16 @@ function IceBarElement.prototype:SetBarCoord(barFrame, scale, top) end end -function IceBarElement.prototype:SetScale(inScale, force) +function IceBarElement.prototype:SetScale(inScale, force, skipLerp) local oldScale = self.CurrScale local min_y, max_y; - self.CurrScale = IceHUD:Clamp(self:LerpScale(inScale), 0, 1) + if not skipLerp then + self.CurrScale = self:LerpScale(inScale) + else + self.CurrScale = inScale + end + self.CurrScale = IceHUD:Clamp(self.CurrScale, 0, 1) if force or oldScale ~= self.CurrScale then local scale = self.CurrScale diff --git a/IceCastBar.lua b/IceCastBar.lua index 08198eb..2dc9090 100644 --- a/IceCastBar.lua +++ b/IceCastBar.lua @@ -276,16 +276,12 @@ function IceCastBar.prototype:MyOnUpdate() scale = self.actionDuration ~= 0 and remainingTime / self.actionDuration or 0 end - if (remainingTime < 0) then + self:UpdateBar(IceHUD:Clamp(scale, 0, 1), self:GetCurrentCastingColor()) + + if (remainingTime <= 0) then self:StopBar() end - -- sanity check to make sure the bar doesn't over/underfill - scale = scale > 1 and 1 or scale - scale = scale < 0 and 0 or scale - - self:UpdateBar(scale, self:GetCurrentCastingColor()) - local timeString = self.moduleSettings.showCastTime and string.format("%.1fs ", remainingTime) or "" self:SetBottomText1(timeString .. self.actionMessage) @@ -396,6 +392,8 @@ function IceCastBar.prototype:StopBar() self.actionStartTime = nil self.actionDuration = nil + self:SetBottomText1() + self:SetScale(0) self:Show(false) end diff --git a/modules/CustomHealth.lua b/modules/CustomHealth.lua index 40cf340..fafc1cc 100644 --- a/modules/CustomHealth.lua +++ b/modules/CustomHealth.lua @@ -163,5 +163,6 @@ function IceCustomHealth.prototype:SetUnit(unit) end function IceCustomHealth.prototype:OnShow() + IceCustomHealth.super.prototype.OnShow(self) self:Update(self.unit) end diff --git a/modules/PetMana.lua b/modules/PetMana.lua index ef8229c..39c6e67 100644 --- a/modules/PetMana.lua +++ b/modules/PetMana.lua @@ -148,7 +148,7 @@ function PetMana.prototype:Update(unit) if (self.manaPercentage == 1 and self.manaType ~= SPELL_POWER_RAGE and self.manaType ~= SPELL_POWER_RUNIC_POWER) or (self.manaPercentage == 0 and (self.manaType == SPELL_POWER_RAGE or self.manaType == SPELL_POWER_RUNIC_POWER)) then self:SetupOnUpdate(false) - elseif GetCVarBool("predictedPower") then + else self:SetupOnUpdate(true) end diff --git a/modules/PlayerMana.lua b/modules/PlayerMana.lua index 271de1b..881d138 100644 --- a/modules/PlayerMana.lua +++ b/modules/PlayerMana.lua @@ -126,10 +126,7 @@ function PlayerMana.prototype:Enable(core) self.CustomOnUpdate = function() self:Update(self.unit) end end - -- allow new 'predicted power' stuff to show the power updates constantly instead of ticking - if GetCVarBool("predictedPower") then - self:SetupOnUpdate(true) - end + self:SetupOnUpdate(true) self:RegisterEvent("UNIT_DISPLAYPOWER", "ManaType") @@ -293,7 +290,7 @@ function PlayerMana.prototype:Update(unit, powertype) if (self.manaPercentage == 1 and self.manaType ~= SPELL_POWER_RAGE and self.manaType ~= SPELL_POWER_RUNIC_POWER) or (self.manaPercentage == 0 and (self.manaType == SPELL_POWER_RAGE or self.manaType == SPELL_POWER_RUNIC_POWER)) then self:SetupOnUpdate(false) - elseif GetCVarBool("predictedPower") then + else self:SetupOnUpdate(true) end diff --git a/modules/Threat.lua b/modules/Threat.lua index e5029e8..707f96a 100644 --- a/modules/Threat.lua +++ b/modules/Threat.lua @@ -176,6 +176,7 @@ function IceThreat.prototype:Enable(core) self.scheduledEvent = self:ScheduleRepeatingTimer("Update", 0.2) + self:SetScale(0, true, true) self:Update(self.unit) end @@ -391,6 +392,12 @@ function IceThreat.prototype:GetSecondHighestThreat() return secondHighestThreat end +function IceThreat.prototype:Show(bShouldShow) + IceThreat.super.prototype.Show(self, bShouldShow) + if not bShouldShow then + self:SetScale(0, true, true) + end +end -- Load us up IceHUD.IceThreat = IceThreat:new()