View Single Post
Unread 03-29-07, 08:17 AM   #4
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
Replied to your pm. just posting this for anyone wondering if you had been helped yet. For anyone else interested in what I gave him here it is. The energy bar (Mana, Rage, Power) can be changed with the variables located at lines 2 through 7 here: http://wdn.wowinterface.com/code/li...L/UnitFrame.lua

You should be able to change the values in this table directly as follows:
Code:
-- mana color changed to purple
ManaBarColor[0].r = 1;
ManaBarColor[0].g = 0;
ManaBarColor[0].b = 1;
I tested this in game, and the default game mechanics handle using the colors you specify, so you don't need to do anything special other than change those color values. The healthbar is a little different however. It supports color changing based on health, so the values for color are a bit more hardcoded into a function located here: http://wdn.wowinterface.com/code/liv.../HealthBar.lua

To change it you would need to hook that function, and replace the values with ones you wanted. I am not a big fan of hooking however, so I might recommend a different approach:
Code:
local frame = CreateFrame('Frame', nil, UIParent);
frame:RegisterEvent("UNIT_HEALTH");
frame:RegisterEvent("PLAYER_ENTERING_WORLD");
frame:SetScript("OnEvent", function() 
	PlayerFrameHealthBar:SetStatusBarColor(r,g,b,1);
end);
Just replace the r, g, and b in the SetStatusBarColor widget with the colors you want, and you are done. The health bar SHOULD be forced to the color you specify. Take what I put here with a grain of salt. I didn't really thoroughly test this, so it is more or less something I just threw together in 5 minutes.
Beladona is offline   Reply With Quote