Thread: I admit defeat
View Single Post
12-06-13, 02:29 PM   #3
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
the only good things about this coding when sick area. I keep losing my train of thought.
b. I am not afraid to delete ENTIRE files (yep, I am missing half an add-on)
and especially c. I actually use github, and "gitted" almost everything.


I keep wondering though :
Lua Code:
  1. local __, Inomena = ...
I think this is : Set _ to the addonname (uhm ok) and Inomena gets made into a table.

Frame handler created just to deal with all the OnEvents
Lua Code:
  1. local handler = CreateFrame('Frame') -- creating frame, nothing special
  2. handler:SetScript('OnEvent', function(self, event, ...) -- on an event, the event name is the function name
  3. self[event](...) -- execute the function which has the same name as the event which fires the function
  4. end)

But then this mastodont .. just wild
Lua Code:
  1. local metatable = { -- create metatable
  2. __call = function(funcs, self, ...) -- no clue on __call
  3. for __, func in pairs (funcs) do
  4. func(self, ...)
  5. end
  6. end
  7. }

There has got to be an easier way that I *can* understand :P
But I am watching too many events to just do each one separately, all I wanted was to find that one "event handler" that I can drop into my eavu.lua (is loaded first btw) and then use Eavu.EVENT() in the other modules.
  Reply With Quote