Show text on Absorb and AltMana with DogTags disabled

This commit is contained in:
Parnic
2018-02-10 17:45:09 -06:00
parent 8105567792
commit 0dddbd9b1a
2 changed files with 21 additions and 0 deletions

View File

@ -76,6 +76,7 @@ function PlayerAltMana.prototype:Update()
self.PlayerAltMana = UnitPower(self.unit, SPELL_POWER_MANA)
self.PlayerAltManaMax = UnitPowerMax(self.unit, SPELL_POWER_MANA)
self.PlayerAltManaPercentage = self.PlayerAltManaMax ~= 0 and (self.PlayerAltMana/self.PlayerAltManaMax) or 0
if (not self.alive or not ShouldShow(self.unit) or not self.PlayerAltMana or not self.PlayerAltManaMax or self.PlayerAltManaMax == 0) then
self:Show(false)
@ -84,6 +85,16 @@ function PlayerAltMana.prototype:Update()
self:Show(true)
end
if not IceHUD.IceCore:ShouldUseDogTags() and self.frame:IsVisible() then
self:SetBottomText1(math.floor(self.PlayerAltManaPercentage * 100))
if (self.PlayerAltManaMax ~= 100) then
self:SetBottomText2(self:GetFormattedText(self:Round(self.PlayerAltMana), self:Round(self.PlayerAltManaMax)), "PlayerMana")
else
self:SetBottomText2()
end
end
self:UpdateBar(self.PlayerAltManaMax ~= 0 and self.PlayerAltMana / self.PlayerAltManaMax or 0, "PlayerAltMana")
end

View File

@ -63,12 +63,22 @@ function IceTargetAbsorb.prototype:UpdateAbsorbAmount(event, unit)
self.highestAbsorbSinceLastZero = absorbAmount
end
self.absorbPercent = self.highestAbsorbSinceLastZero ~= 0 and absorbAmount / self.highestAbsorbSinceLastZero or 0
if absorbAmount <= 0 or self.highestAbsorbSinceLastZero <= 0 then
self:Show(false)
else
self:Show(true)
self:UpdateBar(absorbAmount / self.highestAbsorbSinceLastZero, self.ColorName)
end
if not IceHUD.IceCore:ShouldUseDogTags() and self.frame:IsVisible() then
if (self.PlayerAltManaMax ~= 100) then
self:SetBottomText1(self:GetFormattedText(self:Round(absorbAmount)), self.ColorName)
else
self:SetBottomText1()
end
end
end
function IceTargetAbsorb.prototype:Disable(core)