Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-04-10, 12:39 AM   #1
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
Threat indication

Hi, was wondering if anyone could help me with this. Basically, I like oUF_Banzai, but it doesn't show when players have high threat like the default Blizz frames do, it only shows when they have aggro. what I'm trying to do is mimic the default party frame's threat indication as closely as I can.
(border = yellow when unit has high threat, red when has aggro, etc...)

this is what I have for the function so far.... it's a bit of a mess right now 'cuz I just started on it today and I'm a total noob


Code:
local updateThreat = function(self, event, unit)
	if(unit and unit ~= self.unit) then
	elseif unit == nil then
	else
		local threatSituation = UnitThreatSituation(unit)
		local Tr, Tg, Tb = GetThreatStatusColor(threatSituation)
		if (threatSituation and threatSituation > 0) then
			self.Border:SetBackdropBorderColor(Tr, Tg, Tb, 1)
		else
			self.Border:SetBackdropBorderColor(.3, .3, .3, 1)
		end
	end
--[[
Registered to:

"UNIT_THREAT_SITUATION_UPDATE"
"RAID_ROSTER_UPDATE"
"PARTY_MEMBERS_CHANGED"
--]]

end
it actually works for the most part.... just doesn't work entirely.... I'm guessing it's because I'm not checking for threat against another unit, but I didn't want it to be limited to the unit's target or player's target (whole point is for healing, good to know if someone is going to pull aggro on something durring AOE, seeing how this seems to be incredibly common now). the blizz frames actually have this functionality, but it's been a mess trying to track down exactly how it's done.

this is how the blizzard frames seem to decide what to check threat against:

Code:
		if ( indicator.feedbackUnit ~= indicator.unit ) then
			status = UnitThreatSituation(indicator.feedbackUnit, indicator.unit);
		else
			status = UnitThreatSituation(indicator.feedbackUnit);
		end
but I can't track down (entirely) where they get indicator.feedbackUnit and indicator.unit from.

anyways, this is a kinda long post... gonna stop it here, I think I gave enough info for you all to see what I'm trying to do, what i have and what I've tried.



Thanks
Aerials
  Reply With Quote
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Threat indication


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off