View Single Post
05-14-12, 09:56 AM   #15
lerb
A Frostmaul Preserver
 
lerb's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 264
Thanks for the hints unlimit. I did what you said, but still there seems to be something I'm missing. To make it simple, I tried using this code;

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

Sadly, that doesn't do anything. I'm not sure about how hooksecurefunc works, but I'm guessing out of the blue that this code is something like this; "When grid spawns a new frame, this hooksecurefunc 'senses' it and fires my Grid_AddBorder function, which is a command that tells !beautycase to add a border to the frame spawned by grid".

Please, correct me if I'm wrong. Which I probably am
  Reply With Quote