Originally Posted by lightspark
Ugh, that's an old bug in aura.lua, I forgot about it, cuz I never use default aura button constructor.
Default oUF aura buttons and few other frames have no names assigned, and it causes /fstack errors.
For now just do not use default constructor. You'll have to create your own create button function, you can pretty much copy-paste existing one, and add names to all frames. And then override it this way:
Lua Code:
local function CreateAuraIcon(frame, index) -- code here end f.Buffs.CreateIcon = CreateAuraIcon
|
Hi lightspark,
Creating a custom constructor worked
!!
EDIT: I just have been editing the constructor and this is how it looks like now.
Lua Code:
A.AuraCreateIcon = function(f, index)
local button = CreateFrame("Button", f:GetName() .. index, f);
button:SetSize(buffSize, buffSize);
button:RegisterForClicks("RightButtonUp");
local cd = CreateFrame("Cooldown", button:GetName() .. "CoolDown", button, "CooldownFrameTemplate");
cd:SetPoint("CENTER");
cd:SetSize(button:GetWidth() - 2, button:GetHeight() - 2);
local icon = button:CreateTexture(nil, "BORDER");
icon:SetTexCoord(.1, .9, .1, .9);
icon:SetPoint("CENTER");
icon:SetSize(button:GetWidth() - 2, button:GetHeight() - 2);
E.A.CreateEightBorders(icon, button, "Border", BACKDROP, {1, 0, 0, 1});
local count = button:CreateFontString(nil, "OVERLAY");
count:SetFontObject(NumberFontNormal);
count:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 0);
local overlay = button:CreateTexture(nil, "OVERLAY");
overlay:SetTexture("Interface\\Buttons\\UI-Debuff-Overlays");
overlay:SetAllPoints(button);
overlay:SetTexCoord(.296875, .5703125, 0, .515625);
button.overlay = overlay;
local stealable = button:CreateTexture(nil, "OVERLAY");
stealable:SetTexture("Interface\TargetingFrame\UI-TargetingFrame-Stealable");
stealable:SetPoint("TOPLEFT", -3, 3);
stealable:SetPoint("BOTTOMRIGHT", 3, -3);
stealable:SetBlendMode("ADD");
button.stealable = stealable;
button.UpdateTooltip = UpdateTooltip;
button:SetScript("OnEnter", OnEnter);
button:SetScript("OnLeave", OnLeave);
button.icon = icon;
button.count = count;
button.cd = cd;
--[[ :PostCreateIcon(button)
Callback which is called after a new aura icon button has been created.
Arguments
button - The newly created aura icon button.
]]
if (f.PostCreateIcon) then
f:PostCreateIcon(button);
end
return button;
end
The icon's width and height had successfully decreased by 2, but cd's size did not decrease which I don't get why...
I've checked aura.lua file and there was no such function modifies cd's size...
Could I get some advice on this as well?
Thank you!