Thread Tools Display Modes
09-04-14, 09:36 AM   #1
Xxplosiv3xX
A Murloc Raider
Join Date: Aug 2014
Posts: 8
Class colored player frames (pics included)

Hey guys,

I was curious to know if anyone knows the addon to change player target/focus frames to be class colored.

Thanks.



  Reply With Quote
09-04-14, 03:28 PM   #2
Nynaeve
A Cobalt Mageweaver
 
Nynaeve's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 245
For clarification's sake, you only want the background of the name frame colored, you don't want anything else present in the screenshots? (For example the class icon instead of character portrait on that target frame in the second SS?)
There are plenty of addons that include the name background coloring, but also have a ton of other tweaks and features (though IDK if they're still working, I don't care for the default UF's myself and use SUF on live).

If all you want is the name background colored for certain units, I can upload that right now, as I had done that for beta.

If you wanted a ton of other options, you could try something like UnitFramesImproved or Sennetta's Custom Script UI or one of the other addons that include that.

As for the particular addon that the screenshot is likely of, I think it's a modified version of Santa UI(specifically Santa UI Textures ), that's why the outlines of the unit frames are darker, in case you were wondering.

Edit:

File uploaded and likely approved at any moment. Fabulous mods are fabulous.

Here it is if you want it.
__________________
"For in the plot we find more than just a man, we find the idea of that man, the spirit of that man, and that is what we must never forget." Evey (V)

Last edited by Nynaeve : 09-04-14 at 09:18 PM. Reason: Don't like to double post, wanted to add the new addon link.
  Reply With Quote
09-04-14, 09:04 PM   #3
Xxplosiv3xX
A Murloc Raider
Join Date: Aug 2014
Posts: 8
awesome! just what I was looking for!

Thanks!
  Reply With Quote
09-05-14, 03:09 PM   #4
Xxplosiv3xX
A Murloc Raider
Join Date: Aug 2014
Posts: 8
Hey, so I pretty much have my frames the way I wanted with your awesome addon script and santaUI textures, but there seems to be an issue with my health/mana/energy bar. I dont know what is causing this but the class color appears to also be the backdrop of my resource/health bars. I'll link a pic to show you what I mean.

  Reply With Quote
09-05-14, 03:46 PM   #5
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Smile

I did this the other day too, you actually have to create a new texture correctly sized and parented to PlayerFrameBackground rather than modifying the frame itself - else, as you've noticed, the entire unit background is recoloured.



Lua Code:
  1. --
  2.     if PlayerFrame:IsShown() and not bg then
  3.         local _, class = UnitClass("player")
  4.         local colour = RAID_CLASS_COLORS[class]
  5.         local bg = PlayerFrame:CreateTexture(nil, "ARTWORK")
  6.            
  7.         bg:SetPoint("TOPLEFT", PlayerFrameBackground)
  8.         bg:SetPoint("BOTTOMRIGHT", PlayerFrameBackground, 0, 22)
  9.         bg:SetVertexColor(colour.r, colour.g, colour.b, .95)
  10.         bg:SetTexture("texturepath")
  11.     end

Last edited by ObbleYeah : 09-05-14 at 03:49 PM.
  Reply With Quote
09-05-14, 04:52 PM   #6
Xxplosiv3xX
A Murloc Raider
Join Date: Aug 2014
Posts: 8
Sorry im pretty new to coding with .lua. How would I go about turning this into an addon?
  Reply With Quote
09-05-14, 05:40 PM   #7
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by Xxplosiv3xX View Post
Sorry im pretty new to coding with .lua. How would I go about turning this into an addon?
You could use http://addon.bool.no
  Reply With Quote
09-06-14, 12:11 PM   #8
Xxplosiv3xX
A Murloc Raider
Join Date: Aug 2014
Posts: 8
Sorry guys, I still can't seem to fix it... Does anyone have a working solution?
  Reply With Quote
09-06-14, 02:03 PM   #9
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Collecting the posted snippets I'd try it this way
Download: zz_ClassColor.zip

Lua Code:
  1. local ClassColorUnits = {
  2.     ["target"] = {
  3.         ["name"] = "TargetFrame",
  4.         ["back"] = "TargetFrame",
  5.         ["x-offset"] = -104,
  6.         ["y-offset"] = 60,
  7.         ["x-offset2"] = 6,
  8.         ["y-offset2"] = -22,
  9.     },
  10.     ["player"] = {
  11.         ["name"] = "PlayerFrame",
  12.         ["back"] = "PlayerFrameBackground",
  13.         ["x-offset"] = 0,
  14.         ["y-offset"] = 22,
  15.         ["x-offset2"] = 0,
  16.         ["y-offset2"] = 0,
  17.     },
  18.     ["focus"] = {
  19.         ["name"] = "FocusFrame",
  20.         ["back"] = "FocusFrame",
  21.         ["x-offset"] = -104,
  22.         ["y-offset"] = 60,
  23.         ["x-offset2"] = 6,
  24.         ["y-offset2"] = -22,
  25.     },
  26. }
  27. local function updateClassColor(unit)
  28.     if(unit and UnitExists(unit)) then
  29.         local _,class = UnitClass(unit)
  30.         if(class and RAID_CLASS_COLORS[class]) then
  31.             if(ClassColorUnits[unit]) then
  32.                 local uf = _G[ClassColorUnits[unit]['name']]
  33.                 local bg = _G[ClassColorUnits[unit]['back']]
  34.                 if(not uf['unitClassColorBack']) then
  35.                     uf['unitClassColorBack'] = uf:CreateTexture(nil, "ARTWORK")
  36.                     uf['unitClassColorBack']:SetPoint("TOPLEFT", bg, ClassColorUnits[unit]['x-offset2'], ClassColorUnits[unit]['y-offset2'])
  37.                     uf['unitClassColorBack']:SetPoint("BOTTOMRIGHT", bg, ClassColorUnits[unit]['x-offset'], ClassColorUnits[unit]['y-offset'])
  38.                     uf['unitClassColorBack']:SetTexture("Interface\\TargetingFrame\\UI-StatusBar")
  39.                 end
  40.                 local col = RAID_CLASS_COLORS[class]
  41.                 uf['unitClassColorBack']:SetVertexColor(col['r'], col['g'], col['b'])
  42.             end
  43.         end
  44.     end
  45. end
  46.  
  47. local frame = CreateFrame("Frame")
  48. frame:RegisterEvent("PLAYER_FOCUS_CHANGED")
  49. frame:RegisterEvent("PLAYER_TARGET_CHANGED")
  50. frame:RegisterEvent("PLAYER_ENTERING_WORLD")
  51. frame:SetScript("OnEvent", function(self, event)
  52.     if(event=="PLAYER_FOCUS_CHANGED") then
  53.         updateClassColor('focus')
  54.     elseif(event=="PLAYER_TARGET_CHANGED") then
  55.         updateClassColor('target')
  56.     elseif(event=="PLAYER_ENTERING_WORLD") then
  57.         updateClassColor('player')
  58.         self:UnregisterEvent(event)
  59.     end
  60. end)
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
09-06-14, 03:39 PM   #10
Xxplosiv3xX
A Murloc Raider
Join Date: Aug 2014
Posts: 8
WOOT

thanks!
  Reply With Quote
09-06-14, 03:48 PM   #11
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Originally Posted by Xxplosiv3xX View Post
WOOT

thanks!
Wait a few hours ... normally I get some corrections to my code
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
09-06-14, 04:06 PM   #12
Xxplosiv3xX
A Murloc Raider
Join Date: Aug 2014
Posts: 8
Is there a way to edit the lua to make friendly NPCs green and enemy NPCs red?

Right now their class colored and it looks akward (banker is brown(warrior)) lol
  Reply With Quote
09-07-14, 01:35 AM   #13
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
For a quick solution you can remove the target part and it will just color player and focus.
Lua Code:
  1. ["target"] = {
  2.         ["name"] = "TargetFrame",
  3.         ["back"] = "TargetFrame",
  4.         ["x-offset"] = -104,
  5.         ["y-offset"] = 60,
  6.         ["x-offset2"] = 6,
  7.         ["y-offset2"] = -22,
  8.     },
For a longer solution replace the 'SetVertexColor' line with
Lua Code:
  1. if(not UnitIsPlayer(unit)) then
  2.                     uf['unitClassColorBack']:SetVertexColor(0, 0, 0, 0)
  3.                 else
  4.                     uf['unitClassColorBack']:SetVertexColor(col['r'], col['g'], col['b'],1)
  5.                 end
NPC are mostly warriors or mages. Thats a generic value for them
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Class colored player frames (pics included)

Thread Tools
Display Modes

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