View Single Post
03-09-11, 02:29 PM   #2
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by Lily.Petal View Post
Is there anyway I can change the background color of a frame to show if that party member has aggro or not?

I can't seem to find any leads :<
-- OnLoad
Code:
self:RegisterEvent("UNIT_THREAT_SITUATION_UPDATE")
or

-- OnEvent
Code:
-- Replace unit with "party1" to "party4" for party members. Or ("target", "targettarget") for seeing threat on your target.
local status = UnitThreatSituation(unit, "target")
local r, g, b = GetThreatStatusColor(status)
self.bg:SetVertexColor(r, g, b)
UnitThreatSituation API

Hmm, may need a "UNIT_TARGET" event registered in OnLoad.

Last edited by Nibelheim : 03-09-11 at 02:35 PM.
  Reply With Quote