View Single Post
07-11-12, 11:38 AM   #4
Meorawr
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 193
Example code, this'll set the scale of spec buttons 2-<whatever the limit is> to be twice as large.

Lua Code:
  1. local f = CreateFrame("Frame");
  2. f:RegisterEvent("ADDON_LOADED");
  3. f:SetScript("OnEvent", function(self, event, arg1)
  4.       -- These are not the addons you're looking for.
  5.       if(event ~= "ADDON_LOADED"
  6.       or arg1 ~= "Blizzard_TalentUI") then
  7.          return;
  8.       end
  9.       -- Hook function.
  10.       hooksecurefunc("PlayerTalentFrame_CreateSpecSpellButton", function(frame, index)
  11.             -- Determine the name of the created frame.
  12.             local scrollChild = frame.spellsScroll.child;
  13.             local name = scrollChild:GetName() .. "Ability" .. index;
  14.             local button = _G[name];
  15.             -- And now do what you need with the button!
  16.             print(button);
  17.             button:SetScale(2.0);
  18.       end);
  19.       -- In addition, note that SpellSpecButton1 SHOULD exist when the hook is already in place. So you'll need to do stuff to it now as well.
  20. end);

Edit: Oh, you figured it out. Damn it