- more minor cleanups before tagging a new release version

This commit is contained in:
Parnic
2009-04-19 00:49:33 +00:00
parent 9a8d5317c9
commit 0a0a816701
9 changed files with 13 additions and 13 deletions

View File

@ -135,10 +135,10 @@ function IceCastBar.prototype:OnUpdate()
-- handle casting and channeling -- handle casting and channeling
if (self.action == IceCastBar.Actions.Cast or self.action == IceCastBar.Actions.Channel) then if (self.action == IceCastBar.Actions.Cast or self.action == IceCastBar.Actions.Channel) then
local remainingTime = self.actionStartTime + self.actionDuration - time 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 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 end
if (remainingTime < 0) then if (remainingTime < 0) then

View File

@ -203,11 +203,11 @@ function IceUnitBar.prototype:Update()
self.health = UnitHealth(self.unit) self.health = UnitHealth(self.unit)
self.maxHealth = UnitHealthMax(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.mana = UnitMana(self.unit)
self.maxMana = UnitManaMax(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) _, self.unitClass = UnitClass(self.unit)

View File

@ -278,7 +278,7 @@ function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate)
remaining = self.auraEndTime - now remaining = self.auraEndTime - now
end 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 else
self:UpdateBar(0, "undef") self:UpdateBar(0, "undef")
self:Show(false) self:Show(false)

View File

@ -59,7 +59,7 @@ function DruidMana.prototype:Update()
self:Show(true) self:Show(true)
end 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 end

View File

@ -161,7 +161,7 @@ function GlobalCoolDown.prototype:UpdateGlobalCoolDown()
self:Show(false) self:Show(false)
else 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 end
else else
self:Show(false) self:Show(false)

View File

@ -191,9 +191,9 @@ function HungerForBlood.prototype:UpdateHungerForBlood(unit, fromUpdate)
remaining = hfbEndTime - now remaining = hfbEndTime - now
end end
if (hfbBuffCount ~= nil and hfbBuffCount > 2) then 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 else
self:UpdateBar(hfbDuration > 0 and remaining / hfbDuration or 0, "HungerForBlood") self:UpdateBar(hfbDuration ~= 0 and remaining / hfbDuration or 0, "HungerForBlood")
end end
formatString = self.moduleSettings.upperText or '' formatString = self.moduleSettings.upperText or ''

View File

@ -73,7 +73,7 @@ function MirrorBar.prototype:OnUpdate(elapsed)
self.value = self.value + (self.timerScale * elapsed * 1000) 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 if (scale < 0) then -- lag compensation
scale = 0 scale = 0

View File

@ -226,7 +226,7 @@ function SliceAndDice.prototype:UpdateSliceAndDice(unit, fromUpdate)
remaining = sndEndTime - now remaining = sndEndTime - now
end end
local denominator = (self.moduleSettings.showAsPercentOfMax and CurrMaxSnDDuration or sndDuration) 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 '' formatString = self.moduleSettings.upperText or ''
else else

View File

@ -294,7 +294,7 @@ function TargetCC.prototype:UpdateTargetDebuffs(unit, isUpdate)
self:Show(true) self:Show(true)
if (duration ~= nil and duration > 0) then 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) self:SetBottomText2(floor(remaining * 10) / 10)
else else
self:UpdateBar(0, "CC:" .. self.debuffList[name]) self:UpdateBar(0, "CC:" .. self.debuffList[name])