- updated all UnitPower* code to use the SPELL_POWER_* constants instead of hardcoding numbers...mostly just a readability change

This commit is contained in:
Parnic
2010-09-10 01:50:43 +00:00
parent 22fd66d756
commit 8d4686f10c
7 changed files with 27 additions and 55 deletions

View File

@ -155,8 +155,8 @@ function PetMana.prototype:Update(unit)
self:Show(true)
end
if (self.manaPercentage == 1 and self.manaType ~= 1 and self.manaType ~= 6)
or (self.manaPercentage == 0 and (self.manaType == 1 or self.manaType == 6)) then
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
self:SetupOnUpdate(true)
@ -169,11 +169,11 @@ function PetMana.prototype:Update(unit)
if not (self.alive) then
color = "Dead"
else
if (self.manaType == 1) then
if (self.manaType == SPELL_POWER_RAGE) then
color = "PetRage"
elseif (self.manaType == 2) then
elseif (self.manaType == SPELL_POWER_FOCUS) then
color = "PetFocus"
elseif (self.manaType == 3) then
elseif (self.manaType == SPELL_POWER_ENERGY) then
color = "PetEnergy"
end
end