Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- rActionButtonStyler by Roth, modified.
- local F, C = unpack(Aurora)
- local r, g, b = C.classcolours
- local function stylebars(self)
- 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
- local action = self.action
- local name = self:GetName()
- local bu = _G[name]
- local ic = _G[name.."Icon"]
- local co = _G[name.."Count"]
- local bo = _G[name.."Border"]
- local ho = _G[name.."HotKey"]
- local na = _G[name.."Name"]
- local nt = _G[name.."NormalTexture"]
- bo:Hide()
- bo.Show = F.dummy
- co:SetFont("Interface\\AddOns\\SharedMedia\\Fonts\\Pixel.ttf", 8, "OUTLINEMONOCHROME")
- co:ClearAllPoints()
- co:SetPoint("TOP", 1, -2)
- co:SetDrawLayer("OVERLAY")
- if ["hotkey"] == true then
- ho:ClearAllPoints()
- ho:SetPoint("BOTTOM", 0, 1)
- ho:SetFont("Interface\\AddOns\\SharedMedia\\Fonts\\Pixel.ttf", 8, "OUTLINEMONOCHROME")
- ho:SetDrawLayer("OVERLAY")
- else
- ho:Hide()
- ho.Show = F.dummy
- end
- na:Hide()
- bu:SetNormalTexture("")
- bu:SetPushedTexture("")
- bu:SetHighlightTexture("")
- bu:SetCheckedTexture(C.media.backdrop)
- local ch = bu:GetCheckedTexture()
- ch:SetVertexColor(r, g, b)
- ch:SetDrawLayer("ARTWORK")
- ch:SetAllPoints(bu)
- ic:SetTexCoord(.08, .92, .08, .92)
- ic:SetDrawLayer("OVERLAY")
- ic:SetPoint("TOPLEFT", bu, "TOPLEFT", 1, -1)
- ic:SetPoint("BOTTOMRIGHT", bu, "BOTTOMRIGHT", -1, 1)
- bu.SetPushedTexture = F.dummy
- bu.SetCheckedTexture = F.dummy
- bu.SetNormalTexture = F.dummy
- co.SetPoint = F.dummy
- co.SetFont = F.dummy
- ho.ClearAllPoints = F.dummy
- ho.SetPoint = F.dummy
- ho.SetFont = F.dummy
- ho.SetJustifyH = F.dummy
- bu:SetBackdrop({
- edgeFile = C.media.backdrop,
- edgeSize = 1,
- })
- bu:SetBackdropBorderColor(0, 0, 0)
- self.styled = true
- end
- end
- local function stylepet()
- for i = 1, NUM_PET_ACTION_SLOTS do
- local name = "PetActionButton"..i
- local bu = _G[name]
- local ic = _G[name.."Icon"]
- local nt = _G[name.."NormalTexture2"]
- nt:SetHeight(bu:GetHeight())
- nt:SetWidth(bu:GetWidth())
- nt:SetPoint("Center", 0, 0)
- bu:SetCheckedTexture(C.media.checked)
- bu:SetNormalTexture("")
- ic:SetTexCoord(0.08, 0.92, 0.08, 0.92)
- ic:SetPoint("TOPLEFT", bu, "TOPLEFT", 1, -1)
- ic:SetPoint("BOTTOMRIGHT", bu, "BOTTOMRIGHT", -1, 1)
- end
- end
- for i=1, NUM_PET_ACTION_SLOTS do
- local name = "PetActionButton"..i
- local bu = _G[name]
- _G[name.."AutoCastable"]:SetAlpha(0)
- _G[name.."Icon"]:SetDrawLayer("OVERLAY")
- F.CreateBD(bu)
- end
- hooksecurefunc("ActionButton_Update", stylebars)
- hooksecurefunc("PetActionBar_Update", stylepet)
- local buttons = 0
- local function flyoutbutton()
- for i = 1, buttons do
- local bu = _G["SpellFlyoutButton"..i]
- if bu and not bu.styled then
- stylebars(bu)
- --if bu:GetChecked() then
- -- bu:SetChecked(nil)
- --end
- bu.styled = true
- end
- end
- end
- SpellFlyout:HookScript("OnShow", flyoutbutton)
- local function styleflyout(self)
- if not self.reskinned then
- self.FlyoutBorder:SetAlpha(0)
- self.FlyoutBorderShadow:SetAlpha(0)
- SpellFlyoutHorizontalBackground:SetAlpha(0)
- SpellFlyoutVerticalBackground:SetAlpha(0)
- SpellFlyoutBackgroundEnd:SetAlpha(0)
- self.reskinned = true
- end
- for i=1, GetNumFlyouts() do
- local x = GetFlyoutID(i)
- local _, _, numSlots, isKnown = GetFlyoutInfo(x)
- if isKnown then
- buttons = numSlots
- break
- end
- end
- end
- hooksecurefunc("ActionButton_UpdateFlyout", styleflyout)
- if ["shapeshift"] == true then
- local bu, ic
- local function styleshift()
- for i = 1, NUM_SHAPESHIFT_SLOTS do
- bu = _G["ShapeshiftButton"..i]
- if bu:IsShown() and not bu.reskinned then
- ic = _G["ShapeshiftButton"..i.."Icon"]
- bu:SetNormalTexture("")
- bu:SetPushedTexture("")
- bu:SetCheckedTexture(C.media.checked)
- F.CreateBG(bu)
- ic:SetDrawLayer("ARTWORK")
- ic:SetTexCoord(0.08, 0.92, 0.08, 0.92)
- bu.reskinned = true
- end
- end
- end
- hooksecurefunc("ShapeshiftBar_Update", styleshift)
- hooksecurefunc("ShapeshiftBar_UpdateState", styleshift)
- end
Add Comment
Please, Sign In to add comment