Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-09-10, 11:20 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Threat check

I want to color some of my textures in threat color.

Has anyone a running threat code to spare.

Not sure if tags can help me much since I need to adjust the VertexColor of textures based on given threat.

What I used in oUF 1.3.x was

function
Code:
  -- check threat
  local function check_threat(self,event,unit)
    if unit then
      if self.unit ~= unit then
        return
      end
      local threat = UnitThreatSituation(unit)
      if threat == 3 then
        self.Portrait_glosst:SetVertexColor(1,0,0)
      elseif threat == 2 then
        self.Portrait_glosst:SetVertexColor(1,0.6,0)
      else
        self.Portrait_glosst:SetVertexColor(0.37,0.3,0.3)
      end
    end
  end
call
Code:
self:RegisterEvent("UNIT_THREAT_SITUATION_UPDATE", check_threat)
Is this still the way to go or are there any other options?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
 

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


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