Guest User

Untitled

a guest
Nov 24th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.25 KB | None | 0 0
  1. -- rActionButtonStyler by Roth, modified.
  2.  
  3. local F, C = unpack(Aurora)
  4.  
  5. local r, g, b = C.classcolours
  6.  
  7. local function stylebars(self)
  8.     if not self.styled and self:GetParent() and self:GetParent():GetName() ~= "MultiCastActionBarFrame" and self:GetParent():GetName() ~= "MultiCastActionPage1" and self:GetParent():GetName() ~= "MultiCastActionPage2" and self:GetParent():GetName() ~= "MultiCastActionPage3" then
  9.         local action = self.action
  10.         local name = self:GetName()
  11.         local bu  = _G[name]
  12.         local ic  = _G[name.."Icon"]
  13.         local co  = _G[name.."Count"]
  14.         local bo  = _G[name.."Border"]
  15.         local ho  = _G[name.."HotKey"]
  16.         local na  = _G[name.."Name"]
  17.         local nt  = _G[name.."NormalTexture"]
  18.  
  19.         bo:Hide()
  20.         bo.Show = F.dummy
  21.  
  22.         co:SetFont("Interface\\AddOns\\SharedMedia\\Fonts\\Pixel.ttf", 8, "OUTLINEMONOCHROME")
  23.         co:ClearAllPoints()
  24.         co:SetPoint("TOP", 1, -2)
  25.         co:SetDrawLayer("OVERLAY")
  26.  
  27.         if ["hotkey"] == true then
  28.             ho:ClearAllPoints()
  29.             ho:SetPoint("BOTTOM", 0, 1)
  30.             ho:SetFont("Interface\\AddOns\\SharedMedia\\Fonts\\Pixel.ttf", 8, "OUTLINEMONOCHROME")
  31.             ho:SetDrawLayer("OVERLAY")
  32.         else
  33.             ho:Hide()
  34.             ho.Show = F.dummy
  35.         end
  36.  
  37.         na:Hide()
  38.  
  39.         bu:SetNormalTexture("")
  40.         bu:SetPushedTexture("")
  41.         bu:SetHighlightTexture("")
  42.         bu:SetCheckedTexture(C.media.backdrop)
  43.  
  44.         local ch = bu:GetCheckedTexture()
  45.         ch:SetVertexColor(r, g, b)
  46.         ch:SetDrawLayer("ARTWORK")
  47.         ch:SetAllPoints(bu)
  48.  
  49.         ic:SetTexCoord(.08, .92, .08, .92)
  50.         ic:SetDrawLayer("OVERLAY")
  51.         ic:SetPoint("TOPLEFT", bu, "TOPLEFT", 1, -1)
  52.         ic:SetPoint("BOTTOMRIGHT", bu, "BOTTOMRIGHT", -1, 1)
  53.  
  54.         bu.SetPushedTexture = F.dummy
  55.         bu.SetCheckedTexture = F.dummy
  56.         bu.SetNormalTexture = F.dummy
  57.         co.SetPoint = F.dummy
  58.         co.SetFont = F.dummy
  59.         ho.ClearAllPoints = F.dummy
  60.         ho.SetPoint = F.dummy
  61.         ho.SetFont = F.dummy
  62.         ho.SetJustifyH = F.dummy
  63.  
  64.         bu:SetBackdrop({
  65.             edgeFile = C.media.backdrop,
  66.             edgeSize = 1,
  67.         })
  68.         bu:SetBackdropBorderColor(0, 0, 0)
  69.  
  70.         self.styled = true
  71.     end
  72. end
  73.  
  74. local function stylepet()
  75.     for i = 1, NUM_PET_ACTION_SLOTS do
  76.         local name = "PetActionButton"..i
  77.         local bu  = _G[name]
  78.         local ic  = _G[name.."Icon"]
  79.         local nt  = _G[name.."NormalTexture2"]
  80.  
  81.         nt:SetHeight(bu:GetHeight())
  82.         nt:SetWidth(bu:GetWidth())
  83.         nt:SetPoint("Center", 0, 0)
  84.  
  85.         bu:SetCheckedTexture(C.media.checked)
  86.         bu:SetNormalTexture("")
  87.  
  88.         ic:SetTexCoord(0.08, 0.92, 0.08, 0.92)
  89.         ic:SetPoint("TOPLEFT", bu, "TOPLEFT", 1, -1)
  90.         ic:SetPoint("BOTTOMRIGHT", bu, "BOTTOMRIGHT", -1, 1)
  91.     end  
  92. end
  93.  
  94. for i=1, NUM_PET_ACTION_SLOTS do
  95.     local name = "PetActionButton"..i
  96.     local bu  = _G[name]
  97.  
  98.     _G[name.."AutoCastable"]:SetAlpha(0)
  99.     _G[name.."Icon"]:SetDrawLayer("OVERLAY")
  100.  
  101.     F.CreateBD(bu)
  102. end
  103.  
  104. hooksecurefunc("ActionButton_Update", stylebars)
  105. hooksecurefunc("PetActionBar_Update", stylepet)
  106.  
  107. local buttons = 0
  108. local function flyoutbutton()
  109.     for i = 1, buttons do
  110.         local bu = _G["SpellFlyoutButton"..i]
  111.         if bu and not bu.styled then
  112.             stylebars(bu)
  113.  
  114.             --if bu:GetChecked() then
  115.             --  bu:SetChecked(nil)
  116.             --end
  117.             bu.styled = true
  118.         end
  119.     end
  120. end
  121.  
  122. SpellFlyout:HookScript("OnShow", flyoutbutton)
  123.  
  124. local function styleflyout(self)
  125.     if not self.reskinned then
  126.         self.FlyoutBorder:SetAlpha(0)
  127.         self.FlyoutBorderShadow:SetAlpha(0)
  128.  
  129.         SpellFlyoutHorizontalBackground:SetAlpha(0)
  130.         SpellFlyoutVerticalBackground:SetAlpha(0)
  131.         SpellFlyoutBackgroundEnd:SetAlpha(0)
  132.  
  133.         self.reskinned = true
  134.     end
  135.  
  136.     for i=1, GetNumFlyouts() do
  137.         local x = GetFlyoutID(i)
  138.         local _, _, numSlots, isKnown = GetFlyoutInfo(x)
  139.         if isKnown then
  140.             buttons = numSlots
  141.             break
  142.         end
  143.     end
  144. end
  145.  
  146. hooksecurefunc("ActionButton_UpdateFlyout", styleflyout)
  147.  
  148. if ["shapeshift"] == true then
  149.     local bu, ic
  150.  
  151.     local function styleshift()
  152.         for i = 1, NUM_SHAPESHIFT_SLOTS do
  153.             bu  = _G["ShapeshiftButton"..i]
  154.  
  155.             if bu:IsShown() and not bu.reskinned then
  156.                 ic  = _G["ShapeshiftButton"..i.."Icon"]
  157.  
  158.                 bu:SetNormalTexture("")
  159.                 bu:SetPushedTexture("")
  160.                 bu:SetCheckedTexture(C.media.checked)
  161.  
  162.                 F.CreateBG(bu)
  163.  
  164.                 ic:SetDrawLayer("ARTWORK")
  165.                 ic:SetTexCoord(0.08, 0.92, 0.08, 0.92)
  166.  
  167.                 bu.reskinned = true
  168.             end
  169.         end
  170.     end
  171.  
  172.     hooksecurefunc("ShapeshiftBar_Update", styleshift)
  173.     hooksecurefunc("ShapeshiftBar_UpdateState", styleshift)
  174. end
Add Comment
Please, Sign In to add comment