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:
local function SkinGrid()
local GridFrame = Grid and Grid:GetModule("GridFrame")
if GridFrame and GridFrame.registeredFrames then
hooksecurefunc(GridFrame, "RegisterFrame", function(frame)
CreateBorderLight(frame, LeUI.media.bordersize, LeUI.bordercolor, LeUI.bordercolor, LeUI.bordercolor, 2)
print("Adding borders to Grid frame")
end)
return true
end
end
if not SkinGrid() then
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:RegisterEvent("PLAYER_LOGIN")
f:SetScript("OnEvent", function()
if SkinGrid() then
f:UnregisterAllEvents()
f:SetScript("OnEvent", nil)
SkinGrid = nil
end
end)
end
>.> I'm still learning here too.