Quantcast
WoWInterface - View Single Post - How to skin a PallyPower
View Single Post
08-07-10, 06:23 PM   #1
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
How to skin a PallyPower

Code:
if PallyPower then
   hooksecurefunc(PallyPower, "UpdateLayout", function()
      if not PallyPower then return end
      
      local stylef(f)
         f:SetBackdrop({
                  bgFile = "Interface\\Buttons\\WHITE8x8",
                  edgeFile = "Interface\\Buttons\\WHITE8x8",
                  tile = false,
                  tileSize = 0,
                  edgeSize = 1,
                  insets = {left =-1, right =-1, top =-1, bottom =-1},
               })
         f:SetBackdropColor(0, 0, 0, 0.85)
         f:SetBackdropBorderColor(0, 0, 0)
      end
      
      stylef(_G[PallyPowerAuto])
      stylef(_G[PallyPowerRF])
      stylef(_G[PallyPowerAura])
      _G["PallyPowerAuraIcon"]:SetTexCoord(.1,.9,.1,.9)
      _G["PallyPowerRFIcon"]:SetTexCoord(.1,.9,.1,.9)
      _G["PallyPowerAutoIcon"]:SetTexCoord(.1,.9,.1,.9)
      
      if PallyPower.classButtons then
         for i = 1, PALLYPOWER_MAXCLASSES do
            local cBtn = PallyPower.classButtons[i]
            stylef(cBtn)
            local classIcon = _G[cBtn:GetName().."ClassIcon"]
            local buffIcon = _G[cBtn:GetName().."BuffIcon"]
            classIcon:SetTexCoord(.1,.9,.1,.9)
            buffIcon:SetTexCoord(.1,.9,.1,.9)
            
            for j = 1, PALLYPOWER_MAXPERCLASS do
               local pBtn = PallyPower.playerButtons[i][j]
               buffIcon = _G[pBtn:GetName().."BuffIcon"]
               buffIcon:SetTexCoord(.1,.9,.1,.9)
               stylef(pBtn)
            end
         end
      end
   end)
end
  Reply With Quote