Quantcast
WoWInterface - View Single Post - Creating aura errors '/fstack' command
View Single Post
07-28-16, 11:06 PM   #3
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by lightspark View Post
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:
  1. local function CreateAuraIcon(frame, index)
  2.     -- code here
  3. end
  4.  
  5. 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:
  1. A.AuraCreateIcon = function(f, index)
  2.     local button = CreateFrame("Button", f:GetName() .. index, f);
  3.     button:SetSize(buffSize, buffSize);
  4.     button:RegisterForClicks("RightButtonUp");
  5.  
  6.     local cd = CreateFrame("Cooldown", button:GetName() .. "CoolDown", button, "CooldownFrameTemplate");
  7.     cd:SetPoint("CENTER");
  8.     cd:SetSize(button:GetWidth() - 2, button:GetHeight() - 2);
  9.  
  10.     local icon = button:CreateTexture(nil, "BORDER");
  11.     icon:SetTexCoord(.1, .9, .1, .9);
  12.     icon:SetPoint("CENTER");
  13.     icon:SetSize(button:GetWidth() - 2, button:GetHeight() - 2);
  14.  
  15.     E.A.CreateEightBorders(icon, button, "Border", BACKDROP, {1, 0, 0, 1});
  16.  
  17.     local count = button:CreateFontString(nil, "OVERLAY");
  18.     count:SetFontObject(NumberFontNormal);
  19.     count:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 0);
  20.  
  21.     local overlay = button:CreateTexture(nil, "OVERLAY");
  22.     overlay:SetTexture("Interface\\Buttons\\UI-Debuff-Overlays");
  23.     overlay:SetAllPoints(button);
  24.     overlay:SetTexCoord(.296875, .5703125, 0, .515625);
  25.     button.overlay = overlay;
  26.  
  27.     local stealable = button:CreateTexture(nil, "OVERLAY");
  28.     stealable:SetTexture("Interface\TargetingFrame\UI-TargetingFrame-Stealable");
  29.     stealable:SetPoint("TOPLEFT", -3, 3);
  30.     stealable:SetPoint("BOTTOMRIGHT", 3, -3);
  31.     stealable:SetBlendMode("ADD");
  32.     button.stealable = stealable;
  33.  
  34.     button.UpdateTooltip = UpdateTooltip;
  35.     button:SetScript("OnEnter", OnEnter);
  36.     button:SetScript("OnLeave", OnLeave);
  37.  
  38.     button.icon = icon;
  39.     button.count = count;
  40.     button.cd = cd;
  41.  
  42.     --[[ :PostCreateIcon(button)
  43.  
  44.      Callback which is called after a new aura icon button has been created.
  45.  
  46.      Arguments
  47.  
  48.      button - The newly created aura icon button.
  49.      ]]
  50.  
  51.     if (f.PostCreateIcon) then
  52.         f:PostCreateIcon(button);
  53.     end
  54.  
  55.     return button;
  56. 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!

Last edited by Layback_ : 07-30-16 at 09:47 PM.
  Reply With Quote