Quantcast
WoWInterface - View Single Post - TargetFrameAura manipulation
View Single Post
07-24-20, 10:48 AM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,276
Do you need to check for a buff? It seems you could alter the frames regardless of buff so long as you only do it once for each (assuming frame:CreateBeautyBorder creates a new frame each time)

Something more like:
Lua Code:
  1. -- This probalby only needs to run once at startup
  2. TargetFrameHealthBarText:ClearAllPoints()
  3. TargetFrameHealthBarText:SetPoint("CENTER", TargetFrame, "CENTER", -50, 7)
  4. TargetFrameManaBarText:SetScale(0.8)
  5.  
  6. local MaxReached
  7. local function SkinTarget()
  8.     if MaxReached then return end -- Why keep doing it
  9.     if TargetFrame:IsShown() then
  10.         for i = 1, MAX_TARGET_BUFFS do
  11.             frame = _G["TargetFrameBuff" .. i]
  12.             if not frame then break end
  13.             if not frame.BeautyBorder then -- Have we adjusted this frame before?
  14.                 frame:CreateBeautyBorder(config.buff.bordersize)
  15.                 frame:SetBeautyBorderTexture(config.border.default)
  16.                 frame:SetScale(config.buff.scale)
  17.                 frame.BeautyBorder = true
  18.                 frameBorder = _G["TargetFrameBuff" .. i .. "Border"]
  19.                 frameCount = _G["TargetFrameBuff" .. i .. "Count"]
  20.                 frameBorder:Hide()
  21.                 frameCount:SetFont(config.font.atari, config.buff.fontsize, config.buff.outline)
  22.                 frameCount:SetPoint(unpack(config.buff.position))
  23.                 if i == MAX_TARGET_BUFFS then
  24.                     MaxReached = true
  25.                 end
  26.             end
  27.         end
  28.     end
  29. end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 07-24-20 at 10:55 AM.
  Reply With Quote