Thread Tools Display Modes
11-19-13, 10:46 PM   #1
reehay
A Murloc Raider
Join Date: Oct 2006
Posts: 9
Faction Indicator for Target Frame

Recently returned to Warcraft after 2 years away and I'm looking for an addon with a Faction Indicator for the Target Frame. Used to have an addon that put the dragon "elite" texture around the portrait if I targeted an enemy player but it doesnt work anymore. I've searched and searched but cant find it so please steer me in the right direction.

Thanks very much.

Last edited by reehay : 11-19-13 at 10:59 PM.
  Reply With Quote
11-19-13, 11:15 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Dry coded, but try this:

Code:
local alert
if UnitFactionGroup("player") == "Alliance" then
     alert = "Horde"
else
     alert = "Alliance"
end

hooksecurefunc("TargetFrame_CheckClassification", function(self)
     if UnitFactionGroup("target") == alert then
          self.borderTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Elite")
     end
end)
You can copy-paste the code here to turn it into an addon to download: http://addon.bool.no/
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-19-13, 11:26 PM   #3
reehay
A Murloc Raider
Join Date: Oct 2006
Posts: 9
Originally Posted by Seerah View Post
Dry coded, but try this:

Code:
local alert
if UnitFactionGroup("player") == "Alliance" then
     alert = "Horde"
else
     alert = "Alliance"
end

hooksecurefunc("TargetFrame_CheckClassification", function(self)
     if UnitFactionGroup("target") == alert then
          self.borderTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Elite")
     end
end)
You can copy-paste the code here to turn it into an addon to download: http://addon.bool.no/
umm I lub you; have my wow babies.

thanks so much for your efforts. I'll try that now!
  Reply With Quote
11-19-13, 11:53 PM   #4
reehay
A Murloc Raider
Join Date: Oct 2006
Posts: 9
it didnt work but you kinda got me interested in learning this stuff for myself so thanks again for trying!
  Reply With Quote
11-20-13, 12:23 AM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Originally Posted by reehay View Post
it didnt work but you kinda got me interested in learning this stuff for myself so thanks again for trying!
I don't see anything wrong with the logic.

Try replacing "TargetFrame_CheckClassification" with "TargetFrame_CheckFaction"
  Reply With Quote
11-20-13, 02:30 AM   #6
reehay
A Murloc Raider
Join Date: Oct 2006
Posts: 9
Originally Posted by Dridzt View Post
I don't see anything wrong with the logic.

Try replacing "TargetFrame_CheckClassification" with "TargetFrame_CheckFaction"
naw both didnt work. I tried with all other addons disabled as well - just to rule out addon conflict.

appreciate your help though.
  Reply With Quote
11-20-13, 01:52 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Perhaps the client doesn't know your faction yet as soon as you log in. Try this:

Code:
local f, alert
f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_LOGIN")
f:SetScript("OnEvent", function()
     if UnitFactionGroup("player") == "Alliance" then
          alert = "Horde"
     else
          alert = "Alliance"
     end
end)

hooksecurefunc("TargetFrame_CheckClassification", function(self)
     if UnitFactionGroup("target") == alert then
          self.borderTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Elite")
     end
end)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-20-13, 02:36 PM   #8
reehay
A Murloc Raider
Join Date: Oct 2006
Posts: 9
No luck. Maybe Im bugged or something. Im trying it with all addons disabled except this one you made for me. Still no luck. But thanks very much for taking the time. Please dont trouble yourself further. I can live without it.

Cheers, and happy gaming.
  Reply With Quote
11-20-13, 04:05 PM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Seerah View Post
Perhaps the client doesn't know your faction yet as soon as you log in.
It does. Your faction and class are definitely known in main-chunk territory. I vaguely recall name and level not being available at that time, but the last time I actually checked that was back in TBC (or maybe even vanilla) so I can't really speak for any other info, but faction and class are okay to check right away. I use them in several working addons.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Faction Indicator for Target Frame


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