View Single Post
05-14-12, 11:02 AM   #16
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484
Signature:
hooksecurefunc([table,] "function", hookfunc)

Arguments:
table - A table object that contains the function to be hooked (table)
function - The name of the function to be hooked (string)
hookfunc - The function to be called each time the original function is called (function)
So every time, in your case, GridFrame:RegisterFrame is called, the function you specify will also run along side of it. (I think.)

Also, I think half of the advice I gave you is also wrong. <.< Setting it as a dependency is right, but honestly I don't really know where to put the hooksecurefunc now that I look at the code? Possibly just:

lua Code:
  1. local function SkinGrid()
  2.     local GridFrame = Grid and Grid:GetModule("GridFrame")
  3.     if GridFrame and GridFrame.registeredFrames then
  4.        
  5.         hooksecurefunc(GridFrame, "RegisterFrame", function(frame)
  6.             CreateBorderLight(frame, LeUI.media.bordersize, LeUI.bordercolor, LeUI.bordercolor, LeUI.bordercolor, 2)
  7.             print("Adding borders to Grid frame")
  8.         end)
  9.  
  10.         return true
  11.     end
  12. end
  13.  
  14. if not SkinGrid() then
  15.     local f = CreateFrame("Frame")
  16.     f:RegisterEvent("ADDON_LOADED")
  17.     f:RegisterEvent("PLAYER_LOGIN")
  18.     f:SetScript("OnEvent", function()
  19.         if SkinGrid() then
  20.             f:UnregisterAllEvents()
  21.             f:SetScript("OnEvent", nil)
  22.             SkinGrid = nil
  23.         end
  24.     end)
  25. end

>.> I'm still learning here too.
__________________


kúdan: im playing pantheon
JRCapablanca: no youre not
** Pantheon has been Banned. **

Last edited by unlimit : 05-14-12 at 11:20 AM.
  Reply With Quote