Hello. I'm using rActionButtonStyler and I've modified it a little. Instead of using textures around my buttons, I'm using frames, so I can easily make it pixel perfect for any resolution. But that's where the problem is. While the regular action bar causes no issues, the part which styles the pet button will (temporarily) freeze WoW when entering a vehicle, and will drastically reduce fps when playing with a pet for a certain period of time (usually half an hour - an hour). Both of these problems can also result into a crash if the freeze is too long.
This is my code.
Code:
-- rActionButtonStyler - roth 2009
local _G = _G
---------------------------------------
-- FUNCTIONS
---------------------------------------
--initial style func
local function rActionButtonStyler_AB_style(self)
if not self.rabsstyle 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 fl = _G[name.."Flash"]
local nt = _G[name.."NormalTexture"]
nt:SetHeight(bu:GetHeight())
nt:SetWidth(bu:GetWidth())
nt:SetPoint("Center", 0, 0)
bo:Hide()
bo.Show = dummy
co:SetFont(FONT, 8 / .7, "OUTLINEMONOCHROME")
co:ClearAllPoints()
co:SetPoint("TOP", 0, -2)
ho:Hide()
ho.Show = dummy
na:Hide()
bu:SetCheckedTexture(QUEST_GLOW)
bu:SetNormalTexture("")
ic:SetTexCoord(.08, .92, .08, .92)
ic:SetPoint("TOPLEFT", bu, "TOPLEFT", 1 / .7, -1 / .7)
ic:SetPoint("BOTTOMRIGHT", bu, "BOTTOMRIGHT", -1 / .7, 1 / .7)
nt.SetHeight = dummy
nt.SetWidth = dummy
fl.SetTexture = dummy
bu.SetHighlightTexture = dummy
bu.SetPushedTexture = dummy
bu.SetCheckedTexture = dummy
bu.SetNormalTexture = dummy
co.SetPoint = dummy
nt.SetVertexColor = dummy
local bg = CreateFrame("Frame",nil, self)
bg:SetBackdrop({
bgFile = "",
edgeFile = BACKDROP,
edgeSize = 1 / .7,
insets = {left = 0, right = 0, top = 0, bottom = 0},
})
bg:SetBackdropBorderColor(0, 0, 0)
bg:SetAllPoints(self)
bg:SetFrameStrata("LOW")
self.rabsstyle = true
end
end
--style pet buttons
local function rActionButtonStyler_AB_stylepet()
for i=1, NUM_PET_ACTION_SLOTS do
local name = "PetActionButton"..i
local bu = _G[name]
local ic = _G[name.."Icon"]
local fl = _G[name.."Flash"]
local nt = _G[name.."NormalTexture2"]
nt:SetHeight(bu:GetHeight())
nt:SetWidth(bu:GetWidth())
nt:SetPoint("Center", 0, 0)
bu:SetCheckedTexture(QUEST_GLOW)
bu:SetNormalTexture("")
local pbg = CreateFrame("Frame",nil, bu)
pbg:SetBackdrop({
bgFile = "",
edgeFile = BACKDROP,
edgeSize = 1 / 1,
insets = {left = 0, right = 0, top = 0, bottom = 0},
})
pbg:SetBackdropBorderColor(0, 0, 0)
pbg:SetAllPoints(bu)
pbg:SetFrameStrata("LOW")
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
---------------------------------------
-- CALLS // HOOKS
---------------------------------------
hooksecurefunc("ActionButton_Update", rActionButtonStyler_AB_style)
hooksecurefunc("PetActionBar_Update", rActionButtonStyler_AB_stylepet)
The highlighted part is the problem. I'm fairly sure it's not the same with the regular action bar, because leaving out the highlighted part fixes the issue.
My guess is that for each button refreshed WoW will create a new frame which will result in the performance loss. How can I stop this?
Any help would be most appreciated, I've had this issue for a long time.