libpredict: add healcomm compability for vanilla hots

This commit is contained in:
gwetchen
2024-11-04 12:13:19 +01:00
committed by GitHub
parent afba5fe60b
commit b423b9b32d
2 changed files with 86 additions and 4 deletions
+29 -3
View File
@@ -1736,9 +1736,35 @@ function pfUI.uf:RefreshUnit(unit, component)
-- match filter
for _, filter in pairs(unit.indicators) do
if filter == string.lower(texture) then
pfUI.uf:AddIcon(unit, pos, texture, timeleft, count)
pos = pos + 1
break
if string.lower(texture) == "interface\\icons\\spell_nature_rejuvenation" then --I'd like to do all 3 hots in one if statement later. TODO: check TBC compatibility
local start, duration = libpredict:getHoTTime(unitstr, "Reju") --get rejuv start and runtime
if start and duration then --show the buff even if time is unknown, important as pfUI seems to see the buff before healcomm/libpredict processing is done
timeleft = (start + duration) - GetTime()
end
pfUI.uf:AddIcon(unit, pos, texture, timeleft, count)
pos = pos + 1
break
elseif string.lower(texture) == "interface\\icons\\spell_holy_renew" then
local start, duration = libpredict:getHoTTime(unitstr, "Renew")
if start and duration then
timeleft = (start + duration) - GetTime()
end
pfUI.uf:AddIcon(unit, pos, texture, timeleft, count)
pos = pos + 1
break
elseif string.lower(texture) == "interface\\icons\\spell_nature_resistnature" then
local start, duration = libpredict:getHoTTime(unitstr, "Regr")
if start and duration then
timeleft = (start + duration) - GetTime()
end
pfUI.uf:AddIcon(unit, pos, texture, timeleft, count)
pos = pos + 1
break
else
pfUI.uf:AddIcon(unit, pos, texture, timeleft, count)
pos = pos + 1
break
end
end
end
end