Originally Posted by vlakarados
Could you add some conditional where threat will be updated by UNIT_THREAT_LIST_UPDATE, instead of that UNIT_THREAT_SITUATION_UPDATE ? Like Threat.FrequentUpdates?
_SITUATION_ is nice to use with raid frames as you see when someone gets aggro or loses, but for a players threat meter it's not enough.
Thank you.
|
I use this..
Code:
local function UpdateThreat(self, _, unit)
if (self.unit ~= unit) then
return
end
if (self.Aggro) then
local threat = UnitThreatSituation(self.unit)
if (threat == 3) then
self.Aggro:SetText('|cFFFF0000AGGRO')
self.Health:SetBackdropColor(0.9, 0, 0)
else
self.Aggro:SetText('')
self.Health:SetBackdropColor(0, 0, 0)
end
end
end
Code:
self.Aggro = self.Health:CreateFontString(nil, 'OVERLAY')
self.Aggro:SetPoint('CENTER', self.Health, 'BOTTOM')
self.Aggro:SetFont(font, 11, 'THINOUTLINE')
table.insert(self.__elements, UpdateThreat)
self:RegisterEvent('PLAYER_TARGET_CHANGED', UpdateThreat)
self:RegisterEvent('UNIT_THREAT_LIST_UPDATE', UpdateThreat)
self:RegisterEvent('UNIT_THREAT_SITUATION_UPDATE', UpdateThreat)