SHARE
TWEET

Untitled

a guest Jun 19th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. phbgf = CreateFrame("StatusBar", "bghf", UIParent)
  2. phbgf:SetStatusBarTexture("Interface\\AddOns\\SharedMedia\\statusbar\\Flat.tga")
  3. phbgf:SetFrameStrata(BACKGROUND)
  4. phbgf:SetWidth(225)
  5. phbgf:SetHeight(21)
  6. phbgf:SetPoint("CENTER",0,0)
  7. phbgf:SetStatusBarColor(1,0,0)
  8. phf = CreateFrame("StatusBar", "thf", UIParent)
  9. phf:SetStatusBarTexture("Interface\\AddOns\\SharedMedia\\statusbar\\Flat.tga")
  10. phf:SetFrameStrata(LOW)
  11. phf:SetScript('OnUpdate', function(self)
  12. local ch = UnitHealth("player")
  13. local mh = UnitHealthMax("player")
  14. local ph = 100*(ch/mh)
  15. phf:SetWidth(225*(ph/100))
  16. end)
  17. phf:SetHeight(21)
  18. phf:SetPoint("TOPLEFT", "bghf", 0, 0)
  19. phf:SetStatusBarColor(0.2,0.2,0.2)
  20. local phfht = phbgf:CreateFontString("OVERLAY")
  21. phfht:SetHeight(50)
  22. phfht:SetWidth(100)
  23. phfht:SetFont("Interface\\AddOns\\SharedMedia\\MyMedia Files\\Kenyan.ttf",24,"NONE")
  24. phfht:SetShadowColor(0,0,0,1)
  25. phfht:SetShadowOffset(1,-1)
  26. phfht:SetPoint("RIGHT",75,0)
  27. ppbgf = CreateFrame("StatusBar", "bgpf", UIParent)
  28. ppbgf:SetStatusBarTexture("Interface\\AddOns\\SharedMedia\\statusbar\\Flat.tga")
  29. ppbgf:SetFrameStrata(BACKGROUND)
  30. ppbgf:SetWidth(225)
  31. ppbgf:SetHeight(8)
  32. ppbgf:SetPoint("BOTTOMLEFT","bghf",0,-6)
  33. ppbgf:SetStatusBarColor(0.2,0.2,0.2)
  34. ppf = CreateFrame("StatusBar", "tpf", UIParent)
  35. ppf:SetStatusBarTexture("Interface\\AddOns\\SharedMedia\\statusbar\\Flat.tga")
  36. ppf:SetFrameStrata(LOW)
  37. ppf:SetScript('OnUpdate', function(self)
  38. local cp = UnitPower("player")
  39. local mp = UnitPowerMax("player")
  40. local pp = 100*(cp/mp)
  41. ppf:SetWidth(225*(pp/100))
  42. end)
  43. ppf:SetHeight(8)
  44. ppf:SetPoint("BOTTOMLEFT", "bghf", 0,-5)
  45. ppf:SetStatusBarColor(1,.96,.41)
  46. local ppfpt = ppbgf:CreateFontString("OVERLAY")
  47. ppfpt:SetHeight(50)
  48. ppfpt:SetWidth(18)
  49. ppfpt:SetFont("Interface\\AddOns\\SharedMedia\\MyMedia Files\\Kenyan.ttf",14,"NONE")
  50. ppfpt:SetTextColor(1,.96,.41)
  51. ppfpt:SetShadowColor(0,0,0,1)
  52. ppfpt:SetShadowOffset(1,-1)
  53. ppfpt:SetJustifyH("LEFT")
  54. ppfpt:SetPoint("RIGHT", ppbgf, 22,-5)
  55. phbgf:SetScript('OnUpdate', function(self)
  56.     if MouseIsOver(thf) then
  57.         local ch = UnitHealth("player")
  58.         local mh = UnitHealthMax("player")
  59.         local cp = UnitPower("player")
  60.         local mp = UnitPowerMax("player")
  61.         phfht:SetText(string.format("%s",ch))
  62.         ppfpt:SetText(string.format("%s",cp))
  63.     elseif UnitAffectingCombat("player") then
  64.         local cp = UnitPower("player")
  65.         local ch = UnitHealth("player")
  66.         phfht:SetText(string.format(""))
  67.         ppfpt:SetText(string.format("%s",cp))
  68.     else
  69.         phfht:SetText(string.format(""))
  70.         ppfpt:SetText(string.format(""))
  71.     end
  72. end)
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top