Reply
Thread Tools Display Modes
Unread 04-13-09, 11:01 AM   #1
Imithat
A Deviate Faerie Dragon
 
Imithat's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 16
StatusColour help

Hi

i only need the colour class on the player/target unit frames but not in the group frames. where i do this?

(StatusColour from Slakah

Last edited by Imithat : 04-13-09 at 11:33 AM.
Imithat is offline   Reply With Quote
Unread 04-13-09, 02:24 PM   #2
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Open up StatusColour.lua using some kind of text editor and replace the content with:

Code:
local   UnitIsPlayer, UnitIsConnected, UnitClass, RAID_CLASS_COLORS =
        UnitIsPlayer, UnitIsConnected, UnitClass, RAID_CLASS_COLORS
local _, class, colour

local function hook(statusbar, unit)
    if (unit == "player" or unit == "target") and UnitIsPlayer(unit) and UnitIsConnected and unit == statusbar.unit and UnitClass(unit) then
        _, class = UnitClass(unit)
        colour = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
        statusbar:SetStatusBarColor(colour.r, colour.g, colour.b)
    end
end

hooksecurefunc("UnitFrameHealthBar_Update", hook)
hooksecurefunc("HealthBar_OnValueChanged", function(self)
	hook(self, self.unit)
end)
Slakah is offline   Reply With Quote
Unread 04-13-09, 03:38 PM   #3
Imithat
A Deviate Faerie Dragon
 
Imithat's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 16
Thumbs up

Ahhh great!
thanks a lot
Imithat is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Lua/XML Help » StatusColour help

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