diff Templates.lua @ 115:8c94bee4fdfc

- AddHandler simplified - Centralized combat start/stop hooks - WorldState removed
author Nenue
date Tue, 28 Mar 2017 07:02:26 -0400
parents 26938ae258b7
children 1f68c46bc4de
line wrap: on
line diff
--- a/Templates.lua	Mon Mar 27 00:39:29 2017 -0400
+++ b/Templates.lua	Tue Mar 28 07:02:26 2017 -0400
@@ -5,7 +5,7 @@
 --
 -- Mover Widget base
 local ADDON, Veneer = ...
-local print = DEVIAN_WORKSPACE and function(...) _G.print('VnTemplate', ...) end or nop
+local print = DEVIAN_WORKSPACE and function(...) _G.print('Veneer', ...) end or nop
 local PlaySoundKitID = DEVIAN_WORKSPACE and PlaySoundKitID or nop
 local ipairs, pairs = ipairs, pairs
 local pack, unpack = pack, unpack
@@ -30,6 +30,7 @@
   for i, region in ipairs(handler.ConfigLayers) do
     region:SetShown(Veneer.ConfigMode)
   end
+
 end
 
 function ConfigLayer:OnUpdate()
@@ -71,6 +72,7 @@
 
 -- Replace if module needs to do more than reconcile SavedVariables pointers
 function Handler:Setup()
+  print(self:GetName(), '|cFF00FF88Setup()')
   local configName = self:GetName():gsub('^Veneer', '')
   VeneerData[configName] = VeneerData[configName] or self.defaultSettings or {}
 
@@ -80,6 +82,14 @@
       VeneerData[configName][k] = v
     end
   end
+
+  if self.EventList then
+    for _, event in ipairs(self.EventList) do
+      print(self:GetName(), event, 'registered')
+      self:RegisterEvent(event)
+    end
+  end
+
   local guid = UnitGUID('player')
   self.data = VeneerData[configName]
   self.data[guid] = self.data[guid] or {}