big refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-19 11:57:12 +02:00
parent 667990f7d8
commit 7740ba2f7a
28 changed files with 271 additions and 266 deletions
+6 -6
View File
@@ -1,8 +1,8 @@
aux.module 'control'
private.event_frame = CreateFrame('Frame')
private.listeners = {}
private.threads = {}
event_frame = CreateFrame('Frame')
listeners = {}
threads = {}
public.thread_id = nil
function m.LOAD()
@@ -10,7 +10,7 @@ function m.LOAD()
m.event_frame:SetScript('OnEvent', m.EVENT)
end
function private.EVENT()
function EVENT()
for _, listener in m.listeners do
if event == listener.event and not listener.killed then
listener.cb(listener.kill)
@@ -18,7 +18,7 @@ function private.EVENT()
end
end
function private.UPDATE()
function UPDATE()
for _, listener in m.listeners do
if not aux.util.any(m.listeners, function(l) return not l.killed and l.event == listener.event end) then
m.event_frame:UnregisterEvent(listener.event)
@@ -44,7 +44,7 @@ end
do
local id = 0
function private.id()
function id()
id = id + 1
return id
end