This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Classic Theme
Thottbot Theme
Weakaura all purpose power bar
Post Reply
Return to board index
Post by
Equalize
Hello,
I have been trying to make a all purpose power bar with weakauras that will change colour based on the resource type that the class Im playing has.
Below is what I am currently using however it has the problem what the r,g,b codes seems to be binary as in they are either on or off and there is no colour range which means that as it is now "Rage" with its code of 142,16,2 shows as grey and not a shade of red.
If anyone has a solution to fix this and add full colour range that would be fantastic.
Thanks :)
function()
local rage = UnitPower("Player", 1)
local _,PowerType = UnitPowerType("player")
local red, green, blue = 0,0,0
if PowerType == "RAGE" then
red, green, blue = 142,16,2
elseif PowerType == "MANA" then
red, green, blue = 0,0,1
elseif PowerType == "ENERGY" then
red, green, blue = 1,1,0
end
return red, green, blue, 1
end
Post by
Equalize
solved, wa uses point float so 0-1 not 0-255.
also using conditions can achieve the same outcome and is much more simple.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.