mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- more minor cleanups before tagging a new release version
This commit is contained in:
@ -135,10 +135,10 @@ function IceCastBar.prototype:OnUpdate()
|
||||
-- handle casting and channeling
|
||||
if (self.action == IceCastBar.Actions.Cast or self.action == IceCastBar.Actions.Channel) then
|
||||
local remainingTime = self.actionStartTime + self.actionDuration - time
|
||||
local scale = 1 - (self.actionDuration > 0 and remainingTime / self.actionDuration or 0)
|
||||
local scale = 1 - (self.actionDuration ~= 0 and remainingTime / self.actionDuration or 0)
|
||||
|
||||
if (self.action == IceCastBar.Actions.Channel) then
|
||||
scale = self.actionDuration > 0 and remainingTime / self.actionDuration or 0
|
||||
scale = self.actionDuration ~= 0 and remainingTime / self.actionDuration or 0
|
||||
end
|
||||
|
||||
if (remainingTime < 0) then
|
||||
|
@ -203,11 +203,11 @@ function IceUnitBar.prototype:Update()
|
||||
|
||||
self.health = UnitHealth(self.unit)
|
||||
self.maxHealth = UnitHealthMax(self.unit)
|
||||
self.healthPercentage = self.maxHealth > 0 and (self.health/self.maxHealth) or 0
|
||||
self.healthPercentage = self.maxHealth ~= 0 and (self.health/self.maxHealth) or 0
|
||||
|
||||
self.mana = UnitMana(self.unit)
|
||||
self.maxMana = UnitManaMax(self.unit)
|
||||
self.manaPercentage = self.maxMana > 0 and (self.mana/self.maxMana) or 0
|
||||
self.manaPercentage = self.maxMana ~= 0 and (self.mana/self.maxMana) or 0
|
||||
|
||||
_, self.unitClass = UnitClass(self.unit)
|
||||
|
||||
|
@ -278,7 +278,7 @@ function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate)
|
||||
remaining = self.auraEndTime - now
|
||||
end
|
||||
|
||||
self:UpdateBar(self.auraDuration > 0 and remaining / self.auraDuration or 0, "undef")
|
||||
self:UpdateBar(self.auraDuration ~= 0 and remaining / self.auraDuration or 0, "undef")
|
||||
else
|
||||
self:UpdateBar(0, "undef")
|
||||
self:Show(false)
|
||||
|
@ -59,7 +59,7 @@ function DruidMana.prototype:Update()
|
||||
self:Show(true)
|
||||
end
|
||||
|
||||
self:UpdateBar(self.druidManaMax > 0 and self.druidMana / self.druidManaMax or 0, "DruidMana")
|
||||
self:UpdateBar(self.druidManaMax ~= 0 and self.druidMana / self.druidManaMax or 0, "DruidMana")
|
||||
end
|
||||
|
||||
|
||||
|
@ -161,7 +161,7 @@ function GlobalCoolDown.prototype:UpdateGlobalCoolDown()
|
||||
|
||||
self:Show(false)
|
||||
else
|
||||
self:UpdateBar(1 - (self.duration > 0 and remaining / self.duration or 0), "GlobalCoolDown", 0.8)
|
||||
self:UpdateBar(1 - (self.duration ~= 0 and remaining / self.duration or 0), "GlobalCoolDown", 0.8)
|
||||
end
|
||||
else
|
||||
self:Show(false)
|
||||
|
@ -191,9 +191,9 @@ function HungerForBlood.prototype:UpdateHungerForBlood(unit, fromUpdate)
|
||||
remaining = hfbEndTime - now
|
||||
end
|
||||
if (hfbBuffCount ~= nil and hfbBuffCount > 2) then
|
||||
self:UpdateBar(hfbDuration > 0 and remaining / hfbDuration or 0, "HungerForBloodMax")
|
||||
self:UpdateBar(hfbDuration ~= 0 and remaining / hfbDuration or 0, "HungerForBloodMax")
|
||||
else
|
||||
self:UpdateBar(hfbDuration > 0 and remaining / hfbDuration or 0, "HungerForBlood")
|
||||
self:UpdateBar(hfbDuration ~= 0 and remaining / hfbDuration or 0, "HungerForBlood")
|
||||
end
|
||||
|
||||
formatString = self.moduleSettings.upperText or ''
|
||||
|
@ -73,7 +73,7 @@ function MirrorBar.prototype:OnUpdate(elapsed)
|
||||
|
||||
self.value = self.value + (self.timerScale * elapsed * 1000)
|
||||
|
||||
scale = self.maxValue > 0 and self.value / self.maxValue or 0
|
||||
scale = self.maxValue ~= 0 and self.value / self.maxValue or 0
|
||||
|
||||
if (scale < 0) then -- lag compensation
|
||||
scale = 0
|
||||
|
@ -226,7 +226,7 @@ function SliceAndDice.prototype:UpdateSliceAndDice(unit, fromUpdate)
|
||||
remaining = sndEndTime - now
|
||||
end
|
||||
local denominator = (self.moduleSettings.showAsPercentOfMax and CurrMaxSnDDuration or sndDuration)
|
||||
self:UpdateBar(denominator > 0 and remaining / denominator or 0, "SliceAndDice")
|
||||
self:UpdateBar(denominator ~= 0 and remaining / denominator or 0, "SliceAndDice")
|
||||
|
||||
formatString = self.moduleSettings.upperText or ''
|
||||
else
|
||||
|
@ -294,7 +294,7 @@ function TargetCC.prototype:UpdateTargetDebuffs(unit, isUpdate)
|
||||
self:Show(true)
|
||||
|
||||
if (duration ~= nil and duration > 0) then
|
||||
self:UpdateBar(duration > 0 and remaining / duration or 0, "CC:" .. self.debuffList[name])
|
||||
self:UpdateBar(duration ~= 0 and remaining / duration or 0, "CC:" .. self.debuffList[name])
|
||||
self:SetBottomText2(floor(remaining * 10) / 10)
|
||||
else
|
||||
self:UpdateBar(0, "CC:" .. self.debuffList[name])
|
||||
|
Reference in New Issue
Block a user