Thread: oUF PP
View Single Post
08-08-16, 03:48 PM   #3
badness
A Cliff Giant
 
badness's Avatar
Join Date: May 2010
Posts: 74
Originally Posted by p3lim View Post
You have a problem with a tag, yet you didn't post the code for the tag *shrugs*
Sorry I'm still learning...here is the tag part

Lua Code:
  1. oUF.Tags.Methods['freeb:pp'] = function(u)
  2.     local power, powermax = UnitPower(u), UnitPowerMax(u)
  3.  
  4.     if power > 0 then
  5.         local _, str, r, g, b = UnitPowerType(u)
  6.         local t = oUF.colors.power[str]
  7.  
  8.         if t then
  9.             r, g, b = t[1], t[2], t[3]
  10.         end
  11.  
  12.         local perc = floor((power/powermax)*100+.5)
  13.         perc = powermax > 150 and " | "..perc.."%|r" or ""
  14.        
  15.         return hex(r, g, b)..siValue(power)..perc.."|r"
  16.     end
  17. end
  18. oUF.Tags.Events['freeb:pp'] = 'UNIT_POWER'
  Reply With Quote