mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- fixed TargetTargetMana bar to be able to use its own colors instead of inheriting what TargetMana was set to
This commit is contained in:
@ -2,6 +2,8 @@ local AceOO = AceLibrary("AceOO-2.0")
|
|||||||
|
|
||||||
IceTargetMana = AceOO.Class(IceUnitBar)
|
IceTargetMana = AceOO.Class(IceUnitBar)
|
||||||
IceTargetMana.prototype.registerEvents = true
|
IceTargetMana.prototype.registerEvents = true
|
||||||
|
IceTargetHealth.prototype.color = nil
|
||||||
|
IceTargetMana.prototype.determineColor = true
|
||||||
|
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
@ -80,24 +82,27 @@ function IceTargetMana.prototype:Update(unit)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.determineColor then
|
||||||
|
self.color = "TargetMana"
|
||||||
|
|
||||||
local color = "TargetMana"
|
if (self.moduleSettings.scaleManaColor) then
|
||||||
if (self.moduleSettings.scaleManaColor) then
|
self.color = "ScaledManaColor"
|
||||||
color = "ScaledManaColor"
|
end
|
||||||
end
|
|
||||||
if (manaType == 1) then
|
if (manaType == 1) then
|
||||||
color = "TargetRage"
|
self.color = "TargetRage"
|
||||||
elseif (manaType == 2) then
|
elseif (manaType == 2) then
|
||||||
color = "TargetFocus"
|
self.color = "TargetFocus"
|
||||||
elseif (manaType == 3) then
|
elseif (manaType == 3) then
|
||||||
color = "TargetEnergy"
|
self.color = "TargetEnergy"
|
||||||
|
end
|
||||||
|
|
||||||
|
if (self.tapped) then
|
||||||
|
self.color = "Tapped"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self.tapped) then
|
self:UpdateBar(self.manaPercentage, self.color)
|
||||||
color = "Tapped"
|
|
||||||
end
|
|
||||||
|
|
||||||
self:UpdateBar(self.manaPercentage, color)
|
|
||||||
|
|
||||||
if not IceHUD.IceCore:ShouldUseDogTags() then
|
if not IceHUD.IceCore:ShouldUseDogTags() then
|
||||||
self:SetBottomText1(math.floor(self.manaPercentage * 100))
|
self:SetBottomText1(math.floor(self.manaPercentage * 100))
|
||||||
|
@ -28,6 +28,8 @@ end
|
|||||||
|
|
||||||
function TargetTargetMana.prototype:Enable(core)
|
function TargetTargetMana.prototype:Enable(core)
|
||||||
self.registerEvents = false
|
self.registerEvents = false
|
||||||
|
-- make sure the super class doesn't override our color selection
|
||||||
|
self.determineColor = false
|
||||||
TargetTargetMana.super.prototype.Enable(self, core)
|
TargetTargetMana.super.prototype.Enable(self, core)
|
||||||
|
|
||||||
self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.1, self, "targettarget")
|
self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.1, self, "targettarget")
|
||||||
@ -39,5 +41,29 @@ function TargetTargetMana.prototype:Disable(core)
|
|||||||
self:CancelScheduledEvent(self.elementName)
|
self:CancelScheduledEvent(self.elementName)
|
||||||
end
|
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
|
-- Load us up
|
||||||
IceHUD.TargetTargetMana = TargetTargetMana:new()
|
IceHUD.TargetTargetMana = TargetTargetMana:new()
|
||||||
|
Reference in New Issue
Block a user