Merge remote-tracking branch 'github/master'

This commit is contained in:
Parnic
2019-09-04 17:52:07 -05:00
2 changed files with 63 additions and 14 deletions

View File

@ -842,21 +842,46 @@ function IceTargetHealth.prototype:Update(unit)
self:UpdateBar(self.healthPercentage, self.color)
if not IceHUD.IceCore:ShouldUseDogTags() and self.frame:IsVisible() then
self:SetBottomText1(math.floor(self.healthPercentage * 100))
if IsAddOnLoaded("RealMobHealth") then
if not IceHUD.IceCore:ShouldUseDogTags() and self.frame:IsVisible() then
self:SetBottomText1(math.floor(self.healthPercentage * 100))
if self.moduleSettings.abbreviateHealth then
self.health = self:Round(self.health)
self.maxHealth = self:Round(self.maxHealth)
end
if self.moduleSettings.abbreviateHealth then
if RealMobHealth.UnitHasHealthData(unit) then
self.health, self.maxHealth = RealMobHealth.GetUnitHealth(unit)
end
self.health = self:Round(self.health)
self.maxHealth = self:Round(self.maxHealth)
end
if (self.maxHealth ~= 100) then
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), self.color)
else
self:SetBottomText2()
if RealMobHealth.UnitHasHealthData(unit) or (self.maxHealth ~= 100) then
if RealMobHealth.UnitHasHealthData(unit) then
self.health, self.maxHealth = RealMobHealth.GetUnitHealth(unit)
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), self.color)
else
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), self.color)
end
else
self:SetBottomText2()
end
end
else
if not IceHUD.IceCore:ShouldUseDogTags() and self.frame:IsVisible() then
self:SetBottomText1(math.floor(self.healthPercentage * 100))
if self.moduleSettings.abbreviateHealth then
self.health = self:Round(self.health)
self.maxHealth = self:Round(self.maxHealth)
end
if (self.maxHealth ~= 100) then
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), self.color)
else
self:SetBottomText2()
end
end
end
self:CheckPvP()
self:CheckPartyRole()
self:SetIconAlpha()

View File

@ -12,6 +12,10 @@ local internal = "internal"
local ValidAnchors = { "TOPLEFT", "TOPRIGHT", "BOTTOMLEFT", "BOTTOMRIGHT", "CENTER" }
---- Fulzamoth - 2019-09-04 : support for cooldowns on target buffs/debuffs (classic)
local LibClassicDurations = LibStub("LibClassicDurations", 1)
---- end change by Fulzamoth
IceTargetInfo.prototype.unit = "target"
IceTargetInfo.prototype.buffSize = nil
@ -1410,11 +1414,31 @@ function IceTargetInfo.prototype:UpdateBuffType(aura)
if self.moduleSettings.auras[aura].show then
for i = 1, IceCore.BuffLimit do
local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable
if IceHUD.WowVer < 80000 and not IceHUD.WowClassic then
---- Fulzamoth - 2019-09-04 : support for cooldowns on target buffs/debuffs (classic)
local spellID
---- end change by Fulzamoth
if IceHUD.WowVer < 80000 and not IceHUD.WowClassic then
name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable = UnitAura(self.unit, i, reaction .. (filter and "|PLAYER" or ""))
else
name, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable = UnitAura(self.unit, i, reaction .. (filter and "|PLAYER" or ""))
end
---- Fulzamoth - 2019-09-04 : support for cooldowns on target buffs/debuffs (classic)
-- 1. in addition to other info, get the spellID for for the (de)buff
name, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, _, spellID = UnitAura(self.unit, i, reaction .. (filter and "|PLAYER" or ""))
-- name, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable = UnitAura(self.unit, i, reaction .. (filter and "|PLAYER" or ""))
if duration == 0 and LibClassicDurations then
-- 2. if no duration defined for the (de)buff, look up the spell in LibClassicDurations
local classicDuration, classicExpirationTime = LibClassicDurations:GetAuraDurationByUnit(self.unit, spellID, caster)
-- 3. set the duration if we found one.
if classicDuration then
duration = classicDuration
expirationTime = classicExpirationTime
end
end
---- end change by Fulzamoth
end
local isFromMe = (unitCaster == "player")
if not icon and IceHUD.IceCore:IsInConfigMode() and UnitExists(self.unit) then