So, for anyone potentially following the thread..
I have finished this finally, and have working code for BfA. (A couple things were removed from UnitBuff, namely spell rank, so this code won't specifically work on live but it's easily fixable if you so choose)
The only, and major problem is that this doesn't update often enough when I need it to. If anyone has any suggestions on how I can update it more frequently, I'm open to suggestion. It updates every time an aura gets updated (applied or removed), but for this to be truly perfect it would probably need to update at least every half second with lifebloom up, regardless of anything else.
As a result, sometimes even though LB can be manually "bloomed" at 5.5 seconds, the highlight won't appear until after that. The amount of time after that varies depending on how often auras are being updated for the unit.
Lua Code:
--Target Frame
function TargetFrame_UpdateAuras_Hook(self)
local frame, frameName
local selfName = self:GetName()
for i = 1, MAX_TARGET_BUFFS do
local buffName, icon, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal,
spellId, canApplyAura, isBossDebuff, casterIsPlayer, nameplateShowAll, timeMod, _ = UnitBuff(self.unit, i, nil)
if buffName then
if spellId == 33763 and casterIsPlayer then
frameName = selfName.."Buff"..(i)
frame = _G[frameName]
if frame and icon and (not self.maxBuffs or i <= self.maxBuffs) then
local timeRemaining = (expirationTime - GetTime()) / timeMod
local refreshTime = duration * 0.3
local frameStealable = _G[frameName.."Stealable"]
if timeRemaining <= refreshTime then
frameStealable:Show()
else
frameStealable:Hide()
end
end
break
end
else
break
end
end
end
hooksecurefunc("TargetFrame_UpdateAuras", TargetFrame_UpdateAuras_Hook)
--Compact Unit Frame
function CompactUnitFrame_UtilSetBuff_Hook(buffFrame, unit, index, filter)
local buffName, icon, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal,
spellId, canApplyAura, isBossDebuff, casterIsPlayer, nameplateShowAll, timeMod, _ = UnitBuff(unit, index, filter)
if spellId == 33763 and casterIsPlayer then
local timeRemaining = (expirationTime - GetTime()) / timeMod
local refreshTime = duration * 0.3
if not buffFrame.highlight then
local highlight = buffFrame:CreateTexture(nil, "OVERLAY")
highlight:SetTexture([[Interface\TargetingFrame\UI-TargetingFrame-Stealable]])
highlight:SetPoint("TOPLEFT", -3, 3)
highlight:SetPoint("BOTTOMRIGHT", 3, -3)
highlight:SetBlendMode("ADD")
buffFrame.highlight = highlight
end
if timeRemaining <= refreshTime then
buffFrame.highlight:Show()
else
buffFrame.highlight:Hide()
end
elseif buffFrame.highlight then
buffFrame.highlight:Hide()
end
end
hooksecurefunc("CompactUnitFrame_UtilSetBuff", CompactUnitFrame_UtilSetBuff_Hook)