View Single Post
12-30-11, 06:16 AM   #2
whoarrior
A Deviate Faerie Dragon
 
whoarrior's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 14
Code:
local color = nil
local w = CreateFrame("Frame")
w:RegisterEvent("PLAYER_FOCUS_CHANGED")
function w:OnEvent(event, ...)
    if event == "PLAYER_FOCUS_CHANGED" then
        if UnitIsPlayer("focus") then
            color = RAID_CLASS_COLORS[select(2, UnitClass("focus"))]
        end
        if color then
            FocusFrameHealthBar:SetStatusBarColor(color.r, color.g, color.b)
            FocusFrameHealthBar.lockColor = true
        end
    end
end
w:SetScript("OnEvent", w.OnEvent)
(:
  Reply With Quote