View Single Post
08-23-16, 02:21 PM   #6
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Forgot to post the code

Lua Code:
  1. hooksecurefunc("AuraButton_Update", function(self, index)
  2.     local ABuffFrame = _G[self..index]
  3.     if ABuffFrame then
  4.         ABuffFrame:SetSize(33, 33)
  5.         A.CreateBorder(ABuffFrame, true, 33, 33)
  6.     end
  7.        
  8.     local ABuffFrameIcon = _G[self..index.."Icon"]
  9.     if ABuffFrameIcon then
  10.         ABuffFrameIcon:SetTexCoord(0.03, 0.97, 0.03, 0.97)
  11.     end
  12.    
  13.     local ABuffFrameDuration = _G[self..index.."Duration"]
  14.     if ABuffFrameDuration then
  15.         --ABuffFrameDuration:SetDrawLayer("OVERLAY")
  16.         --ABuffFrameDuration:ClearAllPoints()
  17.         --ABuffFrameDuration:SetPoint("BOTTOM", ABuffFrame, "BOTTOM", 1, -15.5)
  18.         --ABuffFrameDuration:SetFont(C.Media.Font, 12, "THINOUTLINE")
  19.         --ABuffFrameDuration:SetShadowOffset(1, -1)
  20.         --ABuffFrameDuration:SetShadowColor(0, 0, 0)
  21.         ABuffFrameDuration:SetAlpha(0)
  22.     end
  23.    
  24.     local ABuffFrameCount = _G[self..index.."Count"]
  25.     if ABuffFrameCount then
  26.         ABuffFrameCount:SetDrawLayer("OVERLAY")
  27.         ABuffFrameCount:ClearAllPoints()
  28.         ABuffFrameCount:SetPoint("BOTTOMRIGHT", ABuffFrame, 1, 1)
  29.         ABuffFrameCount:SetFont(C.Media.Font, 12.5, "THINOUTLINE")
  30.         ABuffFrameCount:SetShadowOffset(1, -1)
  31.         ABuffFrameCount:SetShadowColor(0, 0, 0)
  32.     end
  33.    
  34.     local ABuffFrameBorder = _G[self..index.."Border"]
  35.  
  36.     local R, G, B = ABuffFrameBorder:GetVertexColor()
  37.     ABuffFrameBorder:Hide()
  38.     ABuffFrameBorder.Show = function() end
  39.     ABuffFrameBorder:SetTexture(nil)
  40.     A.ColorBorder(ABuffFrame, R, G, B)     
  41.  
  42.    
  43.  
  44.    
  45.     local BuffStatusBar = CreateFrame("StatusBar", nil, ABuffFrame)
  46.     BuffStatusBar:SetFrameStrata("HIGH")
  47.     BuffStatusBar:SetSize(33, 6)
  48.     BuffStatusBar:SetPoint("BOTTOM", ABuffFrameIcon, 0, -8)
  49.     BuffStatusBar:SetMinMaxValues(0, 1)
  50.     BuffStatusBar:SetStatusBarTexture(C.Media.Texture)
  51.     BuffStatusBar:SetStatusBarColor(A.ClassColor.r, A.ClassColor.g, A.ClassColor.b)
  52.     A.Skin(BuffStatusBar)
  53.    
  54.     local Timer = 0
  55.     local ABuffFrameDuration, Exps, _, Exps
  56.     BuffStatusBar:SetScript("OnUpdate", function(self, Elapsed)
  57.         Timer = Timer + Elapsed
  58.         if Timer >= .1 then
  59.             _,_,_,_,_, ABuffFrameDuration, Exps = UnitBuff("player", index)
  60.             if ABuffFrameDuration == 0 then
  61.                 self:SetValue(1)
  62.             else
  63.                 if Exps then
  64.                     Val = Exps-GetTime()
  65.                     self:SetValue(Val/ABuffFrameDuration)
  66.                 end
  67.             end
  68.             Timer = 0
  69.         end
  70.     end)
  71.    
  72. end)
  Reply With Quote