- fixed TargetTargetMana bar to be able to use its own colors instead of inheriting what TargetMana was set to

This commit is contained in:
Parnic
2008-11-26 16:38:46 +00:00
parent 98d8dfe438
commit c094e2930c
2 changed files with 46 additions and 15 deletions

View File

@ -28,6 +28,8 @@ end
function TargetTargetMana.prototype:Enable(core)
self.registerEvents = false
-- make sure the super class doesn't override our color selection
self.determineColor = false
TargetTargetMana.super.prototype.Enable(self, core)
self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.1, self, "targettarget")
@ -39,5 +41,29 @@ function TargetTargetMana.prototype:Disable(core)
self:CancelScheduledEvent(self.elementName)
end
function TargetTargetMana.prototype:Update(unit)
self.color = "TargetTargetMana"
local manaType = UnitPowerType(self.unit)
if (self.moduleSettings.scaleManaColor) then
self.color = "ScaledManaColor"
end
if (manaType == 1) then
self.color = "TargetTargetRage"
elseif (manaType == 2) then
self.color = "TargetTargetFocus"
elseif (manaType == 3) then
self.color = "TargetTargetEnergy"
end
if (self.tapped) then
self.color = "Tapped"
end
TargetTargetMana.super.prototype.Update(self, unit)
end
-- Load us up
IceHUD.TargetTargetMana = TargetTargetMana:new()